Re: [PHP4BETA] ZTS mode sooo much slower? (see attachment)
| From: | Thies C. Arntzen | Date: | Tue, 07 Sep 1999 10:17:35 +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-4182@lists.php.net to get a copy of this message | ||
hi -
the attached files are "annotated sources" created by quantify!
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.
i believe something MUST be rotten in c++ mode (maybe contact the flex
guys?)
tc
On Tue, 7 Sep 1999, Stig Bakken wrote:
> On Mon, 6 Sep 1999, Zeev Suraski wrote:
>
> > At 16:31 06/09/1999 , Thies C. Arntzen wrote:
> > >hi,
> > >
> > >just did soem "benchmarking" of zts mode agains "plain" mode on
> > >unix
> > >(solaris gcc 2.8.1) -
> > >
> > >this test-case just has no real code running - just included > 20 php files.
> > >
> > > ZTS non-ZTS
> > >real 4.20 0.57
> > >user 3.98 0.45
> > >sys 0.05 0.10
> > >
> > >quantify tells me that the c++ parser eats most of the time.
> > >
> > >(% of .root.)
> > >
> > >63% zendFlexLexer::yy_get_previous_state()
> > >12% ZendFlexLexer::lex_scan(...)
> > >7% zendFlexLexer::yy_get_next_buffer(...)
> > >2% zendparse()
> > >
> > >in "not-ZTS-mode" zendparse is the "busiest" function...
> > >
> > >are flex-generated c++ lexers known to be *SLOW* or am i doing something
> > >wrong?
> >
> > It could be that the C++ compiler is much less efficient and doesn't know
> > how to optimize very well. On a busy site, this can become negligible with
> > the persistent registry.
>
> Nothing is ever negligible on busy sites. :-)
>
> The C++ compiler adds some execution overhead, but that is (normally) in
> the range 5-10%, not hundreds of them.
>
> Zeev, have you done any testing of the same on Windows? I assume MSVC
> produces much faster C++ code than gcc.
>
> - Stig
>
>
> --
> 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