slow performance with lots of Requires: statements #229
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
When upgrading my (C++) project to gRPC 1.39.0 (the latest), I discovered that Fedora's
pkgconf
seems to be slow when.pc
files have manyRequires:
clauses. The issue from my project is https://github.com/googleapis/google-cloud-cpp/issues/7052 and it has some additional context. We worked around this problem by installing and using https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz instead.It is possible that we're doing something wrong, in which case I'd be happy to learn what it is so we can fix it. Otherwise, I'm reporting this issue in case it can be fixed in a future version of pkgconf/fedora.
Steps to reproduce
*.pc
files from a fully installed copy ofgoogle-cloud-cpp
,protobuf
,grpc
,abseil
,openssl
, etc. This tarball does NOT contain the compiled artifacts -- only the .pc files. This is just so that we can usepkg-config
in a docker container to reproduce the problem./tmp
in the image./tmp
, which will put all the.pc
files in a single directorypkg-config
pkg-config
is for certain packages that contain a lot ofRequires:
statements.The above is over 3 seconds. Invoked repeatedly in our actual CI builds this adds up to over an hour of time spent in
pkg-config
. When we switched our builds to https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz (https://github.com/googleapis/google-cloud-cpp/pull/7061), each invocation completes in a small fraction of a second.Additional info
I don't know about the internals of pkg-config, so I don't really know what it's doing or supposed to do, but I'll say that the
--debug
flag produces some interesting output.Hi, sorry, I have not noticed this issue until now. For some reason, GitHub does not reliably send bug mail to me for pkgconf anymore.
The
pkgconf_pkg_ref/pkgconf_pkg_unref
being so high is quite strange.The issue is that the dependency solver is being invoked thousands of times (e.g. for each subgraph). A probable solution would be to track dependency nodes that are already part of a proposed solution and reusing them for future resolutions.
The solver, incidentally, is solving for
absl_config
frequently. Likely that is the deepest point in the graph. I tried to render it with GraphViz but it crashed, haha