#37126: Make Task and TaskResult comparable
--------------------------------+--------------------------------------
     Reporter:  Johannes Maron  |                    Owner:  (none)
         Type:  New feature     |                   Status:  new
    Component:  Tasks           |                  Version:  dev
     Severity:  Normal          |               Resolution:
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  1               |                    UI/UX:  0
--------------------------------+--------------------------------------
Comment (by Johannes Maron):

 I would also suggest adding a custom __eq__ method. We only need to
 include `id` and a simple string comparison is much quicker. Benchmarks N
 = 100_000_000:


 {{{
 Original == (equal)             18.614s  (186.1 ns/call)
 Original == (not equal)         7.452s  (74.5 ns/call)
 Id-only == (equal)              4.434s  (44.3 ns/call)
 Id-only == (not equal)          4.423s  (44.2 ns/call)
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37126#comment:1>
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/0107019e6f34593c-7d78d2dc-5c26-457e-8819-b8ced473987f-000000%40eu-central-1.amazonses.com.

Reply via email to