You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by André Warnier <aw...@ice-sa.com> on 2009/03/21 12:02:46 UTC

[OT] of very off topic marketing question

Peter Crowther wrote:
[...]

> 
> I'm also particularly amused by the topmost set of bars in figure 2, given how proud the perl-ites are of their RE library and performance ;-).
> 
You didn't expect for a minute that this would remain unanswered, did you ?
First, the perl-ites would answer that the comparison being with PHP, it
is of little relevance.  Everyone knows that PHP is for the
script-kiddies, while Real Programmers use perl.
Second, they would tell you that in the same memory space used by one
Tomcat and one Java servlet, they could run 10 parallel Apache servers
with mod_perl to do the same thing, and still have a couple of them
spare to serve the static content and collect the data to display those
tables in real-time.
Finally, they would tell you that while Tomcat is still "warming up" in
order to run the comparison, they themselves are waiting for you at the
bar, and are already pretty warmed up themselves.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] of very off topic marketing question

Posted by Bill Davidson <bi...@gmail.com>.
Peter Crowther wrote:
>> From: André Warnier [mailto:aw@ice-sa.com]
>> Peter Crowther wrote:
>>> I'm also particularly amused by the topmost set of bars in
>> figure 2, given how proud the perl-ites are of their RE
>> library and performance ;-).
>> You didn't expect for a minute that this would remain
>> unanswered, did you ?
>> First, the perl-ites would answer that the comparison being
>> with PHP, it is of little relevance.
> 
> <sigh>.  Quite.  One of these days I'll learn to read... apologies.

Heh.  Yeah.  PHP's PCRE != Perl's RE.

More off topic: Perl's RE performance is usually not realized by
most Perl programmers because from what I've seen, most don't bother
to pre-compile their regular expressions.  I've seen RE intensive
Perl scripts achieve 20x speed-up simply by pre-compiling the regular
expressions with the qr// operator before applying them hundreds of
thousands of times on large data sets.

There's a reason I use Pattern.compile()/Pattern.matcher()/
Matcher.matches() etc. when String.matches() would have done the
job.

It might be interesting to do a speed comparison test between the
Perl, PHP/PCRE and Java RE libraries.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] of very off topic marketing question

Posted by Peter Crowther <Pe...@melandra.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Peter Crowther wrote:
> > I'm also particularly amused by the topmost set of bars in
> figure 2, given how proud the perl-ites are of their RE
> library and performance ;-).
> >
> You didn't expect for a minute that this would remain
> unanswered, did you ?
> First, the perl-ites would answer that the comparison being
> with PHP, it is of little relevance.

<sigh>.  Quite.  One of these days I'll learn to read... apologies.

                - Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] of very off topic marketing question

Posted by Leon Rosenberg <ro...@googlemail.com>.
On Sat, Mar 21, 2009 at 12:02 PM, André Warnier <aw...@ice-sa.com> wrote:
> Peter Crowther wrote:
> [...]
>
>>
>> I'm also particularly amused by the topmost set of bars in figure 2, given
>> how proud the perl-ites are of their RE library and performance ;-).
>>
> You didn't expect for a minute that this would remain unanswered, did you ?
> First, the perl-ites would answer that the comparison being with PHP, it
> is of little relevance.

damned, and i thought perlites is a disease, a bad form of meningitis maybe...
thanx for clearing things up!

Leon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] of very off topic marketing question

Posted by Joseph Millet <jo...@gmail.com>.
Right, I apologize too, never had to work with php multi-threading and
looking at it existing framework wrappings don't look this good at first
glance as it's only meant either for compiled code or command line exec, for
C-like expected behaviour. Some Frameworks such as Copix provide script
interpreted upper classes that seem to be limited in terms of sharing
variables and consequently session data. There remains the ability to
compile php and load it into server's memory although this might not be the
most common handy way of php-ing. Please note there are always workarounds,
that most of existing technologies may do what the other does and that Java
being a restrictive language doesn't make it, imho, the most "elegant
coding" programming language.

On Sat, Mar 21, 2009 at 6:50 PM, Jonathan Mast
<jh...@gmail.com>wrote:

> OK, so what would it look like? Show me a comparable snippet of PHP code.


Not sure my experience in php multithreading is worth a code snippet but, if
interested, you might like have a look at :
- http://php.net/pcntl_fork
- http://pear.php.net/package/PHP_Fork



> How does one enable this feature if its off by default?  Why is it off by
> default? I guessing it opens up security issues and/or has side effects.
> Not
> conducive to enterprise-level computing, imho.


PCNTL functions are native and seem as reliable as the system is for
prodiving parallel processing features, please note java Threads can't
either be compared to System Processes, one of the reason why java 1.5
provided you with some ThreadPoolExecutor services + others, whereas PCNTL
allows you to access system level calls i.e. it won't do any good under
windows as it's simply not built for parallel processing.

What is PEAR? Is that like the standard JavaSE library? The last time I was
> on php.net it seemed to be something that must be downloaded separately
> from
> the php server.


PEAR is an open-source framework and distribution system for reusable PHP
components. Aside php distribs, you're right.



> >relies on OS abilities.
> Does this mean my PHP code would have to tailored to Windows, MacOSX, or
> Linux? Please clarify.


You're right again it mean it's tailored to the Server OS, as said above you
can't expect parallel processing to be running properly on a
non-unix/linux/bsd/... environment. I doubt anyhow one may would go blindly
changing his/her app's OS as a "it's meant to work" even though it's
supposedly meant to.

Re: [OT] of very off topic marketing question

Posted by Jonathan Mast <jh...@gmail.com>.
OK, so what would it look like? Show me a comparable snippet of PHP code.

How does one enable this feature if its off by default?  Why is it off by
default? I guessing it opens up security issues and/or has side effects. Not
conducive to enterprise-level computing, imho.

What is PEAR? Is that like the standard JavaSE library? The last time I was
on php.net it seemed to be something that must be downloaded separately from
the php server.

>relies on OS abilities.
Does this mean my PHP code would have to tailored to Windows, MacOSX, or
Linux? Please clarify.


On Sat, Mar 21, 2009 at 7:50 AM, Joseph Millet <jo...@gmail.com>wrote:

> [...] Where blast() iterates thru several thousand records, which are sent
> to a
> third-party site for processing.  The third-party site allows no more than
> 5
> connections per second, so I just call Thread.sleep(1000) on every 5th
> record.
>
> It is very simple, very elegant and very fast now that some much load has
> been moved off the main http thread.
>
> My question is: how would this be accomplished in PHP?  Would I need to
> recompile the whole php server with a special thread package or what?
>
> One would use PHP PCNTL functions such as C-like fork(), it comes with any
> PHP but is not active by default and you'd find some wrapper libraries such
> as PEAR's PHP_FORK in order to help have a higher level of abstraction, so
> that you'd may write it just pretty much the same as you did in java. Of
> course this relies on OS abilities.
>
>
> On Sat, Mar 21, 2009 at 12:02 PM, André Warnier <aw...@ice-sa.com> wrote:
> > Peter Crowther wrote:
> > [...]
> >
> >>
> >> I'm also particularly amused by the topmost set of bars in figure 2,
> given
> >> how proud the perl-ites are of their RE library and performance ;-).
> >>
> > You didn't expect for a minute that this would remain unanswered, did you
> ?
> > First, the perl-ites would answer that the comparison being with PHP, it
> > is of little relevance.  Everyone knows that PHP is for the
> > script-kiddies, while Real Programmers use perl.
> > Second, they would tell you that in the same memory space used by one
> > Tomcat and one Java servlet, they could run 10 parallel Apache servers
> > with mod_perl to do the same thing, and still have a couple of them
> > spare to serve the static content and collect the data to display those
> > tables in real-time.
> > Finally, they would tell you that while Tomcat is still "warming up" in
> > order to run the comparison, they themselves are waiting for you at the
> > bar, and are already pretty warmed up themselves.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: [OT] of very off topic marketing question

Posted by Joseph Millet <jo...@gmail.com>.
[...] Where blast() iterates thru several thousand records, which are sent
to a
third-party site for processing.  The third-party site allows no more than 5
connections per second, so I just call Thread.sleep(1000) on every 5th
record.

It is very simple, very elegant and very fast now that some much load has
been moved off the main http thread.

My question is: how would this be accomplished in PHP?  Would I need to
recompile the whole php server with a special thread package or what?

One would use PHP PCNTL functions such as C-like fork(), it comes with any
PHP but is not active by default and you'd find some wrapper libraries such
as PEAR's PHP_FORK in order to help have a higher level of abstraction, so
that you'd may write it just pretty much the same as you did in java. Of
course this relies on OS abilities.


On Sat, Mar 21, 2009 at 12:02 PM, André Warnier <aw...@ice-sa.com> wrote:
> Peter Crowther wrote:
> [...]
>
>>
>> I'm also particularly amused by the topmost set of bars in figure 2,
given
>> how proud the perl-ites are of their RE library and performance ;-).
>>
> You didn't expect for a minute that this would remain unanswered, did you
?
> First, the perl-ites would answer that the comparison being with PHP, it
> is of little relevance.  Everyone knows that PHP is for the
> script-kiddies, while Real Programmers use perl.
> Second, they would tell you that in the same memory space used by one
> Tomcat and one Java servlet, they could run 10 parallel Apache servers
> with mod_perl to do the same thing, and still have a couple of them
> spare to serve the static content and collect the data to display those
> tables in real-time.
> Finally, they would tell you that while Tomcat is still "warming up" in
> order to run the comparison, they themselves are waiting for you at the
> bar, and are already pretty warmed up themselves.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>