-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Creating a view (SubArray) of a Vector allocates memory #19257
Comments
I tracked a difference in memory allocation to |
I highly doubt you are testing the right thing. This sounds like a defect of |
Wow, thanks for the quick response! @yuyichao, the only open issue I see in To me, it conceptually doesn't make sense that |
Well, I guess I'm wrong :-) |
The missing allocation info here is definitely a BenchmarkTools issue, see my comment here. |
Currently, if it is not Putting it on the stack requires scanning the stack for pointers that GC needs to know about, and this is tricky to do precisely (apparently - I'm no expert). |
BTW, I do agree with @yuyichao and I'm still worried that BenchmarkTools.jl misses at least some allocations. I'd love to be proven wrong, but... |
D'oh, I knew that; I was just confused. |
|
On 0.5 as well as the latest nightly, for matrices,
results in zero allocation.
However,
results in 48 bytes of allocation and is almost 6 times slower. I haven't been able to figure out what in
subarray.jl
causes this.The text was updated successfully, but these errors were encountered: