Hacker News new | past | comments | ask | show | jobs | submit | hellohello2's comments login

What is your use case? I struggle to see how ~4x faster Python has much value but I guess the effective speedup/value of that speedup depends on what you are doing.

EDIT: By that I meant, if you are trying to make something fast, wouldn't it make more sense to rewrite the critical path in a faster language rather than trying to improve Python's speed?


IME, PyPy can get up to 100x faster for many use cases. Most of my Python scripts have a lot of pure-Python code manipulating ints, strs, dicts, etc. (wrangling data between formats and/or doing basic processing), and switching from CPython to PyPy often turns the execution time from minutes into seconds.

You'll likely get much less of a speedup if your program is already optimized around CPython's slowness, e.g., by calling out to libraries like numpy as much as possible. But PyPy lets my simple scripts punch above their weight without any extra circumlocutions.


OP is about a Python app that had a costly inner loop. This could perhaps be improved by switching to a JIT compiled implementation of Python like Pypy, but there are drawbacks and potential dealbreakers too.


Most of the case 20x faster not just 4x. 4x faster is mostly bad cases. Worst cases ( a bit slower than python) c-extension for these needing cext, use python.

Why rewrite when you can achieve same without any code changes? PyPy performance rivals golang .

In OP Case this could increase performance by 20x easily.


Some things aren’t feasible to use another language for, but I see your point.

My use case is MILP optimization. Constructing the model representation(the step necessary before calling some optimizer binary) is very slow in CPython, and Pypy makes development much less painful, since you often need to construct many models to get it right.


Thanks, this is really interesting. How big of a speed up have you been observing?


as other commenter and i had mentions Some cases 100x increase , On many Cases 20x , on Bad cases 4x , on worst cases around 10% slower than python ( In case of some C Extensions ) . On unusable cases some libraries ( those with rust bindings and non-public CPyExt API) PyPy fails to work.


What you will be animating are styles. The programmatic aspects of animation are fairly straightforward. It just makes sense for it to be in CSS no?


How profitable is selling user comments as AI training data? At first glance the practice seems less misaligned than advertising


Lags for me as well on a recent Macbook pro. (Nice game though)


Why object literals instead of the standard function calls? Seems much less flexible.


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: