Bug 79777 - Runtime optimization: cache inode of each dir to avoid duplication via symlinks
Summary: Runtime optimization: cache inode of each dir to avoid duplication via symlinks
Status: RESOLVED MOVED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-07 18:27 UTC by Daniel Macks
Modified: 2018-08-25 12:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Macks 2014-06-07 18:27:10 UTC
Over its history and among vendors, the prefix where X11 gets installed has changed several times. Some vendors supply symlinks from the "old" location when they change to installing at a new location and/or links from some standard location to a less-standard place the vendor uses. These provide good compatibility, but they mean I might have several generations of /.../X11/.../pkgconfig paths in my PKG_CONFIG_PATH (or pre-configured via pkg-config's ./configure --with-pc-path= flag). Also, during some builds, I might pass something already in --with-pc-path via PKG_CONFIG_PATH in order to give precedence to a location of something that is masked by default.

In both cases, pkg-config winds up encountering the same actual pkgconfig/ directory more than once, either real vs symlink or multiple entries of the actual path in the search list. It then rereads and re-parses its whole *.pc contents and obviously ignoring every one of them. If pkg-config cached the inode or other unique information about the "actual" directory when reading it, it could then check whether a directory had already been processed and not bother reprocessing it. For my bare-bones OS X 10.8 machine, there are 3 pointers to the X11 prefix (all of which are in my build scripts so that they are exactly portable to other systems), which is what contains the vast majority of my .pc files, so this optimization cuts out almost 2/3 of the processing every time pkg-config runs.
Comment 1 GitLab Migration User 2018-08-25 12:57:01 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org'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.freedesktop.org/pkg-config/pkg-config/issues/49.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.