3 ms·
> once we have better garbage collection IMO the importance of the garbage collector needs to be underscored. My experience with Julia was that if I pre-alloc
by sixbrx 13y ago
> once we have better garbage collection
IMO the importance of the garbage collector needs to be underscored.
My experience with Julia was that if I pre-allocated arrays and wrote in a low level like (C-like) way, then it would be fairly fast (also, need to avoid closures but that's another issue).
If, however, I generated any new values inside loops (and using proper abstractions, this is hard to avoid), then garbage collection would often massively slow down computations and make performance hard to predict.
Unfortunately, I think having a truly high performance garbage collector is a massive undertaking. I hope I'm wrong about that.
- simonster 13y agoSee https://github.com/JuliaLang/julia/pull/5227 https://github.com/JuliaLang/julia/pull/5227 for the open PR. The benchmark there suggests 2-3x improvement. There is a decent amount of low-hanging fruit, although "truly high performance garbage collection" means different things for different applications and LLVM is apparently not a good platform for generational GC. There are further possible improvements that are not strictly related to GC. We could determine that an array of the same size is being created on every iteration of the loop and allocate that memory only once. Ideally we'd automatically devectorize code to remove temporaries, but that is quite hard.