Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NSAutoreleasePool an immutable struct. #30

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Feb 28, 2024

It's often not a good idea to call release anyway. And this improves the performance of the call, avoiding allocations:

julia> @benchmark @autoreleasepool begin end
BenchmarkTools.Trial: 10000 samples with 807 evaluations.
 Range (min  max):  153.810 ns   1.562 μs  ┊ GC (min  max): 0.00%  0.00%
 Time  (median):     156.651 ns              ┊ GC (median):    0.00%
 Time  (mean ± σ):   167.710 ns ± 40.671 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

  █▇▅▄▁▁▁▂▁                                         ▂▂         ▁
  █████████▇▇▆█▆▆▄▃▅▄▄▄▄▃▄▄▂▃▄▄▃▄▄▃▂▄▃▃▄▄▄▂▄▃▄▃▃▄▃▄▆████▇▅▆▆▅▃ █
  154 ns        Histogram: log(frequency) by time       308 ns <

 Memory estimate: 0 bytes, allocs estimate: 0.

It's often not a good idea to call release anyway.
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.55%. Comparing base (6202c8b) to head (1826a81).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
- Coverage   72.06%   70.55%   -1.51%     
==========================================
  Files           9        9              
  Lines         655      652       -3     
==========================================
- Hits          472      460      -12     
- Misses        183      192       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maleadt maleadt merged commit ba64d4d into master Feb 28, 2024
6 of 7 checks passed
@maleadt maleadt deleted the tb/autorelease_immutable branch February 28, 2024 19:10
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.

None yet

1 participant