Re: Giving Globals the CV treatment [WAS: Runtime JIT Proposals]
| From: | Sara Golemon | Date: | Sat, 20 Jan 2007 21:57:20 +0000 |
| Subject: | Re: Giving Globals the CV treatment [WAS: Runtime JIT Proposals] | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27552@lists.php.net to get a copy of this message | ||
One last thought on global CVs... How's this for fixing the loophole of:
ZEND_BEGIN_SILENCE
ZEND_FETCH_R $0 '_POST' (global)
ZEND_FETCH_DIM_R $1 $0 'foo'
ZEND_END_SILENCE
I know it seems like a pretty minor gain, but (A) using @$_GET['foo']
isn't an uncommon practice, and (B) pushing this all into CV based
FETCH_DIM ops would greatly simplify the runtime JIT stuff I'm working on.
The short-version summary of this patch is that when the engine is going
to do a FETCH_DIM based on prior nodes, it checks the top of the
backpatch stack to see where the container element is coming from, if
it's coming from a simple FETCH, it rewrites that to a FETCH_DIM, rather
than adding a new element to the BP stack.
-Sara
P.S. - Bench numbers follow (0.1% difference):
unpatched patched
simple 0.472 0.473
simplecall 1.914 1.916
simpleucall 2.920 2.920
simpleudcall 3.507 3.507
mandel 2.056 2.055
mandel2 3.273 3.277
ackermann(7) 3.389 3.390
ary(50000) 0.157 0.157
ary2(50000) 0.138 0.138
ary3(2000) 1.057 1.056
fibo(30) 9.789 9.750
hash1(50000) 0.395 0.396
hash2(500) 0.300 0.300
heapsort(20000) 0.770 0.771
matrix(20) 0.508 0.508
nestedloop(12) 0.872 0.872
sieve(30) 0.640 0.640
strcat(200000) 0.289 0.289
--------------------------------
Total 32.446 32.416