On Thursday, January 23, 2003, at 09:07  am, Max Horn wrote:

Wow - seems we spend a *lot* of time in expand_percent! If we can optimize that function and/or reduce the places in which it is used, that might indeed pay off well.
Disclaimer: this has to be taken with a grain of salt: by the nature of how profiler's work, they often overstress the time spent in tiny functions.
Hi,
Sorry to report I do not see similar results for "fink list". However, for me the slowest fink operation is always "fink index", where Fink::Services::expand_percent does seem significant. Paul's percent expansion patch cut about 20 seconds off of "fink index", but increased a full "fink list" by 3 seconds or so (may be coincidence).

I only ran each test once so there is no time averaging of results to eliminate the factor of the CPUs being busy with other tasks. I ran two of the tests a second time (results not included) and the times varied by only about one second.

Carsten

System: 10.2.3, Dual-450
Trees: stable, unstable and experimental
---
TEST A1: Reference test, compare with Max's test
List subset of packages. ("text")

% sudo perl -w -d:DProf /sw/bin/fink list text
Password:
Information about 2282 packages read in 26 seconds.
<snip>
% dprofpp
Total Elapsed Time = 26.42965 Seconds
User+System Time = 7.350856 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
71.5 5.260 26.911 222 0.0237 0.1212 Fink::Package::search_comparedb
16.6 1.220 1.220 1 1.2200 1.2200 Storable::pretrieve
4.61 0.339 0.229 4731 0.0001 0.0000 Fcntl::S_ISDIR
3.13 0.230 0.230 1 0.2300 0.2300 Fink::Status::read
2.99 0.220 0.088 9462 0.0000 0.0000 Fcntl::__ANON__
2.18 0.160 0.236 10 0.0160 0.0236 Fink::Package::BEGIN
1.03 0.076 7.105 1 0.0762 7.1051 Fink::Package::scan_all
0.82 0.060 0.060 7 0.0086 0.0086 AutoLoader::AUTOLOAD
0.82 0.060 0.067 13 0.0046 0.0052 Fink::PkgVersion::BEGIN
0.54 0.040 0.049 1 0.0398 0.0492 Fink::Services::get_term_width
0.41 0.030 0.030 4 0.0075 0.0075 DynaLoader::dl_load_file
0.41 0.030 0.030 20 0.0015 0.0015 Fink::Services::expand_percent
0.41 0.030 0.050 3 0.0100 0.0166 AutoLoader::import
0.41 0.030 0.265 10 0.0030 0.0265 Fink::Engine::BEGIN
0.27 0.020 0.020 22 0.0009 0.0009 Exporter::export

----
TEST B1:
Use fink's default storable-pm 1.0.14-1.
List all packages.

% sudo perl -w -d:DProf /sw/bin/fink list
Information about 2282 packages read in 6 seconds.
<snip>
% dprofpp
Total Elapsed Time = 17.75257 Seconds
User+System Time = 3.861437 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
33.4 1.290 1.290 1 1.2900 1.2900 Storable::pretrieve
21.9 0.848 5.112 222 0.0038 0.0230 Fink::Package::search_comparedb
12.8 0.497 4.733 1 0.4969 4.7330 Fink::Engine::do_real_list
9.30 0.359 0.224 4731 0.0001 0.0000 Fcntl::S_ISDIR
8.00 0.309 0.516 5021 0.0001 0.0001 Fink::PkgVersion::is_installed
8.00 0.309 0.332 5021 0.0001 0.0001 Fink::Status::query_package
6.99 0.270 0.255 1237 0.0002 0.0002 Fink::Services::raw_version_cmp
5.44 0.210 0.147 5022 0.0000 0.0000 Fink::Status::validate
5.15 0.199 0.203 2251 0.0001 0.0001 Fink::PkgVersion::get_shortdescrip
tion
4.92 0.190 0.190 1 0.1900 0.1900 Fink::Status::read
4.89 0.189 0.397 2021 0.0001 0.0002 Fink::Package::is_any_installed
4.14 0.160 0.042 9462 0.0000 0.0000 Fcntl::__ANON__
3.63 0.140 0.369 825 0.0002 0.0004 Fink::Services::version_cmp
3.11 0.120 0.226 10 0.0120 0.0226 Fink::Package::BEGIN
2.85 0.110 0.440 2251 0.0000 0.0002 Fink::Services::latest_version

----
TEST B2:
Update from storable-pm 1.0.14-1 to storable-pm-2.06-1.
List all packages.

% fink install storable-pm-2.06-1
<snip>
Preparing to replace storable-pm 1.0.14-1 (using .../storable-pm_2.06-1_darwin-powerpc.deb) ...
<snip>
% sudo rm tmon.out
% sudo perl -w -d:DProf /sw/bin/fink list
Information about 2282 packages read in 8 seconds.
<snip>
% dprofpp
Total Elapsed Time = 16.52852 Seconds
User+System Time = 4.591859 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
33.1 1.520 1.520 1 1.5200 1.5200 Storable::pretrieve
22.5 1.034 5.442 222 0.0047 0.0245 Fink::Package::search_comparedb
14.7 0.678 5.528 1 0.6780 5.5285 Fink::Engine::do_real_list
8.69 0.399 0.384 1237 0.0003 0.0003 Fink::Services::raw_version_cmp
8.04 0.369 0.244 5019 0.0001 0.0000 Fink::Status::query_package
6.29 0.289 0.404 5019 0.0001 0.0001 Fink::PkgVersion::is_installed
6.08 0.279 0.112 4731 0.0001 0.0000 Fcntl::S_ISDIR
4.99 0.229 0.435 2251 0.0001 0.0002 Fink::PkgVersion::get_shortdescrip
tion
4.79 0.220 0.220 1 0.2200 0.2200 Fink::Status::read
4.57 0.210 0.181 2249 0.0001 0.0001 Fink::PkgVersion::format_oneline
3.90 0.179 0.308 2020 0.0001 0.0002 Fink::Package::is_any_installed
3.27 0.150 0.120 2282 0.0001 0.0001 Fink::Package::package_by_name
3.05 0.140 0.017 9462 0.0000 0.0000 Fcntl::__ANON__
2.83 0.130 0.487 825 0.0002 0.0006 Fink::Services::version_cmp
2.61 0.120 0.091 2251 0.0001 0.0000 Fink::Package::get_version

----
TEST C1:
Using unpatched Fink/Services.pm.
Reindex package db.

% sudo rm tmon.out
% sudo perl -w -d:DProf /sw/bin/fink index
Reading package info...
Updating package index... done.
% dprofpp
Total Elapsed Time = 79.37857 Seconds
User+System Time = 23.49806 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
41.7 9.803 9.610 11983 0.0008 0.0008 Fink::Services::expand_percent
21.1 4.971 4.913 3829 0.0013 0.0013 Fink::Services::read_properties_li
nes
19.3 4.543 20.234 3828 0.0012 0.0053 Fink::PkgVersion::initialize
12.6 2.980 7.068 2523 0.0012 0.0028 Fink::Services::read_properties
11.3 2.660 2.660 1 2.6600 2.6600 Storable::pstore
8.14 1.912 7.157 37329 0.0001 0.0002 Fink::PkgVersion::expand_percent_i
f_available
7.31 1.717 0.678 59560 0.0000 0.0000 Fink::Base::has_param
7.12 1.674 21.780 3828 0.0004 0.0057 Fink::Base::new_from_properties
5.35 1.258 1.185 4313 0.0003 0.0003 File::Find::Follow_SymLink
4.63 1.088 0.671 23940 0.0000 0.0000 Fink::Base::param_default
1.98 0.466 22.275 3828 0.0001 0.0058 Fink::Package::inject_description
1.87 0.439 0.367 4194 0.0001 0.0001 Fink::Package::__ANON__
1.83 0.429 0.037 22440 0.0000 0.0000 Fink::PkgVersion::get_name
1.57 0.368 0.321 2277 0.0002 0.0001 Fink::Package::initialize
1.56 0.367 6.743 1306 0.0003 0.0052 Fink::PkgVersion::add_splitoff

----
TEST C2:
Applied Paul Gaborit's test percent expansion patch to Fink/Services.pm.
Reindex package db.

% sudo rm tmon.out
% sudo perl -w -d:DProf /sw/bin/fink index
Reading package info...
Updating package index... done.
% dprofpp
Total Elapsed Time = 52.17040 Seconds
User+System Time = 13.93297 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
34.3 4.792 4.735 3829 0.0013 0.0012 Fink::Services::read_properties_li
nes
31.1 4.334 10.159 3828 0.0011 0.0027 Fink::PkgVersion::initialize
17.2 2.400 2.400 1 2.4000 2.4000 Storable::pstore
15.1 2.112 2.231 37329 0.0001 0.0001 Fink::PkgVersion::expand_percent_i
f_available
13.0 1.817 1.616 11983 0.0002 0.0001 Fink::Services::expand_percent
12.5 1.744 5.731 2523 0.0007 0.0023 Fink::Services::read_properties
12.0 1.677 0.667 59560 0.0000 0.0000 Fink::Base::has_param
9.94 1.385 11.419 3828 0.0004 0.0030 Fink::Base::new_from_properties
8.38 1.168 1.097 4313 0.0003 0.0003 File::Find::Follow_SymLink
7.09 0.988 0.583 23940 0.0000 0.0000 Fink::Base::param_default
4.16 0.579 0.198 22440 0.0000 0.0000 Fink::PkgVersion::get_name
3.42 0.476 11.940 3828 0.0001 0.0031 Fink::Package::inject_description
3.37 0.469 0.399 4194 0.0001 0.0001 Fink::Package::__ANON__
3.09 0.431 1.921 14 0.0308 0.1372 File::Find::_find_dir_symlnk
2.85 0.397 3.834 1306 0.0003 0.0029 Fink::PkgVersion::add_splitoff

----
TEST D1: Compare with tests B1/B2.
Applied Paul Gaborit's test percent expansion patch to Fink/Services.pm.
List all packages.

% sudo perl -w -d:DProf /sw/bin/fink list
Information about 2282 packages read in 13 seconds.
<snip>
% dprofpp
Total Elapsed Time = 21.82854 Seconds
User+System Time = 4.501787 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
28.4 1.282 7.002 222 0.0058 0.0315 Fink::Package::search_comparedb
27.5 1.240 1.240 1 1.2400 1.2400 Storable::pretrieve
12.3 0.557 5.413 1 0.5569 5.4131 Fink::Engine::do_real_list
8.86 0.399 0.586 5019 0.0001 0.0001 Fink::PkgVersion::is_installed
8.86 0.399 0.312 5019 0.0001 0.0001 Fink::Status::query_package
6.20 0.279 0.194 4731 0.0001 0.0000 Fcntl::S_ISDIR
6.00 0.270 0.255 1237 0.0002 0.0002 Fink::Services::raw_version_cmp
4.89 0.220 0.220 1 0.2200 0.2200 Fink::Status::read
4.64 0.209 0.303 2251 0.0001 0.0001 Fink::PkgVersion::get_shortdescrip
tion
4.44 0.200 0.082 9462 0.0000 0.0000 Fcntl::__ANON__
4.20 0.189 0.467 2020 0.0001 0.0002 Fink::Package::is_any_installed
4.00 0.180 0.151 2282 0.0001 0.0001 Fink::Package::package_by_name
4.00 0.180 0.152 2249 0.0001 0.0001 Fink::PkgVersion::format_oneline
3.11 0.140 0.369 825 0.0002 0.0004 Fink::Services::version_cmp
2.89 0.130 0.196 10 0.0130 0.0196 Fink::Package::BEGIN
---
end



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel


Reply via email to