Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
torrance
on Feb 15, 2021
|
parent
|
context
|
favorite
| on:
Jet.jl: A WIP compile time type checker for Julia
I'm confused by the corrected diff in the README... isn't that cache recreated on each function call to fib(), making the cache pointless?
celrod
on Feb 16, 2021
[–]
It is recreated on every call to `fib`, but the `_fib`s get to reuse it. Using a cache makes `_fib` O(N) to compute, so it gives a performance benefit as long as you aren't calling `fib(n)` with very small values of `n`.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: