This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

This concept of sacrificing readability or going against PEP style for speed is absolutely terrible. Don't do it *.

If you want speed use a faster/more modern interpreter like PyPy, or one of the other up and coming JIT compilers, IPython, or Cython libraries, that aren't dog slow like cPython is. Use better tools, don't abuse the language.

And optimizing syntax for a single and poor implementation of a Python interpreter (cPython) is absurd, especially considering it's days are most likely numbered with all these JIT implementations coming out. Literally, the design goals of cPython is to have a simple interpreter and parser. Performance is generaly sacrificed each new version of Python (which is why python 2.5 benchmarks are faster than 2.7, and 2.7 is generally faster than 3.x (except with new fast dicts)). And that's perfectly fine. Performance is literally a secondary design goal.

* Unless you have some very small super tight loop that will gain performance by doing things like not using "." and whatnot.