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 740866 - Sluggish startup
Sluggish startup
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
: 742737 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-11-28 16:39 UTC by Marc-Andre Lureau
Modified: 2015-02-01 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
system: speed up looking for pkg-config modules versions (2.78 KB, patch)
2014-12-23 20:35 UTC, Marc-Andre Lureau
accepted-commit_now Details | Review
systeminstall: speed up pkg-config (1.74 KB, patch)
2015-01-11 16:27 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Marc-Andre Lureau 2014-11-28 16:39:10 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
Comment 1 Marc-Andre Lureau 2014-11-28 16:41:40 UTC
Colin, please comment this bug, thanks!
Comment 2 Frederic Peters 2014-11-28 16:52:33 UTC
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).
Comment 3 Colin Walters 2014-12-03 02:32:01 UTC
Reverting sounds fine to me, I believe pkg-config is fixed.
Comment 4 Marc-Andre Lureau 2014-12-23 20:35:58 UTC
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 5 Frederic Peters 2015-01-06 18:58:25 UTC
Comment on attachment 293295 [details] [review]
system: speed up looking for pkg-config modules versions

ack.
Comment 6 Frederic Peters 2015-01-11 12:16:31 UTC
*** Bug 742737 has been marked as a duplicate of this bug. ***
Comment 7 Allison Karlitskaya (desrt) 2015-01-11 16:27:39 UTC
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).
Comment 8 Allison Karlitskaya (desrt) 2015-01-11 16:28:03 UTC
Attached shorter version of the patch from bug 742737, by request.
Comment 9 Allison Karlitskaya (desrt) 2015-02-01 11:26:52 UTC
Attachment 294283 [details] pushed as b44703d - systeminstall: speed up pkg-config