forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved Zend Memory Manager to guarantee reasonable time for worst c…
…ases of best-fit free block searching algorithm.
- Loading branch information
Showing
5 changed files
with
665 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Bug #40261 (Extremely slow data handling due to memory fragmentation) | ||
--INI-- | ||
memory_limit=128M | ||
--FILE-- | ||
<?php | ||
$num = 100000; | ||
|
||
$a = Array(); | ||
for ($i=0; $i<$num; $i++) { | ||
$a[$i] = Array(1); | ||
} | ||
|
||
for ($i=0; $i<$num; $i++) { | ||
$b[$i] = $a[$i][0]; | ||
} | ||
|
||
unset($a); | ||
for ($i=0; $i<$num; $i++) { | ||
$b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; | ||
} | ||
echo "ok\n"; | ||
?> | ||
--EXPECT-- | ||
ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
Bug #40809 Poor perfomance of ".=" | ||
--FILE-- | ||
<?php | ||
error_reporting(E_ALL|E_STRICT); | ||
|
||
$num_increments = 100; | ||
$num_repeats = 1000; | ||
$increment = 50; | ||
|
||
/* Create some more holes to give the memory allocator something to | ||
* work with. */ | ||
$num = 5000; | ||
$a = Array(); | ||
for ($i=0; $i<$num; $i++) { | ||
$a[$i] = Array(1); | ||
} | ||
for ($i=0; $i<$num; $i++) { | ||
$b[$i] = $a[$i][0]; | ||
} | ||
unset($a); | ||
|
||
for ($i=0;$i<$num_repeats;$i++) { | ||
$evil = ""; | ||
for ($j=0;$j<$num_increments;$j++) { | ||
$evil .= str_repeat("a", $increment); | ||
} | ||
unset($evil); | ||
} | ||
echo "ok\n"; | ||
?> | ||
--EXPECT-- | ||
ok |
Oops, something went wrong.