Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 86df86d

Browse files
Update php timings
Update behavior kv storages Fix getting count loops for phpinfo test
1 parent ad76687 commit 86df86d

File tree

7 files changed

+41
-35
lines changed

7 files changed

+41
-35
lines changed

‎bench.php

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -747,22 +747,22 @@ function gethostname() {
747747
$loopMaxPhpTimesMHz = 3500;
748748
// How much time needed for tests on this machine
749749
$loopMaxPhpTimes = array(
750-
'4.4' => 2099,
751-
'5.2' => 839,
752-
'5.3' => 1235,
753-
'5.4' => 1510,
754-
'5.5' => 802,
755-
'5.6' => 1337,
756-
'7.0' => 672,
757-
'7.1' => 669,
758-
'7.2' => 662,
759-
'7.3' => 586,
760-
'7.4' => 659,
761-
'8.0' => 676,
762-
'8.1' => 450,
763-
'8.2' => 427,
764-
'8.3' => 582,
765-
'8.4' => 529
750+
'4.4' => 1117,
751+
'5.2' => 1210,
752+
'5.3' => 2259,
753+
'5.4' => 4155,
754+
'5.5' => 4588,
755+
'5.6' => 4481,
756+
'7.0' => 3224,
757+
'7.1' => 3288,
758+
'7.2' => 2974,
759+
'7.3' => 3451,
760+
'7.4' => 3065,
761+
'8.0' => 3198,
762+
'8.1' => 4099,
763+
'8.2' => 2971,
764+
'8.3' => 3001,
765+
'8.4' => 4535
766766
);
767767
// Simple and fast test times, used to adjust all test times and limits
768768
$dumbTestMaxPhpTimes = array(
@@ -805,6 +805,7 @@ function gethostname() {
805805
'12_igb_unserialize' => 1300000,
806806
'11_msgpack_pack' => 1300000,
807807
'12_msgpack_unpack' => 1300000,
808+
'13_array_fill' => 250,
808809
'13_array_loop' => 250,
809810
'14_array_loop' => 250,
810811
'15_clean_loops' => 200000000,
@@ -832,10 +833,10 @@ function gethostname() {
832833
'36_01_zlib_deflate_compress' => 500000,
833834
'36_02_zlib_gzip_compress' => 500000,
834835
'36_bzip2_compress' => 50000,
835-
'36_lz4_compress' => 5000000,
836-
'36_snappy_compress' => 5000000,
837-
'36_zstd_compress' => 5000000,
838-
'36_brotli_compress' => 1000000,
836+
'36_lz4_compress' => 500000,
837+
'36_snappy_compress' => 500000,
838+
'36_zstd_compress' => 500000,
839+
'36_brotli_compress' => 100000,
839840
'37_01_php8_str_contains' => 100000,
840841
'37_02_php8_str_contains_emulate' => 100000,
841842
'38_01_php_uuid' => 1000000,
@@ -888,7 +889,8 @@ function gethostname() {
888889
'11_igb_serialize' => 4,
889890
'12_igb_unserialize' => 4,
890891
// php-5.3
891-
'13_array_loop' => 54,
892+
'13_array_fill' => 55,
893+
'13_array_loop' => 61,
892894
'14_array_loop' => 62,
893895
// opcache, php-7.4
894896
'15_clean_loops' => 14,
@@ -1939,6 +1941,7 @@ function filter_out_name_by_pattern($key)
19391941
if (!defined('REDIS_VERSION')) define('REDIS_VERSION', '-.-.-');
19401942
if (!defined('SQLITE3_VERSION')) define('SQLITE3_VERSION', '-.-.-');
19411943
if (!defined('MYSQL_VERSION')) define('MYSQL_VERSION', '-.-.-');
1944+
if (!defined('PGSQL_VERSION')) define('PGSQL_VERSION', '-.-.-');
19421945
if (!defined('MYSQLI_VERSION')) define('MYSQLI_VERSION', '-.-.-');
19431946
if (!defined('LIBXML_DOTTED_VERSION')) define('LIBXML_DOTTED_VERSION', '-.-.-');
19441947
if (!defined('SODIUM_LIBRARY_VERSION')) define('SODIUM_LIBRARY_VERSION', '-.-.-');
@@ -1999,7 +2002,7 @@ function print_results_common()
19992002
. str_pad("\t- WEBP", $padInfo, '', STR_PAD_LEFT) . " : $has_gdwebp"."\n"
20002003
. str_pad("\t- AVIF", $padInfo, '', STR_PAD_LEFT) . " : $has_gdavif"."\n"
20012004
. str_pad("imagick", $padInfo, '', STR_PAD_LEFT) . " : $has_imagick: version: ".IMG_VERSION.";\n"
2002-
. str_pad("apcu", $padInfo, '', STR_PAD_LEFT) . " : $has_apcu;\n"
2005+
. str_pad("apcu", $padInfo, '', STR_PAD_LEFT) . " : $has_apcu\n"
20032006
. str_pad("shmop", $padInfo, '', STR_PAD_LEFT) . " : $has_shmop\n"
20042007
. str_pad("memcache", $padInfo, '', STR_PAD_LEFT) . " : $has_memcache, version: ".MEMCACHE_VERSION.";\n"
20052008
. str_pad("redis", $padInfo, '', STR_PAD_LEFT) . " : $has_redis, version: ".REDIS_VERSION.";\n"

‎common.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ function test_13_Array_Fill()
377377
{
378378
global $testsLoopLimits, $arrayDimensionLimit, $totalOps;
379379

380-
$arrayTestLoopLimit = $testsLoopLimits['13_array_loop'];
380+
$arrayTestLoopLimit = $testsLoopLimits['13_array_fill'];
381381
$time_start = get_microtime();
382382
$memory = 0;
383383
for ($n = 0; $n < $arrayTestLoopLimit; ++$n) {

‎kv-apcu.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ function test_39_03_kvstorage_apcu()
3434
}
3535

3636
for ($i = 0; $i < $count; $i++) {
37-
$num = $i / 100.;
37+
$num = number_format($i / 100., 2, '.', '');
3838
$kvstorage->set($i, $num);
3939
$v=$kvstorage->get($i);
40-
if ($v===$num) $kvstorage->del($i);
40+
$kvstorage->del($i);
4141
}
4242
$totalOps += $count;
4343
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());

‎kv-memory.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ function test_39_01_kvstorage_memory()
2424
$time_start = get_microtime();
2525

2626
for ($i = 0; $i < $count; $i++) {
27-
$num = $i / 100.;
27+
$num =number_format( $i / 100., 2, '.', '');
2828
$kvstorage->set($i, $num);
2929
$v=$kvstorage->get($i);
30-
if ($v===$num) $kvstorage->del($i);
30+
$kvstorage->del($i);
3131
}
3232
$totalOps += $count;
3333
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());

‎kv-shmop.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function test_39_04_kvstorage_shmop()
2828
$time_start = get_microtime();
2929

3030
for ($i = 0; $i < $count; $i++) {
31-
$num = $i / 100.;
31+
$num = number_format($i / 100., 2, '.', '');
3232
$kvstorage->set($i, $num);
3333
$v=$kvstorage->get($i);
34-
if ($v===$num) $kvstorage->del($i);
34+
$kvstorage->del($i);
3535
}
3636
$totalOps += $count;
3737
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());

‎kv-xcache.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function test_39_02_kvstorage_xcache()
2828
$time_start = get_microtime();
2929

3030
for ($i = 0; $i < $count; $i++) {
31-
$num = $i / 100.;
31+
$num = number_format($i / 100., 2, '.', '');
3232
$kvstorage->set($i, $num);
3333
$v=$kvstorage->get($i);
34-
if ($v===$num) $kvstorage->del($i);
34+
$kvstorage->del($i);
3535
}
3636
$totalOps += $count;
3737
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());

‎kvstorage-apcu.inc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@ class KVStorageApcu
1717
}
1818

1919
public function set($key, $value, $timeout=60){
20-
return apcu_store($key, $value, $timeout);
20+
if (!$this->available) return false;
21+
return apcu_store('k'.$key, $value, $timeout);
2122
}
2223

2324
public function get($key, $default=null){
24-
return apcu_exists($key)
25-
? apcu_fetch($key)
25+
if (!$this->available) return false;
26+
return apcu_exists('k'.$key)
27+
? apcu_fetch('k'$key)
2628
: $default;
2729
}
2830

2931
public function del($key){
30-
return apcu_delete($key);
32+
if (!$this->available) return false;
33+
return apcu_delete('k'.$key);
3134
}
3235
}
3336
$kvstorage=new KVStorageApcu();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /