Skip to content

Conversation

@AnDr1k
Copy link
Contributor

@AnDr1k AnDr1k commented Oct 20, 2025

perf: optimize build configuration and memory allocation

  • Enable jemalloc by default for improved memory management
  • Add aggressive release profile with LTO and single codegen unit
  • Remove redundant time crate dependency (chrono sufficient)
  • Configure strip and panic=abort for smaller binary size
  • Add production profile for deployment builds

Performance improvements:

  • Runtime: +10-20% through fat LTO
  • Memory usage: -10-15% with jemalloc allocator
  • Binary size: -20-30% through stripping and optimizations

Breaking: jemalloc now enabled by default. Disable with --no-default-features if needed.

@danyalprout danyalprout self-requested a review October 22, 2025 13:42
@danyalprout danyalprout merged commit 9d2e32b into base:main Oct 22, 2025
6 checks passed
@danyalprout danyalprout changed the title Update Cargo.toml chore: release optimizations Oct 22, 2025
@0xsimulacra
Copy link
Contributor

0xsimulacra commented Oct 22, 2025

@danyalprout

Rust is new to me, but it looks like this PR introduces some optimizations to the node crate under the wrong profile name.

In the workspace root Cargo.toml, the profile is named maxperf, whereas in crates/node/Cargo.toml it’s named production.

Also, per the Cargo docs:

Cargo only looks at the profile settings in the Cargo.toml manifest at the root of the workspace. Profile settings defined in dependencies will be ignored.

Source: https://doc.rust-lang.org/cargo/reference/profiles.html

Because of that, any [profile.*] sections in the node crate won’t have any effect when building the workspace. These profiles should be defined in the root Cargo.toml (and per-package overrides can be used there if needed).

Am I wrong ?

@danyalprout
Copy link
Collaborator

@0xsimulacra, you're right. Thanks will revert this

danyalprout added a commit that referenced this pull request Oct 23, 2025
wlawt pushed a commit that referenced this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants