FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 11-24-2007, 12:24 PM
Nagy Gabor
 
Default pacman/query.c : -Qo optimization.

> I didn't understand why realpath was called on every files of every filelist
> in query_fileowner :
> ppath = resolve_path(path);
>
> It turns out this is needed for the diverted files. For example, cddb_get
> installs /usr/lib/perl5/site_perl/5.8.8/CDDB_get.pm which actually ends in
> /usr/lib/perl5/site_perl/current/CDDB_get.pm .

A real life example ;-): /opt directory can be a symlink for example.

And an offtopic note here: iirc (<- cannot check now) you cannot search for
owner of a directory symlink [/usr/var], because dir-symlinks are treated as
dirs in files <- this may(?) lead to an other symlink puzzle: conflicting
"symlinks" in target list. Xavier, could you check this please?

> And for making pacman -Qo /usr/lib/perl5/site_perl/current/CDDB_get.pm ,
> realpath has to be called on both the target, and the file in the filelist.
>
> However, realpath is costly, and calling it on every single file resulted
> in a poor -Qo performance. Worst case :
> pacman -Qo /lib/libz.so.1 0.35s user 1.51s system 99% cpu 1.864 total
>
> So I did a little optimization to avoid calling realpath as much as
> possible: first compare the basename of each file.
>
> Result:
> src/pacman/pacman -Qo /lib/libz.so.1 0.24s user 0.05s system 99% cpu 0.298
> total
>
> Obviously, the difference will be even bigger at the first run (no fs
> cache), though it's quite scary on my system : 1.7s vs 40s previously.
>


----------------------------------------------------
SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu
This mail sent through IMP: http://horde.org/imp/


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 05:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org