Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74106 - Speedup merging process by regenerating ld.so.cache only if necessary
Summary: Speedup merging process by regenerating ld.so.cache only if necessary
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-11 08:29 UTC by Matteo Settenvini
Modified: 2005-01-20 08:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Settenvini 2004-12-11 08:29:03 UTC
I noticed that portage will regenerate ld.so.cache (probably through calling env-update?) every time a package is merged/unmerged. This is often unnecessary, since there are a lot of small packages that don't install libs, and the overhead is in that case quite a lot (while I don't mind losing 2 minutes for a OpenOffice.org twelve-hours-long merging, it's annoying to lose 2 mins when installing, e.g, portage-manpages).

For example I made a couple of calculations for the libperl_rebuilder script: on my machine (p4 2.4Ghz 256ram) it took >= 6 hours (and it was the only task), instead of ~2 hour, due to a >1.5min ld.so.cache regeneration per package merged.

So I guess the best solution would be NOT to update ld.so.cache if:
a) [dirs used for install] != [dirs from ld.so.conf]
AND
b) after merging we need an unmerging of an old package, because we need to do it only once.

Hopefully, this will help people with large /usr/lib dirs (mine is ~1.4Gb).
Please note that ld.so.conf lacks listing some dirs I believe are added in automatic: most notably /usr/lib, /lib and /usr/local/lib.
In http://www.daemon-systems.org/man/ld.so.conf.5.html they're called as "standard set".

Purpose for further optimization: call also env-update only if necessary, e.g if calling at least one time "doenvd" in the ebuild[s].
Comment 1 Stian Skjelstad 2004-12-11 09:08:02 UTC
you would also need to check the timestamp of /etc/ld.so.conf before and after the merge in order to catch changes in that file aswell. But I agree. Doing a check  between all the directories in /etc/ld.so.conf agains the files would be were nice, and save a lot of building time, at you mentioned with the perl example.
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2005-01-20 08:48:05 UTC
This has been done in the past and only caused problems. Too many exceptions.