#28459: Improve performance of QuerySet
-------------------------------------+-------------------------------------
     Reporter:  Sergey Fedoseev      |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Sergey Fedoseev):

 [https://github.com/django/django/pull/9486 PR]

 Before:
 {{{
 In [2]: %timeit for x in DecimalModel.objects.values_list('d'): pass
 128 ms ± 531 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

 In [3]: %timeit for x in DecimalModel.objects.values_list(models.F('d') +
 1): pass
 39.5 ms ± 542 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
 }}}

 After:
 {{{
 In [2]: %timeit for x in DecimalModel.objects.values_list('d'): pass
 31.8 ms ± 490 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

 In [3]: %timeit for x in DecimalModel.objects.values_list(models.F('d') +
 1): pass
 20.3 ms ± 579 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28459#comment:26>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.07284f4755f972b2da5981e68032e912%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to