PHP vs. Python vs. Perl
Paul T
pault12345 at yahoo.com
Wed Jun 28 22:19:28 UTC 2006
> However, the argument is still the same. A C based
> client is faster
> than a client in an interpreted language.
The numbers are *way* off. Factor of 5-10 for an
application that just sends 212K back and forth over
the network?
Are the PHP client gzipping by default, but Perl and
Python's do not? For 212K files - that would explain
it.
Read below if dynamic gzipping is *not* the case.
Rgds.Paul.
PS.
PHP being 5-10 faster becuase of C makes no sense
because Python/Perl marshalling can not be *that*much*
worse than the marshalling that PHP has (they are all
alike, come on!)
The benchmark was fetching files of 212K.
I think there would be no sensible difference for a
smaller files (10K) - (that will fit into single send
/ recv).
PHP or Perl or whatever -- in the end they all make a
syscall and the actual job is done by C code. All that
Perl/PHP/Python does is marshall 212K to/from C code.
In case of 10K files one should try *really*hard* to
marshall more than once. ;-)
For large files (212K is 'large') ...
If the client (purposely) fetches data in tiny chunks,
concatenating them as it goes not thinking about
associated marshalling costs - something like that
could possibly cause the factor of 10 slowdown on a
large file.
Also there might be something else and that 'else' is
related to the way (particular build?) of Perl/Python
deals with the network layer.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the memcached
mailing list