Skip to content

Commit

Permalink
use jemalloc and lto
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Dec 20, 2024
1 parent 201f3e5 commit c757a15
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ serde_with = "3"
clap = { version = "4", features = ["derive", "deprecated"] }
ip2proxy = { version = "2", features = ["serde"] }
listenfd = "1"
tikv-jemallocator = { version = "0.6", features = ["unprefixed_malloc_on_supported_platforms"] }

[profile.release]
lto = true
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ use ip2proxy::{Columns, Database, Row};
use listenfd::ListenFd;
use serde::{Deserialize, Serialize};
use serde_with::{formats::CommaSeparator, serde_as, StringWithSeparator};
use tikv_jemallocator::Jemalloc;
use tokio::net::TcpListener;

#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

#[derive(Parser)]
struct Opt {
/// Listen on this socket address.
Expand Down

0 comments on commit c757a15

Please sign in to comment.