Bug #19661 [Opn]: addModify is very slow in a loop
| From: | mrook@php.net | Date: | Wed, 24 Oct 2012 20:59:10 +0000 |
| Subject: | Bug #19661 [Opn]: addModify is very slow in a loop | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-9230@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19661&edit=1
ID: 19661
Updated by: mrook@php.net
Reported By: anees dot ka at mistralsolutions dot com
Summary: addModify is very slow in a loop
Status: Open
Type: Bug
Package: Archive_Tar
Operating System: linux
Package Version: 1.3.10
PHP Version: 5.3.7
Roadmap Versions:
New Comment:
Passing an array instead of individual filenames into addModify() is
quite a bit faster :)
Previous Comments:
------------------------------------------------------------------------
[2012-10-21 22:23:56] aneeska
Description:
------------
$tar = new Archive_Tar($destination, true);
$count = 0;
foreach ($valid_files as $first) {
$prefix = substr ($first, 0, (strrpos ($first,
'/')+1));
$tar->addModify ($first, '', $prefix);
$count++;
echo "count = ".$count." prefix = ".$prefix."
<br/>";
}
Expected result:
----------------
I am expecting a tar file by the name $destination
Actual result:
--------------
I have 188 files to tar and this loop is painfully slow. It takes a
long time to create the tar file.
Is there anything wrong with the way I have written the code?
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19661&edit=1