Re: [PHP4BETA] ZTS mode sooo much slower? (see attachment)
| From: | Thies C. Arntzen | Date: | Wed, 08 Sep 1999 12:37:32 +0000 |
| Subject: | Re: [PHP4BETA] ZTS mode sooo much slower? (see attachment) | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4236@lists.php.net to get a copy of this message | ||
hi,
changed the script to:
<?
echo "hello world\n";
?>
quantify tells me that the C++ lexer calls yy_get_previous_state 28 times
whereby the c-version only calls it once.
regards,
tc
ZTS version:
Data from php (pid 24878)
Note: Recursive descendants are marked with an '*'.
Function name: zendFlexLexer::yy_get_previous_state()
Filename: /dot/dc4/zend/zts-debug/libzend/zend-scanner.cc
Called: 28 times
Function time: 10039 cycles ( 0.23% of .root.)
Function+descendants time: 10039 cycles ( 0.23% of .root.)
Average function time: 358 cycles
Minimum function time: 13 cycles
Maximum function time: 1145 cycles
Distribution to callers:
28 times ZendFlexLexer::lex_scan(_zval_struct*,_zend_compiler_globals*)
Contributions from descendants:
[None]
non-ZTS version:
Data from php (pid 24873)
Note: Recursive descendants are marked with an '*'.
Function name: yy_get_previous_state[zend-scanner.o/20]
Filename: /dot/dc4/zend/cgi-debug/libzend/zend-scanner.c
Called: 1 time
Function time: 17 cycles ( 0.00% of .root.)
Function+descendants time: 17 cycles ( 0.00% of .root.)
Average function time: 17 cycles
Minimum function time: 17 cycles
Maximum function time: 17 cycles
Distribution to callers:
1 time lex_scan
Contributions from descendants:
[None]
On Tue, 7 Sep 1999, Rasmus Lerdorf wrote:
> > the intresting thing seems to be that yy_get_previous_state gets called
> > 156077 times in C++ mode but only 28 times in c-more...
> >
> > quantify tells me that system-calls have little/no impact in this
> > test-case.
> >
> > i also want to mention that the test-script does *NOT* execute a lot of
> > code but it defines a *LOT* of functions.
>
> How much code exactly? This still looks like it is related to the size of
> the buffer on the input stream which is one of the things that is very
> likely to be different in C++ mode. If you look in the generated flex
> scanner code you will see that yy_get_previous_state() is called when the
> end of the buffer is hit. So we hit the end of the input buffer 156077
> times in C++ mode and only 28 times in C mode? A little math based on the
> size of the data you are feeding this test case might be interesting.
>
> -Rasmus
>
>
> --
> PHP 4 Beta
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany