php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #434 ".=" is very slow
Submitted: 1998-06-03 18:05 UTC Modified: 1998-06-03 20:10 UTC
From: sam at daemoninc dot com Assigned: rasmus (profile)
Status: Closed Package: Performance problem
PHP Version: 3.0 Release Candidate 5 OS: Solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sam at daemoninc dot com
New email:
PHP Version: OS:

 

 [1998-06-03 18:05 UTC] sam at daemoninc dot com
".=" operation seems to get slower and slower as string gets longer.
Maybe some linear operation is being done on the string each time.
Reproduce with:

set_time_limit(3000);
for ($i = 0; $i <= 100000; ++$i) {
    $o .= "x";
}
I control-C'ed this after 135 seconds of run time.

Similar perl code runs in about one second on the same system.
Perl code is:
for ($i = 0; $i < 100000; ++$i) {
    $o .= "x";
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-03 20:10 UTC] rasmus
This is unlikely to get fixed in 3.0.  We might be able to do something for 3.1.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 04:01:24 2020 UTC