>“Google users in America have searched for Python more often than for Kim Kardashian.” I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D
Python-based compiler achieves orders-of-magnitude speedups
41–50 of 193 posts
Re: Python-based compiler achieves orders-of-magnitude speedups
#42So the differences: https://docs.exaloop.io/codon/general/differences So more limited types (integers) and more type checking and collections have to have one kind of thing in them. There are other python compilers though, like https://github.com/Nuitka/Nuitka I wonder really what the advantages/disadvantages of these are?
So aside from that tiny issue at the center of the decade-long Python 2 to 3 migration debacle, it's virtually identical!
Re: Python-based compiler achieves orders-of-magnitude speedups
#43>“Google users in America have searched for Python more often than for Kim Kardashian.” I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D
It wouldn't waste time garbage collecting to focus on trash talking instead.
This language isn't here to make friends.
Re: Python-based compiler achieves orders-of-magnitude speedups
#44Quite sad to know that the dynamic nature of Python is preventing the speedups in the first place. I really hope there'll be a built-in optimizing JIT compiler without the limitations of PyPy, Codon, Nuitka, Numba, etc.
Re: Python-based compiler achieves orders-of-magnitude speedups
#45Re: Python-based compiler achieves orders-of-magnitude speedups
#46Can we please not? Humanity wasted close to 50 years optimizing compilers for one garbage language. Wasted unimaginable efforts, money and developer hours... and all could've been avoided if the same people dedicated a fraction of those resources to language design. Same thing happened with Java. And now the existence of a well-developed compiler became an argument in its own right in favor of choosing a bad language…
Re: Python-based compiler achieves orders-of-magnitude speedups
#47main.py:15:1: error: syntax error, unexpected 'async'
Re: Python-based compiler achieves orders-of-magnitude speedups
#48But it still shocks me just how much money and manpower is thrown at trying to bikeshed and optimize and compile Python and its libraries, while the Nim compiler is essentially a community hobby project that has made the concept of a "compiled Python" a reality already. The orders of magnitude in scale difference, and the qualities of the output products, are staggering.
I'm kind of starting to see what Guido is talking about when he says Python is a legacy language that's probably on its way out. Even in the interpreted world, languages like Janet and other newcomers are performing fascinating experiments, often doing more with less.
Re: Python-based compiler achieves orders-of-magnitude speedups
#49Earlier quoted context omitted.
Can you use Django with those optimisations or are they good mainly for scientific computing?
You can certainly use it, but whether you see any benefit is going to strongly depend on your workload. If you're doing significant calculations in the API then it might be considerably more performant, but if your API is primarily retrieving things from the database and transforming it to JSON then you're going to be limited mostly by the database latency and so I wouldn't expect major improvements.
Converting a few thousand rows to python/django objects takes _time_. I can't quantify anything, because it's been too long, but I remember it being fairly significant. When I profiled it, the majority of the time was spent calling __setattr__ a few million times.
Like you said, it depends on your use case. If your queries are slow, then optimize your database queries. But if your queries are fast and your responses are still slow, then investigating pypy is definitely worth it. You can also play around with .values_list or something in Django, so that you get 'raw values' instead of objects (but there's still a cost to building them up).
Re: Python-based compiler achieves orders-of-magnitude speedups
#50>“Google users in America have searched for Python more often than for Kim Kardashian.” I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D
And exposed naked primitives ... :-)