Repository navigation
Conversation
Author
|
Draft until I finish iterating on it and hand-read & hand-test the code |
tvolk131
force-pushed
the
perf/direct-byte-array
branch
3 times, most recently
from
October 26, 2026 03:18
d688d1e to
1a31aeb
Compare
Construct one byte buffer and use the cached balanced word type. For widths beyond the cache, extend only the type metadata by taking products of identical halves instead of constructing intermediate values and copying bits. Preserve the power-of-two length assertion. Cover bytes, compact encoding, product views, fixed-width constructors, invalid lengths and cached/uncached type boundaries. Written by OpenAI Codex. Written with GPT 6.1 Sol on Extra High.
tvolk131
force-pushed
the
perf/direct-byte-array
branch
from
October 26, 2026 03:28
1a31aeb to
9bba012
Compare
tvolk131
marked this pull request as ready for review
October 26, 2026 03:40
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.
Value::from_byte_arraybuilds intermediate byte values and products, repeatedly allocating buffers and copying bits. Construct oneArc<[u8]>instead, using the cached balanced word type. Beyond the cache, construct only the missing type levels.A warmed release microbenchmark on macOS ARM64 with Rust 1.99 measured 32-byte construction at 5.06 µs before and 26.4 ns after, with allocations reduced from 131 to 1 (33 paired CPU-time samples; allocation counts measured separately). These are constructor measurements, not application speedups.
Additional local differential checks matched master for 67,640 arrays, including every one-byte and two-byte value and larger cases through 16 KiB.
Validation:
cargo test --locked --workspace --all-features(123 library tests, 14 sys tests, 2 doctests)cargo test --locked -p simplicity-lang --lib --no-default-features(67 tests)cargo +1.74.0 test --offline --locked -p simplicity-lang --lib --all-features(123 tests)cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets --all-features -- --deny warningsWritten by OpenAI Codex.
Written with GPT 6.1 Sol on Extra High.