#36590: Redis cache lacks specialized aget_many and aset_many implementations
--------------------------------+-----------------------------------------
     Reporter:  Brian Atkinson  |                     Type:  Uncategorized
       Status:  new             |                Component:  Uncategorized
      Version:  5.2             |                 Severity:  Normal
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+-----------------------------------------
 The Redis cache backend has a specialized implementation of get_many and
 set_many which perform the get/set in one command to the backend. However
 the similar aget_many and aset_many methods are not specialized. This
 results in the performance of these async batch methods being
 significantly slower than they could be. We've seen significant
 performance improvements by adding the following methods to a sub-class of
 the built-in RedisCache class:

 {{{
     async def aget_many(self, keys, version=None):
         return await sync_to_async(self.get_many)(keys, version=version)

     async def aset_many(self, data, timeout=DEFAULT_TIMEOUT,
 version=None):
         return await sync_to_async(self.set_many)(data, timeout=timeout,
 version=version)
 }}}

 These were the only ones we've overridden, but there might be a few others
 which could benefit from an improved implementation in a similar way.
 Happy to send a PR for a change similar to above for these missing
 specializations if desired.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36590>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701990caccfdf-15348d14-2e9a-485b-925c-7c477547ad78-000000%40eu-central-1.amazonses.com.

Reply via email to