mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
54dd762f59
Also adds an --asan flag to run-tests.php to setup all the necessary environment variables. Some tests are marked as skipped because they are incompatible with asan or too slow. I'm basing this on the DEBUG_ZTS build, which seems to give us the most mileage.
42 lines
791 B
PHP
42 lines
791 B
PHP
--TEST--
|
|
Concatenating many small strings should not slowdown allocations
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_DEBUG) { die ("skip debug version is slow"); }
|
|
if (getenv('SKIP_PERF_SENSITIVE')) die("skip performance sensitive test");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$time = microtime(TRUE);
|
|
|
|
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
|
|
$t_max = 1.0;
|
|
|
|
$datas = array_fill(0, 220000, [
|
|
'000.000.000.000',
|
|
'000.255.255.255',
|
|
'保留地址',
|
|
'保留地址',
|
|
'保留地址',
|
|
'保留地址',
|
|
'保留地址',
|
|
'保留地址',
|
|
]);
|
|
|
|
$time = microtime(TRUE);
|
|
$texts = '';
|
|
foreach ($datas AS $data)
|
|
{
|
|
$texts .= implode("\t", $data) . "\r\n";
|
|
}
|
|
|
|
$t = microtime(TRUE) - $time;
|
|
var_dump($t < $t_max);
|
|
|
|
?>
|
|
+++DONE+++
|
|
--EXPECT--
|
|
bool(true)
|
|
+++DONE+++
|