There are much faster methods of doing things than loops in Python, and particularly in JIT-compiled optimized implementations like PyPy, or using numpy, scipy, numba, and other C-extension libraries that skip the normal interpreter entirely. Additionally, you can do certain things very quickly with certain techniques like using aggregation functions (e.g., builtins map, sum, filter, max, min, etc.), caching (e.g., @functools.lru_cache), multiprocessing, using the right tools for the job (e.g., use a parser for parsing a JSON file rather than doing things line-by-line, str.join instead of iterative string appending, etc.), and you can always use a FFI or some other tool/code for highly time-critical segments of code.
Sure, but why would I learn the DSL of one of the many tools with python bindings when I could do a 1:1 syntax translation to JS and have it be a few dozen times faster.
The whole argument of "python is fine, because the performance doesn't suck as long as you don't use it" seems silly to me.
View all comments
Show parent comment
6
u/thefireskull 7d ago
Is this JS hyper fast loop in the room with us?