0382 / CGcoefficient.jl

Compute CG coefficient, Racah coefficient, and Wigner 3j, 6j, 9j Symbols, and give the exact results.
https://0382.github.io/CGcoefficient.jl/
MIT License
1 stars 1 forks source link

Improve cache handling #4

Open yuyichao opened 8 months ago

yuyichao commented 8 months ago

This includes a partially revert of b84fc2d533e8ad54da23c5498591e2c9becbc091.

  1. The cache array never needed to be assigned to so it can definitely be a const.

  2. The max size's handling is reverted to the version before b84fc2d533e8ad54da23c5498591e2c9becbc091 using a Ref{Int}. Julia 1.8+ could just use typed global.

    The original change to not use a Ref doesn't come with an explaination so I'm not sure why it's changed this way.

  3. Move the precomputation into the precompilation step.

    The data is computed eagerly on loading anyway so it doesn't really save anything to not do it at precompilation time.

    This could in principle result in a larger compiled cache file size though if there's enough space to load it into memory there should be enough size to store it on the disk as well. Also, the compiled cache file size is actually smaller probably because the __init__ function is gone.

codecov[bot] commented 8 months ago

Welcome to Codecov :tada:

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered :open_umbrella: