[django/django] ff723d: Fixed #20950 -- Instantiate OrderedDict() only whe...

2 views
Skip to first unread message

GitHub

unread,
Sep 14, 2013, 1:53:23 PM9/14/13
to django-...@googlegroups.com
Branch: refs/heads/master
Home: https://github.com/django/django
Commit: ff723d894d9272ea721d1996432ffc806c2b8180
https://github.com/django/django/commit/ff723d894d9272ea721d1996432ffc806c2b8180
Author: Anssi Kääriäinen <akaa...@gmail.com>
Date: 2013-09-14 (Sat, 14 Sep 2013)

Changed paths:
M django/db/models/sql/compiler.py
M django/db/models/sql/query.py

Log Message:
-----------
Fixed #20950 -- Instantiate OrderedDict() only when needed

The use of OrderedDict (even an empty one) was surprisingly slow. By
initializing OrderedDict only when needed it is possible to save
non-trivial amount of computing time (Model.save() is around 30% faster
for example).

This commit targetted sql.Query only, there are likely other places
which could use similar optimizations.



Reply all
Reply to author
Forward
0 new messages