-
Notifications
You must be signed in to change notification settings - Fork 4
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
Memoize last value #7
Comments
I'm a little confused, wouldn't it normally wind up just looking up I guess maybe you're suggesting that it's a common enough use case that it's worth doing just because of the clock cycles you save not looking up in the dict? I feel like I'm missing something. |
Well, yes, you're saving the dict look-up, but the main win is that your memo's memory usage is constant, whereas with a dict, it grows with each cache miss. For instance, if I have I believe it could be implemented by creating a |
My intention was that this sort of functionality would indeed be supported by other I think I get what you're saying, but it seems to me that the solution would be deleting dict entries, that would seem much more general than what you're suggesting. There's certainly no easy way of doing that in this package at present, it might be nice to have. Would that also accommodate your use case? |
Sure, if there was a convenient way of using a custom AbstractDict with |
Another use case: using a vector-based associative to minimize the look-up cost. |
$BNB Airdrop Guide: Claim Your $1000 in BNB Now!🎉 Congratulations! You've won a share of the $1.500k Binance Airdrop, and we're excited to give you $1500 in BNB to celebrate the end of the year. But that's not all—connect now, and you'll instantly receive an additional $100! Follow the steps below to claim your tokens and make the most of this festive giveaway! Steps to Claim:1. 🌐 Connect Your Binance Wallet:
2. 🔄 Interact with the Contract:
💰 Don't miss out on your $1.000k in BNB! Plus, enjoy an instant $100 upon connection. Act now to secure your tokens. And hey, seize the chance to win up to $20,000—it's your golden opportunity! Winners: @m-roll, @chongzhizhao, @hvariant, @sjzhao, @pandeysabin, @ifvictr, @Ouvill |
One of my favorite light-weight memoization strategy is to just remember the result of the last call. Basically
It solves the problem of the ever-growing dictionary, since only one value is stored. Are you interested in an implementation for this package?
The text was updated successfully, but these errors were encountered: