5 ms·
It matters because all the heavy lifting is done by C and has little if anything to do with Python itself. You could give the same treatment to virtually any o
by jsd1982 10y ago
It matters because all the heavy lifting is done by C and has little if anything to do with Python itself.
You could give the same treatment to virtually any other host scripting language (Ruby, Lua, PHP) and then make outlandish claims that that host language is now capable of ridiculous things when it had nothing to do with the alleged success other than that it exposes a FFI that lets you create something like this.
- SEJeff 10y agoYour same argument can be applied to virtually any other language: This ruby benchmark doesn't matter because ruby is written in C! This nodejs benchmark doesn't matter because v8 is written in C/C++! etc.
- mattnewton 10y agoI think his argument is that ymmv as you add more python code to this native-heavy benchmark.
- throwawayish 10y agoITT: Web developers being surprised by the meaninglessness of microbenchmarks.
- jsd1982 10y agoNo, we're not surprised by microbenchmarks. We're surprised by the amount of investment in trying to improve the foundations of toppling-over buildings when that investment could be better spent elsewhere.
- devty 10y agoThe article mentions that the framework avoids creating python datastructure (e.g. A dictionary to read HTTP headers) to improve benchmark performance. It's a clever trick, but I am unconvinced that A less-than-simple application will demonstrate performance anywhere close to what was claimed in the article.
- jsd1982 10y ago> Your same argument can be applied to virtually any other language No it can't. Each of those languages you listed (as well as Python) has its own runtime system designed to implement the desired semantics and features of the language. When writing a C extension to one of these runtimes, you're escaping the confines of the runtime system in order to improve performance or capabilities not native to the host runtime. The point isn't "because it's written in C"; the point is that it's not written in Python and therefore the results of the benchmark cannot be attributed to Python, to say nothing of the merit of the benchmark in the first place.
- didibus 10y agoGo is written in Go.
- taormina 10y agoHe never claims anything to the contrary. "All the techniques that were mentioned here are not really specific to Python. They could be probably employed in other languages like Ruby, JavaScript or PHP even. I would be interested in doing such work as well but sadly this will not happen unless somebody funds it."
- crdoconnor 10y ago>It matters because all the heavy lifting is done by C and has little if anything to do with Python itself. Except it's all exposed via a python API that can be easily installed with pip and you can use it without even realizing that you're calling C. This is how python was always supposed to be optimized.
- takeda 10y agoThat's how it always been. The whole aspiration to have code Pythonic is to make it look like business logic, and you can't do this without abstracting things. This is how for example uvloop adds performance when using it with over asyncio. I was able to do network streaming (including live encoding) of audio and video in Python. Do you think that would be possible if it was native python code? Of course not, I used GStreamer which did that in C. My objective was not to write an encoder but stream the video, so as far as I am concerned my code was in Python. One of big strengths of Python is that when you need to improve its performance you just need to locate bottlenecks and rewrite them in a faster language. This is especially great when you want to do it in code that is not your primary objective, like in this project, you as a developer care what your code returns on specific requests you don't really care about how service handles each request etc. This is what a high level programing language is about.
- rdtsc 10y ago> You could give the same treatment to virtually any other host scripting language (Ruby, Lua, PHP) and then make outlandish claims that that host language is now capable of ridiculous things when Making extensions in C and FFI are a feature of Python. Should we then say that the scientific community is not really using Python because it's using all the C modules in numpy and other optimization library to do all that fast work? > You could give the same treatment to virtually any other host scripting language (Ruby, Lua, PHP) and then make outlandish claims that that host language is now capable of ridiculous things when Nothing wrong with it. Then you'd have a fast framework in that language two. You can have 3 fast frameworks in 3 different scripting languages. That is totally ok.