aviatesk / JET.jl

An experimental code analyzer for Julia. No need for additional type annotations.
https://aviatesk.github.io/JET.jl/dev/
MIT License
732 stars 29 forks source link

Report allocations #286

Open jtrakk opened 2 years ago

jtrakk commented 2 years ago

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.

timholy commented 2 years ago

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.

jtrakk commented 2 years ago

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 commented 2 years ago

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

kbarros commented 10 months ago

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