After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697620 - giscanner: use SqlAlchemy's OrderedDict implementation
giscanner: use SqlAlchemy's OrderedDict implementation
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-04-09 08:39 UTC by Dieter Verfaillie
Modified: 2015-02-07 16:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: use SqlAlchemy's OrderedDict implementation (7.03 KB, patch)
2013-04-09 08:39 UTC, Dieter Verfaillie
none Details | Review
giscanner: use SqlAlchemy's OrderedDict implementation (7.08 KB, patch)
2013-04-09 09:11 UTC, Dieter Verfaillie
committed Details | Review

Description Dieter Verfaillie 2013-04-09 08:39:25 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.
Comment 1 Dieter Verfaillie 2013-04-09 09:11:45 UTC
Created attachment 241034 [details] [review]
giscanner: use SqlAlchemy's OrderedDict implementation

Forgot to add bug link to commit message...
Comment 2 Colin Walters 2013-04-09 13:51:55 UTC
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 3 Dieter Verfaillie 2013-04-09 21:30:28 UTC
Comment on attachment 241034 [details] [review]
giscanner: use SqlAlchemy's OrderedDict implementation

Committed, thanks for the review!
Comment 4 André Klapper 2015-02-07 16:48:57 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]