You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run series more than once, all the numbers you've spent time computing in the past one must compute again.
I can imagine caching all the numbers, but that is space inefficient. Probably storing 2 sequential numbers on some logarithmic numeric scale would allow one to skip generation for large numbers if you wanted to know a value at a certain point. ETS/GenServer/Agent are the likely candidates for storing this cache data. This is purely a performance hack, but one can imagine warming up the cache and then having sub-µs generation times afterward for very large sequences.
Thoughts?
The text was updated successfully, but these errors were encountered:
It sounds like a great idea, not just for performance but as an educational illustration of using OTP in Elixir libraries, which I had to leave out of my talk due to time.
If you run
series
more than once, all the numbers you've spent time computing in the past one must compute again.I can imagine caching all the numbers, but that is space inefficient. Probably storing 2 sequential numbers on some logarithmic numeric scale would allow one to skip generation for large numbers if you wanted to know a value at a certain point. ETS/GenServer/Agent are the likely candidates for storing this cache data. This is purely a performance hack, but one can imagine warming up the cache and then having sub-µs generation times afterward for very large sequences.
Thoughts?
The text was updated successfully, but these errors were encountered: