GNOME Bugzilla – Bug 697620
giscanner: use SqlAlchemy's OrderedDict implementation
Last modified: 2015-02-07 16:48:57 UTC
Created attachment 241025 [details] [review] giscanner: use SqlAlchemy's OrderedDict implementation g-ir-scanner can be a bit on the slow side. While true we now do a bit more work parsing GTK-Doc comment blocks and more is still to come, one of the biggest hotspots besides what's going on in _giscanner.SourceScanner() comes from the OrderedDict implementations we have been using. For example, time needed to build Gtk-3.0.gir on a relatively slow machine using "python2 -m cProfile -o $prefix/bin/g-ir-scanner ...": 1) Our original DictMixin sublass: 92,79867 seconds 2) Python's collections.OrderedDict class: 88,65786 seconds 3) Larosa/Foord implementation from http://www.voidspace.org.uk/python/odict.html : 71,64323 seconds 4) SqlAlchemy's implementation: 66,12449 seconds Looks like we have a clear winner with the SqlAclchemy implementation, which comes in at around 20 seconds without profiling on the same machine. Not bad.
Created attachment 241034 [details] [review] giscanner: use SqlAlchemy's OrderedDict implementation Forgot to add bug link to commit message...
Review of attachment 241034 [details] [review]: From reading the code I don't know why it would be so much faster, but even if it wasn't, better to synchronize on a well-known implementation.
Comment on attachment 241034 [details] [review] giscanner: use SqlAlchemy's OrderedDict implementation Committed, thanks for the review!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]