On Sun, Nov 17, 2013 at 11:35:21AM +0100, Antoine Pitrou wrote:Ah, sorry, I misunderstood your question.
> You didn't answer my question: did you actually use -OO in production,
> or not? Saying that -OO could have helped you optimize something you
> didn't care about isn't a very strong argument for -OO :)
I didn't use -OO, since I had no reason to remove docstrings. But I did
use -O to remove asserts. I was talking about assertions, not
docstrings. Since I haven't had to write code for embedded devices with
severely constrained memory, I've never cared about using -OO in
production.
Yes, I have knowingly added costly asserts to code with the intend of
> What I would like to know is if people *knowingly* add costly asserts
> to performance-critical code, with the intent of disabling them at
> runtime using -OO.
disabling them at runtime. Was it *performance-critical* code? I don't
know, that was the point of my earlier rambling -- I could demonstrate a
speedup of the individual functions in benchmarks, but nobody spent the
effort to determine which functions were performance critical.
--
Steven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/apieum%40gmail.com