Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching old results #4

Open
janxious opened this issue Sep 7, 2016 · 1 comment
Open

Caching old results #4

janxious opened this issue Sep 7, 2016 · 1 comment

Comments

@janxious
Copy link
Contributor

janxious commented Sep 7, 2016

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?

@stevegrossi
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants