Skip to content

Commit

Permalink
Update memory allocs for using views (JuliaLang#37096)
Browse files Browse the repository at this point in the history
Julia 1.5 wonderfully allocates views on the stack (as you know.)
This PR updates the memory values reported to match 1.5.
  • Loading branch information
JeffFessler authored and simeonschaub committed Aug 29, 2020
1 parent a718fed commit 4c6406d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/performance-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,10 @@ julia> @views fview(x) = sum(x[2:end-1]);
julia> x = rand(10^6);
julia> @time fcopy(x);
0.003051 seconds (7 allocations: 7.630 MB)
0.003051 seconds (3 allocations: 7.629 MB)
julia> @time fview(x);
0.001020 seconds (6 allocations: 224 bytes)
0.001020 seconds (1 allocation: 16 bytes)
```

Notice both the 3× speedup and the decreased memory allocation
Expand Down

0 comments on commit 4c6406d

Please sign in to comment.