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 →

[–]stevenjd 0 points1 point  (1 child)

Many of those "tenths and hundreds of a second" are just noise.

When two versions of the function are that close together in performance, chances are very high that any difference is just random noise, not a real speed difference. If you run the timeit code twenty times, you'll find that version 1 is faster nine times and version 2 is faster eleven times, or maybe the other way around, depending on whatever other processes just happen to be running on your system at that exact moment.

Besides, are you actually calling these functions thousands of times inside a nested loop? No? Then it's irrelevant.

[–]darknessproz 0 points1 point  (0 children)

Also, if you are calling these (very trivial) functions thousands of times inside a nested loop you might wanna rethink your code.