LWN.net Logo

Pure Python?

Pure Python?

Posted Sep 11, 2009 3:28 UTC (Fri) by moxfyre (guest, #13847)
Parent article: Facebook releases the "Tornado" web server

That's really cool! I am a big Python fan and have used some of the Facebook APIs, and liked 'em.

But a high-performance web server in pure Python? Woah... seems like just the kind of situation where the memory and speed overhead of a dynamic language could slow things down. How do they pull that off? Anyone know any details?


(Log in to post comments)

Pure Python?

Posted Sep 11, 2009 4:34 UTC (Fri) by psykoyiko (subscriber, #23469) [Link]

Seems like it's an event driven design wrapped around Linux's epoll. The
rest is probably all Web-frameworky stuff and gravy. I'm looking forward to
giving it a shot.

Pure Python?

Posted Sep 11, 2009 5:22 UTC (Fri) by zlynx (subscriber, #2285) [Link]

You are probably right.

I have no doubt that a C or C++ server built along the same lines would be even faster, but it would be more difficult to write the code to produce the data to be served.

Pure Python?

Posted Sep 11, 2009 6:34 UTC (Fri) by drag (subscriber, #31333) [Link]

Maybe, maybe not. There is already a lot of highly optimized C being used in
that program, even if it is not apparent on the surface. Take numpy, which is
something entirely different and is a math library created for scientific
computing and is programmed by using python. Try telling those folks that
python is slow. :)

It all depends on the algorithms being used and the skill of the programmer.
There are a thousand ways to skin a cat in Python, but only a few of them
will have good performance and it takes a understanding of computer
architecture, algorithms, and python to find those out. High level
programming is a lousy substitution for skill and knowledge.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds