diff options
| author | Dmitry Stogov <dmitry@php.net> | 2010-04-22 15:03:17 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2010-04-22 15:03:17 +0000 |
| commit | e87d72002b7b173331c073e1e581e69f788d8a9c (patch) | |
| tree | 73dbd1c9da527977364d580cf9af3e91e06e3e46 /Zend/micro_bench.php | |
| parent | ac181e07efdf46c856033d9013b9bec5fb6cfe72 (diff) | |
| download | php-git-e87d72002b7b173331c073e1e581e69f788d8a9c.tar.gz | |
Optimized access to global constants using values with pre-calculated hash_values from litersls table
Diffstat (limited to 'Zend/micro_bench.php')
| -rw-r--r-- | Zend/micro_bench.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/micro_bench.php b/Zend/micro_bench.php index e07ee88ce5..0d705e942b 100644 --- a/Zend/micro_bench.php +++ b/Zend/micro_bench.php @@ -166,6 +166,14 @@ function create_object($n) { } } +define('TEST', null); + +function read_const($n) { + for ($i = 0; $i < $n; ++$i) { + $x = TEST; + } +} + /*****/ function empty_loop($n) { @@ -272,4 +280,6 @@ $x->read_const(N); $t = end_test($t, '$x = Foo::TEST', $overhead); create_object(N); $t = end_test($t, 'new Foo()', $overhead); +read_const(N); +$t = end_test($t, '$x = TEST', $overhead); total($t0, "Total"); |
