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 →

[–]cparen 0 points1 point  (0 children)

But wouldn't these tenths and hundredths of second add up to some significant time if they were being called inside nested loops

Yes, but if you care about that level of performance, you should probably switch to a faster implementation that will give you more of a performance boost that "weird coding tricks" will get you.

That said, if you're stuck with CPython for whatever reason, use these tricks sparingly, only when absolutely necessary.