perf: add mimalloc

This commit is contained in:
Almaz
2025-08-10 16:47:59 +00:00
committed by GitHub
parent 98ffdd9bf8
commit a34acf92ca
5 changed files with 37 additions and 5 deletions
+2 -2
View File
@@ -245,9 +245,9 @@ jobs:
env:
RUSTFLAGS: ""
- if: ${{ matrix.cross }}
run: cross +beta build --features tui --release --target '${{ matrix.target }}' --locked
run: cross +beta build --features mimalloc,tui --release --target '${{ matrix.target }}' --locked
- if: ${{ !matrix.cross }}
run: cargo +beta build --features tui --release --target '${{ matrix.target }}' --locked
run: cargo +beta build --features mimalloc,tui --release --target '${{ matrix.target }}' --locked
- run: mkdir dist
- run: echo -n '${{ github.sha }}' > dist/commit-sha.txt
shell: bash
Generated
+20
View File
@@ -1073,6 +1073,16 @@ version = "0.2.174"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
[[package]]
name = "libmimalloc-sys"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf88cd67e9de251c1781dbe2f641a1a3ad66eaae831b8a2c38fbdc5ddae16d4d"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "libredox"
version = "0.1.9"
@@ -1170,6 +1180,15 @@ dependencies = [
"libc",
]
[[package]]
name = "mimalloc"
version = "0.1.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1791cbe101e95af5764f06f20f6760521f7158f69dbf9d6baf941ee1bf6bc40"
dependencies = [
"libmimalloc-sys",
]
[[package]]
name = "mime"
version = "0.3.17"
@@ -1334,6 +1353,7 @@ dependencies = [
"futures",
"httpdate",
"maxminddb",
"mimalloc",
"parking_lot",
"rand 0.9.2",
"ratatui",
+6 -2
View File
@@ -31,8 +31,8 @@ tui-logger = { version = "=0.17.3", features = [
], optional = true }
url = "=2.5.4"
[features]
tui = ["dep:crossterm", "dep:futures", "dep:ratatui", "dep:tui-logger"]
[target.'cfg(all(any(target_arch = "aarch64", target_arch = "x86_64"), any(target_os = "linux", target_os = "macos", target_os = "windows")))'.dependencies]
mimalloc = { version = "=0.1.47", optional = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
reqwest = { version = "=0.12.22", default-features = false, features = [
@@ -59,6 +59,10 @@ reqwest = { version = "=0.12.22", default-features = false, features = [
"system-proxy",
] }
[features]
mimalloc = ["dep:mimalloc"]
tui = ["dep:crossterm", "dep:futures", "dep:ratatui", "dep:tui-logger"]
[profile.release]
strip = true
lto = "fat"
+1 -1
View File
@@ -9,7 +9,7 @@ RUN --mount=source=src,target=src \
--mount=source=Cargo.lock,target=Cargo.lock \
--mount=type=cache,target=/app/target,sharing=locked \
--mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
cargo build --release --locked \
cargo build --features mimalloc --release --locked \
&& cp target/release/proxy-scraper-checker .
+8
View File
@@ -70,6 +70,14 @@ use tracing_subscriber::{
layer::SubscriberExt as _, util::SubscriberInitExt as _,
};
#[cfg(all(
feature = "mimalloc",
any(target_arch = "aarch64", target_arch = "x86_64"),
any(target_os = "linux", target_os = "macos", target_os = "windows"),
))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
fn create_logging_filter(
config: &config::Config,
) -> tracing_subscriber::filter::Targets {