GNOME Bugzilla – Bug 754164
Performance of vapigen is slow when using GIR files
Last modified: 2018-05-22 15:26:37 UTC
There is a serious performance issue with large GIR files and it is causing vapigen to run for just over 2 minutes in my test case. The GIR files in question are generated and I'm attaching a representative example that I've generated. It might be interesting to include this GIR or the script to avoid future performance regressions.
Created attachment 310081 [details] The script used to generate the GIR. The GIR file was too big...
So where is a real-life project which generates a GIR that runs for 2 minutes?
Created attachment 310084 [details] [review] girparser: Cache the cprefix and csuffix This drastically improves performance, especially for larger GIR files. Before: 139.38 seconds After: 31.27 seconds
Created attachment 310085 [details] [review] girparser: Improve find_parent() performance This is especially useful for larger GIR files. Before: 31.27 seconds After: 5.13 seconds
Created attachment 310086 [details] [review] gee: Replace HashMap and HashSet implementation Instead use GLib.HashTable which has improved performance. This improves parsing large GIR files: Before: 5.13 seconds After: 4.46 seconds GHashTable now has an optimization for using it as a set which avoids allocating storage for the values when not needed.
Created attachment 310087 [details] [review] markupreader: Various performance improvements This improves parsing large GIR files: Before: 4.46 seconds After: 3.95 seconds The generated GIR is not seeing all of the performance improvements as it does not contain any embedded documentation.
(In reply to Luca Bruno from comment #2) > So where is a real-life project which generates a GIR that runs for 2 > minutes? It is an internal application, and unfortunately there are quite a few vapigen calls which end up taking up a large amount of the build time.
I've applied the "Cache the cprefix and csuffix" and "Improve find_parent() performance" patches and regenerated all the bindings. No diff, but time to generate is the same as before. Will investigate a little more with your gir.
ping?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/509.