#20429: Add QuerySet.update_or_create method
-------------------------------------+-------------------------------------
     Reporter:  tunixman             |                    Owner:
         Type:  New feature          |  elektrrrus
    Component:  Database layer       |                   Status:  assigned
  (models, ORM)                      |                  Version:  master
     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
-------------------------------------+-------------------------------------
Changes (by timo):

 * needs_better_patch:  1 => 0


Comment:

 As suggested in IRC, I used [https://github.com/django/djangobench
 djangobench] to test this change, but I didn't get any conclusive results
 (this is my first time using djangobench, so I'm not certain how to
 interpret the results). Sometimes djangobench report a "significant"
 difference (both slower and faster), other times there was no difference.
 Here are a couple results. I'm assuming the difference is negligible
 enough to ignore.

 {{{
 $ djangobench --control=master --experiment=ticket_20429
 query_get_or_create -t 500

 Running 'query_get_or_create' benchmark ...
 Min: 0.000931 -> 0.000944: 1.0141x slower
 Avg: 0.000997 -> 0.000979: 1.0187x faster
 Significant (t=3.474695)
 Stddev: 0.00011 -> 0.00005: 2.1908x smaller (N = 500)

 Running 'query_get_or_create' benchmark ...
 Min: 0.000935 -> 0.000947: 1.0130x slower
 Avg: 0.000975 -> 0.001007: 1.0335x slower
 Significant (t=-7.464501)
 Stddev: 0.00006 -> 0.00008: 1.3357x larger (N = 500)

 Running 'query_get_or_create' benchmark ...
 Min: 0.000931 -> 0.000939: 1.0087x slower
 Avg: 0.000999 -> 0.001006: 1.0076x slower
 Not significant
 Stddev: 0.00014 -> 0.00013: 1.0402x smaller (N = 500)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20429#comment:21>
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/066.800c713dd4752fe734f8d74f2d7b785c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to