Changes between Initial Version and Version 1 of Ticket #28459, comment 6


Ignore:
Timestamp:
Aug 11, 2017, 1:47:34 AM (7 years ago)
Author:
Sergey Fedoseev

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28459, comment 6

    initial v1  
    33Before:
    44{{{
    5 In [5]: %timeit Skill()
    6 6.05 µs ± 54.2 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
    7 In [4]: %timeit for x in Skill.objects.all(): pass
    8 156 ms ± 1.28 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
     5In [5]: %timeit PersonSkill()
     68.9 µs ± 13 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
     7In [2]: %timeit for x in PersonSkill.objects.all(): pass
     883 ms ± 628 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
     9# skill is None for all objects
     10In [13]: %timeit for x in PersonSkill.objects.select_related('skill'): pass
     11111 ms ± 446 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
     12# skill is not None for all objects
     13In [10]: %timeit for x in PersonSkill.objects.select_related('skill'): pass
     14187 ms ± 735 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
    915}}}
     16
    1017After:
    1118{{{
    12 In [2]: %timeit Skill()
    13 5.78 µs ± 29.5 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
    14 In [3]: %timeit for x in Skill.objects.all(): pass
    15 149 ms ± 1.62 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
     19In [18]: %timeit PersonSkill()
     208.54 µs ± 23.8 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
     21In [10]: %timeit for x in PersonSkill.objects.all(): pass
     2275.1 ms ± 825 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
     23# skill is None for all objects
     24In [5]: %timeit for x in PersonSkill.objects.select_related('skill'): pass
     25108 ms ± 342 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
     26# skill is not None for all objects
     27In [7]: %timeit for x in PersonSkill.objects.select_related('skill'): pass
     28178 ms ± 817 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
    1629}}}
Back to Top