Skip to content

Conversation

@recmo
Copy link
Contributor

@recmo recmo commented Aug 22, 2025

Switching to SkyscraperV2 for onchain Merkle trees makes sense (see #147). To realize this, we also need an efficient Noir implementation of SkyscraperV2.

Additionally, we need this for self-recursion.

The current implementation suffers performance in two areas:

  • Field::to_le_bytes does a bytewise comparisson of the result to make sure it represents the canonical representation of the field element. While this check is necessary, it seems in efficient to do it this way.
  • SBOX[bytes[i] as u32] introduces bounds checks. These are completely unnecessary as bytes is by construction constraint to 0..255.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 22, 2025

CodSpeed WallTime Performance Report

Merging #148 will improve performances by 33.33%

Comparing remco/skyscraper-noir (36e3a27) with main (6f0e6e4)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

⚡ 1 improvements
✅ 34 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
reduce_add_rc 4 ns 3 ns +33.33%

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.

2 participants