top | item 47179080

(no title)

VorpalWay | 2 days ago

Since I don't know Julia, let me ask: how easy is it to add a use of the GC by mistake in a critical part of the code (maybe a junior dev does it)? Are there any tools to lint against that (some sort of function attribute to deny uses of GC in the function perhaps)? If it happens, how hard is it find the culript lines of code?

Because from what I have seen in other GC languages, the answers to any of those questions haven't been great.

discuss

order

SatvikBeri|2 days ago

You can use AllocCheck.jl to guarantee your code doesn't allocate. It's conservative, so it'll sometimes throw false positives, but shouldn't throw false negatives. You apply the checks to function definitions.

You can profile memory usage line by line in detail pretty easily with tools like @timeit or @btime

In practice I've found it pretty easy to get inner loops down to few or 0 allocations when needed for parallelization

eigenspace|2 days ago

Tooling for this in julia is evolving, but currently works fairly well. It could be better, but could be a lot worse.

There's static analysis tools that might be over-eager finding allocations, and there's also runtime measurement tools which should go into your test suite if it's of vital importance to monitor.

dandanua|2 days ago

It's easy to add, yes. However, the basic @time macro outputs the info about allocations by default. So it is also easy to see if there is a problem.