[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ossig] Zope faster than Apache?
How fast an overall program is depends more on how well the programmer
wrote the code and to some extent how good the compiler programmer is:
typically operations which happen thousands and millions of times
during the execution of a program will benefit from
optimisation...which means good code design and implementation, getting
a good compiler (pretty much language independent) and maybe even hand
coding assembly language for really performance critical stuff.
Once these critical modules are optimised all other code which may only
execute a few times doesn't need to be optimised, you can but the
effort will not be worth it.....law of diminishing returns, you can
spend days optimising but will little to show for it
The most important excerpt for me is this "my server guy said Apache
was designed for correctness and not for speed". "Correctness"
indicates to me that the code does a lot of sanity checking....thats
overhead which leads to lower performance but ultimately safer and more
secure code which is an acceptable trade off.
Sometimes language rules can affect performance. Pascal and relatives
(ADA, Modula etc) for example do bounds checking for arrays, so if
program inputs cause an array index to go beyond bounds you get an
index out of bounds run time error. This code is overhead and does slow
overall performance. In Turbo Pascal you could turn this code off and
all hell will break loose (ie buffer overflows and relatives) if you
didn't write your own sanity checking code. C however does not do range
checking so its up to the programmer to do the sanity checking.....if
something is written for speed, then sanity checking isn't so thorough,
or the programmer is too lazy to check for all possible inputs.... you
get security holes.
Me? I rather have less performance and more correctness :)
On Wednesday, Jun 25, 2003, at 13:20 Asia/Kuala_Lumpur, Mukhsein Johari
wrote:
Are programs written totally in C necessarily faster than programs
written in Python plus a few C modules? This is something I've been
thinking about and here is some anecdotal evidence that it's not
always so. Of course, it's possible this is an Apache config related
issue that Bruce forgot but it's also possible that it's not.
------------------
http://www.artima.com/intv/prodperf.html
Excerpt from Bruce interview:
Take Zope, for example. Zope is the enterprise application server I
use for my website. Zope is virtually all Python, but includes some C
code, because they profiled and optimized Zope so it would run faster.
When Zope was put on my machine, I discovered it was noticeably faster
than Apache had been. That seemed surprising to me, but my server guy
said Apache was designed for correctness and not for speed, so it
wasn't that surprising to him. Because Apache was written in C, I
figured it ought to be faster. But it turned out Zope was faster.
------------------
A number of the standard modules are in fact written in C for speed of
execution. A number of scientific python modules (NumArray/numpy/scipy
related stuff) are also written in C. Python allows you to select
which modules to optimize in C and which to leave as python using
profilers. What this effectively means is that you can develop faster
with python _and_ have a faster executing program (once C-optimized,
if needed) for delivery. I can have my cake and eat it too. I rather
like that...
Regards,
Mukhsein Johari
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job
search
http://corp.mail.com/careers
------------------------------------------------------------
To unsubscribe: send mail to ossig-request@mncc.com.my
with "unsubscribe ossig" in the body of the message
------------------------------------------------------------
To unsubscribe: send mail to ossig-request@mncc.com.my
with "unsubscribe ossig" in the body of the message