GNOME Bugzilla – Bug 740866
Sluggish startup
Last modified: 2015-02-01 11:27:00 UTC
I have a fairly recent computer, i7-3520M CPU @ 2.90GHz × 4 with SSD with f21, but it takes about 2s for jhbuild to do anything. Thanks to cProfile, I found that it is unsurprisingly the get_installed_pkgconfigs() the culprit, which Colin modified in bug 654701. Removing back, warm-up time is only 0.1s (with a small moduleset) Colin, I am not able to reproduce the initial issue, if I put a broken Require in a .pc, I don't get any error. Do you know if pkg-config exited with error? I think it would be safe to try regular function then fallback, something like this. try: args = ['pkg-config', '--modversion'] args.extend(pkgs) proc = subprocess.Popen(args, stdout=subprocess.PIPE, env=config.get_original_environment(), close_fds=True) stdout = proc.communicate()[0] proc.wait() for pkg,verline in zip(pkgs, StringIO(stdout)): pkgversions[pkg] = verline.strip() except OSError: pass if len(pkgversions) == 0: fallback code
Colin, please comment this bug, thanks!
It happened in Ubuntu Lucid, that's pkg-config 0.22; I didn't spot anything particular in the NEWS file but can't reproduce the issue however bad I try to create an invalid pkg-config file. We should probably revert to the fast behaviour. (and we'll see if someone to reproduce the old bug).
Reverting sounds fine to me, I believe pkg-config is fixed.
Created attachment 293295 [details] [review] system: speed up looking for pkg-config modules versions Since 9fb817, module version lookup spawns pkg-config for each module. However, this is not necessary on most system. Let's try to do it all at once before looking up modules one by one.
Comment on attachment 293295 [details] [review] system: speed up looking for pkg-config modules versions ack.
*** Bug 742737 has been marked as a duplicate of this bug. ***
Created attachment 294283 [details] [review] systeminstall: speed up pkg-config The code for building the list of all installed packages is very slow, particularly when lots of packages are installed. This "slow and steady" approach was implemented in bug 683832 because of the potential for broken pkg-config files to break the old approach. Broken pkg-config files are not normally installed, so we may as well try to do things the fast way first, falling back on the other approach if it fails. This improves 'jhbuild list glib' from ~5.6 to ~0.4 seconds on my fairly typical system (with 482 .pc files installed).
Attached shorter version of the patch from bug 742737, by request.
Attachment 294283 [details] pushed as b44703d - systeminstall: speed up pkg-config