Hi,
Today I found out that after using C=cholesky(A), C.L allocates, while C.U does not. After changing a literally one line of my program from C.L to C.U, (which was using suspiciously high ram) I got a very, very significant reduction in allocations:
julia> @btime out_struct = beavar($model_type, $set_struct, $hyp_struct, $data_struct);
161.937 s (111517 allocations: 39.60 GiB)
julia> @btime out_struct = beavar($model_type, $set_struct, $hyp_struct, $data_struct);
151.357 s (105517 allocations: 502.98 MiB)
I checked ?cholesky and the docs and couldn’t find a mention of this. In the documentation there is a line
Iterating the decomposition produces the components L and U.
which to me always suggested they are both there.
Am I missing something obvious? Wouldn’t it be helpful if there was one line before the examples section in the documentation that warns about this? I asked AI and it said it is implied somewhere but I couldn’t find that either.
I really struggled where to put this topic, so decided to put it in offtopic. Feel free to move if there is a better place.