From e87d72002b7b173331c073e1e581e69f788d8a9c Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 22 Apr 2010 15:03:17 +0000 Subject: Optimized access to global constants using values with pre-calculated hash_values from litersls table --- Zend/micro_bench.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Zend/micro_bench.php') 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"); -- cgit v1.2.1