-
Notifications
You must be signed in to change notification settings - Fork 24
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
garnered_find slower than find? #88
Comments
I don't think you're doing anything wrong. In this benchmark you're taking a 0 latency local scenario in which cost of network is 0, cost inside a database lookup vs. memcached lookup is a memory read, ie. identical, but overall Garner cost is higher because Garner does two lookups in memcached. Realistically your roundtrip with MongoDB should be significantly slower than two roundtrips to Memcached, but I would prove that with a production system under load - it's possible that it's not the case for something with high throughput. |
I would agree, except that I initially investigated this because of similar results from our production system (with additional network latency, presumably). I didn't trust those results because there were so many other variables possibly impacting them. |
I do think MongoDB is extremely fast, all in-memory, etc., so I am not so surprised - the assumption that memcached is somehow faster for a simple lookup probably no longer stands. I would bulk replace all garnered finds with |
I've already done that on some endpoints that I'd been chipping away at performance with, due to some benchmark tests. I'll monitor those for a bit. |
I encountered this surprise in our own application, and was able to reproduce it from a checkout of garner with the minimal models used by specs:
It's possible that this set-up isn't configuring the cache optimally, but I'd expect this to be sufficient to see cache hits and the library's benefits. What am I doing wrong?
The text was updated successfully, but these errors were encountered: