Skip to content

Commit

Permalink
jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Jan 17, 2024
1 parent 85365cf commit c4ce697
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ rust_iso3166 = "0.1.11"

multer = "3.0.0"

jemallocator = {version = "0.3.2", optional = true}

[features]
jemalloc = ["jemallocator"]

[dev-dependencies]
axum-test = "14.2.2"
json-patch = "*"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /usr/src/labrinth
# Download and compile deps
COPY . .
ARG SQLX_OFFLINE=true
RUN cargo install --path .
RUN cargo install --features jemalloc --path .

# Final Stage
FROM debian:bullseye-slim
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
POSTGRES_PASSWORD: labrinth
POSTGRES_HOST_AUTH_METHOD: trust
meilisearch:
image: getmeili/meilisearch:v1.5.0
image: getmeili/meilisearch:v1.6.0
restart: on-failure
ports:
- "7700:7700"
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ use tracing::{error, info};
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;

#[cfg(feature = "jemalloc")]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[derive(Clone)]
pub struct Pepper {
pub pepper: String,
Expand Down

0 comments on commit c4ce697

Please sign in to comment.