Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m concerned with the performance. It’s up to 16x slower than native Python, which we already know is 100x(?) slower than native code.

So roughly 1600x more clock cycles are consumed than is necessary.

I’m already jaded with the extreme bloat of JS frameworks as it is (how many times does my computer need to ramp up fans because of your React blog?). This could potentially be an order of magnitude worse.



I think the main usecase for Python in the browser using Pyodide is to enable scientific computing and visualization in the browser, and also as a way to ship small Python applications to those that don't have Python installed (e.g. drag and drop a CSV file which gets processed with pandas). Lastly it's useful to power interactive coding environments without needing to spawn a pod per user (and fighting off people using them to mine bitcoin).

Building a website or SPA entirely backed by Python seems like the wrong use of this technology. The same goes for crunching large amounts of data.


The quality of an answer is often orders of magnitude more important than the speed at which it's generated. Speed is important, but it is always secondary.

You wouldn't pull this in for a snappy, reactive UI driven by Python. You pull this in so that you can re-use a server-side module to perform some activity that isn't critical and so not worth re-writing in JavaScript. In another 5 years (assuming Python is still of interest and that this solution worked), it will have been refined and optimized where maybe you do reach for it by default.


Genuine question: What are the quality improvements offered by Python? Is it mostly access to the scientific community's Numpy/Scipy/Matplotlib? The language's semantics?


Most ML papers are implemented in Python, so you need it in order to be able to play with the latest and greatest toys, or you can wait for someone to port them to your favorite language, if ever.


And I would say that this is because of the language's syntax & semantics. Pythonic code looks like pseudocode, aka business logic.

There is very little boilerplate, and libraries are designed to hide what little there is.

So this means that mathematicians who hate verbosity can read and write their algorithms with little cognitive overhead.

Then you start to get the network effect where libraries are implemented or wrapped in Python, and people use those and start adding abstractions etc. The two main deep learning libraries (TensorFlow and PyTorch) are there, and those have huge gravity wells.


16x? FTA:

> performance since the 2019 announcement has improved greatly: "Performance ranges between near native to up to 3 to 5 times slower, depending on the benchmark."


Concrete Python applications wouldn't be 100x faster if re-coded in some low level language.

In most places where performance matter Python packages would be using either C extension, Cython or numba to get near native performance. Pyodide is able to build those packages (except for numba). So overall it's currently 3 to 5 slower than native Python (which uses C extensions). See detailed benchmarks in https://hacks.mozilla.org/2021/04/pyodide-spin-out-and-0-17-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: