evalEmpire / gitpan

Git repositories for all of CPAN
http://github.com/gitpan
73 stars 12 forks source link

Optimize Gitpan::Release->extract #62

Closed schwern closed 10 years ago

schwern commented 10 years ago

Gitpan::Release->extract is 40s for 71 calls which makes Gitpan::Release->move slow. It could be better.

Most is in Archive::Extract->extract. Setting $Archive::Extract::PREFER_BIN = 1 may help.

22.6s of extract is making 5494 calls to Cwd::_backtick_pwd in Archive::Tar->_extract_file, optimizing that bit of Archive::Extract might help.

schwern commented 10 years ago

Setting $Archive::Extract::PREFER_BIN = 1 makes t/import/Math-BigInt.t significantly faster.

$ time perl -Ilib t/import/Math-BigInt.t 
# Import Math-BigInt
# Archive::Extract::PREFER_BIN = 0
ok 1
1..1

real    1m36.401s
user    0m26.460s
sys 0m38.575s

$ time perl -Ilib t/import/Math-BigInt.t 
# Import Math-BigInt
# Archive::Extract::PREFER_BIN = 1
ok 1
1..1

real    1m9.946s
user    0m18.658s
sys 0m18.854s