We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@SVector
rand
Hello, on v1.9 I experience some wierd allocations and slow execution when using @SVector and rand with a specific type T:
T
@benchmark @SVector rand(Float64,5) BenchmarkTools.Trial: 10000 samples with 174 evaluations. Range (min … max): 606.052 ns … 21.025 μs ┊ GC (min … max): 0.00% … 96.05% Time (median): 626.333 ns ┊ GC (median): 0.00% Time (mean ± σ): 702.088 ns ± 752.018 ns ┊ GC (mean ± σ): 4.21% ± 3.84% ▂█▇▄▄▄▃▂▂▁ ▁▁ ▂▂ ▁▁ ▁ █████████████████████▇█████▇▆▇▆▇▇▇▇████▇▇▇██▅▆▄▅▄▅▄▅▄▄▄▄▄▄▅▄▄ █ 606 ns Histogram: log(frequency) by time 1.16 μs < Memory estimate: 496 bytes, allocs estimate: 10.
Without a type specifier I get the expected result:
@benchmark @SVector rand(5) BenchmarkTools.Trial: 10000 samples with 1000 evaluations. Range (min … max): 5.640 ns … 90.822 ns ┊ GC (min … max): 0.00% … 0.00% Time (median): 5.650 ns ┊ GC (median): 0.00% Time (mean ± σ): 6.082 ns ± 1.905 ns ┊ GC (mean ± σ): 0.00% ± 0.00% █ ▃ ▁ █▅▄▃▄▃▄▄▅▃▄▃▃▃█▅▃▄▅▆▅▅▅▃▅▆▆▅▅▅▅▅▅▅▅▅▅▆▆▆▆▆▆▆▆▅▆▆▅▅▆▄▆▆▆▆█▇ █ 5.64 ns Histogram: log(frequency) by time 11.3 ns < Memory estimate: 0 bytes, allocs estimate: 0.
Note that on v1.8.2 it gives the expected result:
@benchmark (@SVector rand(Float64,5)) BenchmarkTools.Trial: 10000 samples with 1000 evaluations. Range (min … max): 5.640 ns … 57.621 ns ┊ GC (min … max): 0.00% … 0.00% Time (median): 5.650 ns ┊ GC (median): 0.00% Time (mean ± σ): 5.992 ns ± 1.498 ns ┊ GC (mean ± σ): 0.00% ± 0.00% █ ▃ ▁ █▃▃▂▄▃▄▃▂▃▃▄▄▄█▃▄▄▄▄▄▅▅▄▅▅▅▅▄▅▅▅▅▄▅▅▆▅▅▅▆▅▆▆▆▆▆▅▅▅▃▄▄▅▅▆▇▆ █ 5.64 ns Histogram: log(frequency) by time 11.3 ns <
Memory estimate: 0 bytes, allocs estimate: 0.
The text was updated successfully, but these errors were encountered:
Fix allocations for some cases of rand (#1229)
8804cb4
Fix allocations for some cases of rand (#1229) (#1230)
5913f33
* Fix allocations for some cases of rand (#1229) * add test * this one won't have to be compiled * version? * the test doesn't work
Successfully merging a pull request may close this issue.
Hello,
on v1.9 I experience some wierd allocations and slow execution when using
@SVector
andrand
with a specific typeT
:Without a type specifier I get the expected result:
Note that on v1.8.2 it gives the expected result:
Memory estimate: 0 bytes, allocs estimate: 0.
The text was updated successfully, but these errors were encountered: