Removing `2 allocations: 64 bytes`

I am trying to make a super-fast QR decomposition with 0 allocations if possible. At this point https://github.com/mohamed82008/InplaceQR.jl is at 2 allocations: 64 bytes and within a factor of 8 of LAPACK’s multi-threaded qrfact! when using julia.exe --check-bounds=no -O3 so I am happy with it, but just curious where are these 2 allocations coming from? Is it just the REPL?

Thanks in advance.

That’s probably just the heap allocation of the small immutables for the returned types. In hot loops it won’t allocate since they stay on the stack, but when returned into main they are placed on the heap since anything can happen. This doesn’t actually effect code performance though.

1 Like

I see, thanks.