Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Trying to renew a lock is very rare, but memcache-lock.inc tries this first, before the more common scenario of acquiring a lock in the first place. Swapping the two, it's possible to save a dmemcache_get() for every call to lock_acquire(), this is going to be more noticeable in stats with #962422: Empty cache stampede protection enabled.
Patch passes tests, will run benchmarks in a bit.
Comment | File | Size | Author |
---|---|---|---|
lock-get.patch | 3.35 KB | catch |
Comments
Comment #1
catchBefore (stampede protection enabled):
After (stampede protection enabled):
After (stampede protection disabled):
If you compare the last two runs, the only difference is an extra memcache set (which corresponds very closely to get misses) - which is what I would have expected to be the case.
Comment #2
catchSince this is a straightforward change and has good results, I've committed to 6.x-1.x, marking for forward port.
Comment #3
catchCommitted.