diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-03-20 06:46:48 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-03-20 06:46:48 +0000 |
commit | d514bf27a6b401fded29633a538642fed8b36f2c (patch) | |
tree | 835f4f972534662a3e9881ff587a38c64694cc5d /Zend/tests/bug40809.phpt | |
parent | 13aac95bfc915cad93916105ac2848455831000f (diff) | |
download | php-git-d514bf27a6b401fded29633a538642fed8b36f2c.tar.gz |
Improved Zend Memory Manager to guarantee reasonable time for worst cases of best-fit free block searching algorithm.
Diffstat (limited to 'Zend/tests/bug40809.phpt')
-rwxr-xr-x | Zend/tests/bug40809.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Zend/tests/bug40809.phpt b/Zend/tests/bug40809.phpt new file mode 100755 index 0000000000..c80849a10a --- /dev/null +++ b/Zend/tests/bug40809.phpt @@ -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 |