Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

a more plausible example than memoization is something like a polymorphic inline cache, where the cache can be very small and therefore fast to search but tends to be different at different callsites


Makes sense, I was thinking this is largely recreating L2 caches and such. Where you don't mind that they would memoize the same data, but the expectation is more that each caller would have a small subset they are specifically using over and over.


If you knew the answer, why did you ask the question?


Sometimes it's nice to abstract a place where you need the answer from the way you determine the answer; that's basically why functions exist in the first place! Later on, if you decide that you want to tweak the way the implementation works, you don't need to do it literally everywhere.


I thought of an answer after asking. Still curious if there are others.


so am i! fuck you, lupire




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: