Skip to content

Add new benchmark for reusing record type and fix boxing#2353

Open
karpinsn wants to merge 1 commit intoJoshClose:masterfrom
karpinsn:boolBoxing
Open

Add new benchmark for reusing record type and fix boxing#2353
karpinsn wants to merge 1 commit intoJoshClose:masterfrom
karpinsn:boolBoxing

Conversation

@karpinsn
Copy link

Summary

  • This PR adds a new benchmark that reuses the record type to reduce allocations.
  • This fix caches a boxed true and false value on the heap and returns the boxed value instead of reboxing each time in BooleanCovnerter. This saves on allocations and reduces memory presure in the new BenchmarkEnumerateRecordsSingleInstance benchmark.

Before

BeforeBDN Before

After

AfterBDN After

- This PR adds a new benchmark that reuses the record type to reduce
  allocations.
- This fix caches a boxed true and false value on the heap and returns
  the boxed value instead of reboxing each time in BooleanCovnerter.
  This saves on allocations and reduces memory presure in the new
  BenchmarkEnumerateRecordsSingleInstance benchmark.
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.

1 participant