-
Notifications
You must be signed in to change notification settings - Fork 135
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
Use LRU cache in useragent.lookup
so rarely used useragents will not be in the memory forever.
#22
Comments
Ha, Same request was made against my hashring lib to 3rd-Eden/node-hashring#8 today. I'll see what i can do.. On Jan 10, 2013, at 2:14 AM, Christian Tellnes notifications@github.com wrote:
|
I do not know, you should probably run some tests. |
I have been thinking of it, and i think that a LFU might be more suitable for this due the wide arrange of different user agent strings that could invalid the the cache if it's set to low. It comes with a bit high performance penalty then a LRU but it might be worth it. |
This would be a very good feature. I would use it :) |
LRU caching greatly reduces the performance of the lookup
VS with LRU:
Which is quite a big overhead, but it's still faster then a regular parse. |
Fixed in 2.0.2, I'm assuming that people would rather see memory leak prevention instead of increased performance. |
Great library.
You can easily replace the
dictionary
hash used byuseragent.lookup
with eg. lru-cache to resolve this. Great if the options forlru-cache
are exposed to configuration inuseragent
.The text was updated successfully, but these errors were encountered: