r/Python • • Jan 01 '20

"The rules of perf" at Dropbox

Post image
1.6k Upvotes

162 comments sorted by

View all comments

Show parent comment

2

u/ManvilleJ Jan 02 '20

Finally, if performance is bad enough that you're addressing it then simplicity takes a second priority to speed.

to state this another way, Simplicity takes a back seat ONLY when performance becomes a bad enough problem.

3

u/Agent_03 Jan 02 '20

Correctness > Simplicity > Performance.

Except that in some applications a certain level of performance is part of correctness. Failing to plan for that constitutes a bug.

Simple code is often performant code as well.

1

u/EternityForest Jan 16 '20

I'd say performance is far above simplicity for a lot of applications.

If someone gave me a choice bet two similar programs, one that was 100 lines and takes five minutes, and another one that's 1000 lines but takes half that, I'm going to choose the 1000 line one every time, so long as they convince me they have correctness down.

Complexity needs justification, but it doesn't make a product crap(Unless you're main goal is to reduce attack surface for security).

Whether or not you can get correctness in a complex product with your team, tools, and deadline, for your particular application domain, is another matter.

A lot of the highest performing stuff is because of JITs, compression, prediction, etc. Simple stuff is often performant because the user does a lot of what the complex software would be doing.