Skip to content

Add benchmarks for Quantity operations#1818

Open
AkramBitar wants to merge 1 commit into
mainfrom
feat/quantity-benchmarks-cherry-pick
Open

Add benchmarks for Quantity operations#1818
AkramBitar wants to merge 1 commit into
mainfrom
feat/quantity-benchmarks-cherry-pick

Conversation

@AkramBitar

@AkramBitar AkramBitar commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add benchmarks for BigQuantity and UInt64Quantity operations (Add, Sub, Cmp)
  • Add benchmark for ToQuantity parsing

Continues the work from #1477 (closed), rebased on latest main with review comments addressed:

  • Assert on errors instead of ignoring them (require.NoError)
  • Move setup out of the timed loop and call b.ResetTimer() so only the target op is measured
  • Store side-effect-free results in package-level sinks to prevent dead-code elimination

Resolves #1819

@AkramBitar AkramBitar self-assigned this Jun 25, 2026
@AkramBitar AkramBitar added this to the Q3/26 milestone Jun 25, 2026
@AkramBitar AkramBitar linked an issue Jun 25, 2026 that may be closed by this pull request
@AkramBitar AkramBitar changed the title bench: add benchmarks for Quantity operations Add benchmarks for Quantity operations Jun 25, 2026
@AkramBitar AkramBitar linked an issue Jun 25, 2026 that may be closed by this pull request
@AkramBitar AkramBitar marked this pull request as draft June 25, 2026 13:35
@AkramBitar AkramBitar force-pushed the feat/quantity-benchmarks-cherry-pick branch from 2144c5e to 210c0d0 Compare June 25, 2026 13:36
@AkramBitar AkramBitar requested review from HayimShaul and adecaro June 25, 2026 13:38
@AkramBitar AkramBitar marked this pull request as ready for review June 25, 2026 13:38
Signed-off-by: theycallmeaabie <theycallmeaabie@gmail.com>
Signed-off-by: AkramBitar <akram@il.ibm.com>
@AkramBitar AkramBitar force-pushed the feat/quantity-benchmarks-cherry-pick branch from 210c0d0 to f8c9f48 Compare June 30, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add benchmarks (token/token/quantity.go) chore(token/token/quantity.go): improvements

3 participants