php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80399 Using PharData to create TAR files is super slow (at least 10x slower)
Submitted: 2020-11-22 11:40 UTC Modified: 2020-12-28 15:14 UTC
From: maggus dot staab+php at googlemail dot com Assigned: cmb (profile)
Status: Closed Package: PHAR related
PHP Version: 7.3.24 OS: windows10x64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: maggus dot staab+php at googlemail dot com
New email:
PHP Version: OS:

 

 [2020-11-22 11:40 UTC] maggus dot staab+php at googlemail dot com
Description:
------------
while working on one of our projects we figured creating TAR files with PharData would be a great fit, because its php-src builtin.

it turns out though creating TAR Files with PharData is super slow, compared to userland php implementation.

we see 10x slower performance.

see a benchmark and repro script at https://github.com/staabm/php-phardata-benchmark

Expected result:
----------------
PharData should be at least on paar with php userland implementations

Actual result:
--------------
its slow

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-23 12:02 UTC] cmb@php.net
Could you please check the performace for PHP 7.4.12?  And also,
could you check that with the blackfire extension?
 [2020-11-23 12:33 UTC] maggus dot staab+php at googlemail dot com
thx for coming back to me.

I justed did a blackfire profile and measured the non-profiled timings on a few more servers and php-versions.

have a look at the readme: https://github.com/staabm/php-phardata-benchmark

I don't have a server at my disposal where the latest php version is available.
everything I have is ubuntu LTS bound
 [2020-12-08 10:09 UTC] cmb@php.net
-Package: *Compression related +Package: PHAR related
 [2020-12-14 15:22 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2020-12-14 15:22 UTC] cmb@php.net
I can confirm your findings with current PHP-7.4 HEAD. The problem
is that each PharData::addFile() flushes the archive, i.e.
completely writes it back to disk.  That takes time...
 [2020-12-14 15:37 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem
 [2020-12-14 15:37 UTC] cmb@php.net
The same happens for ::addFromString() and ::offsetSet().
::buildFromDirectory() and ::buildFromIterator() don't have that
issue, so changing to documentation problem.
 [2020-12-28 15:14 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-12-28 15:14 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=352243
Log: Fix #80399: Using PharData to create TAR files is super slow (at least 10x slower)
 [2020-12-28 15:16 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=b3d23714c285b70f6a033017aa0d5ad954e2c44c
Log: Fix #80399: Using PharData to create TAR files is super slow (at least 10x slower)
 [2020-12-28 15:16 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-12-28 21:37 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&revision=352258
Log: Fix #80399: Using PharData to create TAR files is super slow (at least 10x slower)
 [2020-12-28 21:40 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=7abdd3ebc84e62e8022c1fa6158ecef801f77b14
Log: Fix #80399: Using PharData to create TAR files is super slow (at least 10x slower)
 [2020-12-30 11:58 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=9bd653df681327a5ff9ad007685ef2b27fb181c3
Log: Fix #80399: Using PharData to create TAR files is super slow (at least 10x slower)
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 15 00:01:23 2021 UTC