JET.jl icon indicating copy to clipboard operation
JET.jl copied to clipboard

Report allocations

Open jtrakk opened this issue 4 years ago • 4 comments

Julia docs say

One of the most common techniques to improve performance is to reduce memory allocation.

Julia has some memory-allocation analysis but it would be useful to have in JET.

jtrakk avatar Dec 06 '21 19:12 jtrakk

JET is a static analyzer. There's no reasonable way that it could predict the amount of memory required, but it might be able to address whether memory would be allocated at all.

ProfileView makes it pretty easy to find "serious" allocation: just look for yellow bars.

timholy avatar Dec 06 '21 23:12 timholy

it might be able to address whether memory would be allocated at all.

Right. In some places I may want to ensure there will be no allocation. Highlighting those locations, just like @report_opt, would be helpful for this.

jtrakk avatar Dec 07 '21 01:12 jtrakk

The relevant Julia issue is "A macro that forbids allocation – turning allocation into error" https://github.com/JuliaLang/julia/issues/34248

jtrakk avatar Jan 01 '22 03:01 jtrakk

See the related package: https://github.com/JuliaLang/AllocCheck.jl

kbarros avatar Nov 25 '23 22:11 kbarros