refactor: store array data pointer inline, drop ArrayMetadata.#1619
Open
TomerStarkware wants to merge 1 commit into
Open
refactor: store array data pointer inline, drop ArrayMetadata.#1619TomerStarkware wants to merge 1 commit into
TomerStarkware wants to merge 1 commit into
Conversation
Benchmarking resultsBenchmark for program
|
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
11.678 ± 0.055 | 11.562 | 11.730 | 6.29 ± 0.06 |
cairo-native (embedded AOT) |
1.856 ± 0.017 | 1.838 | 1.885 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1.876 ± 0.008 | 1.867 | 1.891 | 1.01 ± 0.01 |
Benchmark for program dict_snapshot
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
539.1 ± 3.2 | 535.0 | 546.0 | 1.00 |
cairo-native (embedded AOT) |
1678.8 ± 10.7 | 1666.0 | 1694.9 | 3.11 ± 0.03 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1703.3 ± 9.5 | 1691.1 | 1724.7 | 3.16 ± 0.03 |
Benchmark for program factorial_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
5.115 ± 0.016 | 5.088 | 5.144 | 2.39 ± 0.02 |
cairo-native (embedded AOT) |
2.141 ± 0.017 | 2.117 | 2.170 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.154 ± 0.015 | 2.130 | 2.183 | 1.01 ± 0.01 |
Benchmark for program fib_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
5.018 ± 0.023 | 4.973 | 5.049 | 2.97 ± 0.03 |
cairo-native (embedded AOT) |
1.691 ± 0.017 | 1.666 | 1.718 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1.709 ± 0.013 | 1.690 | 1.734 | 1.01 ± 0.01 |
Benchmark for program linear_search
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
581.9 ± 7.5 | 571.0 | 591.6 | 1.00 |
cairo-native (embedded AOT) |
1697.8 ± 16.1 | 1671.1 | 1715.5 | 2.92 ± 0.05 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1733.2 ± 12.0 | 1719.1 | 1749.5 | 2.98 ± 0.04 |
Benchmark for program logistic_map
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
491.9 ± 3.5 | 486.3 | 498.5 | 1.00 |
cairo-native (embedded AOT) |
1829.8 ± 11.5 | 1809.6 | 1848.0 | 3.72 ± 0.04 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1948.9 ± 6.6 | 1940.8 | 1961.6 | 3.96 ± 0.03 |
Benchmark results Main vs HEAD.Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
|
orizi
approved these changes
May 20, 2026
Collaborator
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on TomerStarkware).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: store array data pointer inline, drop ArrayMetadata
Closes #NA
Removes the ArrayMetadata { max_len, data_ptr } indirection. The array struct still has shape {ptr, start, end, capacity}, but ptr now points directly to the element buffer instead of to a heap-allocated metadata struct. max_len was only ever written, never read.
Net effect per array op: one fewer arena allocation and one fewer load.
Introduces Breaking Changes?
Yes.
ArrayAbi.ptr changes from *mut *mut T to *mut T. Any external consumer reading ArrayAbi (notably starknet-replay and the sequencer fork) must follow.
These PRs should be merged after this one right away, in that order.
Checklist
This change is