You've already forked AstralRinth
forked from didirus/AstralRinth
jemalloc (#861)
* jemalloc * featurizeP --------- Co-authored-by: Wyatt Verchere <wverchere@gmail.com>
This commit is contained in:
28
Cargo.lock
generated
28
Cargo.lock
generated
@@ -1633,6 +1633,12 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fs_extra"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "funty"
|
name = "funty"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
@@ -2222,6 +2228,27 @@ version = "1.0.10"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
|
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jemalloc-sys"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"fs_extra",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jemallocator"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
|
||||||
|
dependencies = [
|
||||||
|
"jemalloc-sys",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jobserver"
|
name = "jobserver"
|
||||||
version = "0.1.27"
|
version = "0.1.27"
|
||||||
@@ -2309,6 +2336,7 @@ dependencies = [
|
|||||||
"hyper-tls",
|
"hyper-tls",
|
||||||
"image",
|
"image",
|
||||||
"itertools 0.12.0",
|
"itertools 0.12.0",
|
||||||
|
"jemallocator",
|
||||||
"json-patch",
|
"json-patch",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lettre",
|
"lettre",
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ lettre = "0.11.3"
|
|||||||
derive-new = "0.6.0"
|
derive-new = "0.6.0"
|
||||||
rust_iso3166 = "0.1.11"
|
rust_iso3166 = "0.1.11"
|
||||||
|
|
||||||
|
jemallocator = {version = "0.3.2", optional = true}
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-http = "3.4.0"
|
actix-http = "3.4.0"
|
||||||
json-patch = "*"
|
json-patch = "*"
|
||||||
@@ -116,3 +118,6 @@ opt-level = 0 # Minimal optimization, speeds up compilation
|
|||||||
lto = false # Disables Link Time Optimization
|
lto = false # Disables Link Time Optimization
|
||||||
incremental = true # Enables incremental compilation
|
incremental = true # Enables incremental compilation
|
||||||
codegen-units = 16 # Higher number can improve compile times but reduce runtime performance
|
codegen-units = 16 # Higher number can improve compile times but reduce runtime performance
|
||||||
|
|
||||||
|
[features]
|
||||||
|
jemalloc = ["jemallocator"]
|
||||||
@@ -9,7 +9,7 @@ COPY docker_utils/dummy.rs .
|
|||||||
# Change temporarely the path of the code
|
# Change temporarely the path of the code
|
||||||
RUN sed -i 's|src/main.rs|dummy.rs|' Cargo.toml
|
RUN sed -i 's|src/main.rs|dummy.rs|' Cargo.toml
|
||||||
# Build only deps
|
# Build only deps
|
||||||
RUN cargo build --release
|
RUN cargo build --release --features jemalloc
|
||||||
# Now return the file back to normal
|
# Now return the file back to normal
|
||||||
RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
|||||||
COPY . .
|
COPY . .
|
||||||
# Build our code
|
# Build our code
|
||||||
ARG SQLX_OFFLINE=true
|
ARG SQLX_OFFLINE=true
|
||||||
RUN cargo build --release
|
RUN cargo build --release --features jemalloc
|
||||||
|
|
||||||
# Final Stage
|
# Final Stage
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ use labrinth::{check_env_vars, clickhouse, database, file_hosting, queue};
|
|||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
#[cfg(feature = "jemalloc")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Pepper {
|
pub struct Pepper {
|
||||||
pub pepper: String,
|
pub pepper: String,
|
||||||
|
|||||||
@@ -115,14 +115,19 @@ pub async fn get_indexes_for_indexing(
|
|||||||
let client = config.make_client();
|
let client = config.make_client();
|
||||||
let project_name = config.get_index_name("projects", next);
|
let project_name = config.get_index_name("projects", next);
|
||||||
let project_filtered_name = config.get_index_name("projects_filtered", next);
|
let project_filtered_name = config.get_index_name("projects_filtered", next);
|
||||||
let projects_index = create_or_update_index(&client, &project_name, Some(&[
|
let projects_index = create_or_update_index(
|
||||||
"words",
|
&client,
|
||||||
"typo",
|
&project_name,
|
||||||
"proximity",
|
Some(&[
|
||||||
"attribute",
|
"words",
|
||||||
"exactness",
|
"typo",
|
||||||
"sort",
|
"proximity",
|
||||||
]),).await?;
|
"attribute",
|
||||||
|
"exactness",
|
||||||
|
"sort",
|
||||||
|
]),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
let projects_filtered_index = create_or_update_index(
|
let projects_filtered_index = create_or_update_index(
|
||||||
&client,
|
&client,
|
||||||
&project_filtered_name,
|
&project_filtered_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user