Skip to content

Conversation

@eytan-starkware
Copy link
Contributor

@eytan-starkware eytan-starkware commented Oct 16, 2025

TL;DR

Added mimalloc as the global allocator for all Cairo binaries to improve memory management.

What changed?

  • Added mimalloc as a dependency in the workspace Cargo.toml
  • Configured mimalloc as the global allocator in all binary crates:
    • cairo-compile
    • cairo-execute
    • cairo-format
    • cairo-size-profiler
    • cairo-test
    • get-lowering
    • sierra-compile
    • starknet-compile
    • starknet-sierra-compile
    • starknet-sierra-extract-code
  • Using secure feature in cairo-execute

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@eytan-starkware eytan-starkware force-pushed the eytan_graphite/using_mimallocator_for_better_performance branch from 68b52f2 to 4160337 Compare October 16, 2025 12:50
@eytan-starkware eytan-starkware marked this pull request as ready for review October 16, 2025 12:50
@eytan-starkware eytan-starkware force-pushed the eytan_graphite/using_mimallocator_for_better_performance branch from 4160337 to 98a154e Compare October 16, 2025 12:57
@eytan-starkware eytan-starkware force-pushed the eytan_graphite/using_mimallocator_for_better_performance branch 2 times, most recently from 5f73e2a to 8d434f3 Compare October 19, 2025 13:42
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@orizi reviewed 20 of 22 files at r1, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase)


a discussion (no related file):
Seems CI is still degraded.

@eytan-starkware eytan-starkware force-pushed the eytan_graphite/using_mimallocator_for_better_performance branch from 8d434f3 to fee15ae Compare October 23, 2025 05:26
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi reviewed 3 of 23 files at r4, all commit messages.
Reviewable status: 4 of 24 files reviewed, 2 unresolved discussions (waiting on @eytan-starkware and @giladchase)


crates/bin/starknet-sierra-extract-code/src/main.rs line 11 at r4 (raw file):

#[cfg(feature = "mimalloc")]
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

does this work instead of the use?
cleaner if under cfg.

Suggestion:

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

@eytan-starkware eytan-starkware force-pushed the eytan_graphite/using_mimallocator_for_better_performance branch from fee15ae to b54bee8 Compare October 28, 2025 10:49
Copy link
Contributor Author

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 24 files reviewed, 2 unresolved discussions (waiting on @giladchase and @orizi)


a discussion (no related file):

Previously, orizi wrote…

Seems CI is still degraded.

Now under a feature flag


crates/bin/starknet-sierra-extract-code/src/main.rs line 11 at r4 (raw file):

Previously, orizi wrote…

does this work instead of the use?
cleaner if under cfg.

Done

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@orizi reviewed 24 of 24 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @giladchase)

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

@eytan-starkware eytan-starkware added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit 3694b3e Oct 28, 2025
54 checks passed
@eytan-starkware eytan-starkware deleted the eytan_graphite/using_mimallocator_for_better_performance branch October 28, 2025 11:17
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.

4 participants