The current CPython 3.13 version only has (as far as I know) two types of code-rewriting optimizations: - a rudimentary JIT[1] that replaces byte code with machine code, without changing semantics - a specializer[2] that will take things like a + b, and simplify the byte code if both a and b are known types (int, float, string)
There is no higher-level optimizer to remove operations. Even PyPy is very careful with rewriting code, and uses code verification to prove the optimization rules [3]. [1] https://peps.python.org/pep-0744/ [2] https://peps.python.org/pep-0659/ [3] https://pypy.org/posts/2024/07/finding-simple-rewrite-rules-jit-z3.html which is one of a series of blog posts _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com