bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.4k stars 1.46k forks source link

change list to tuple #1263

Closed SergBobrovsky closed 3 years ago

RonRothman commented 3 years ago

but for a website handling many requests this can add up very quickly

This code is in a config reader, true? I'd expect it to run only on startup or reload, not on every request. I see no reason to try optimizing it, especially at the expense of clarity.

Also, if someone cares about maximum runtime performance, they're not using Bottle, they're using (e.g.) Falcon. Bottle's beauty is in its ease of use and its code simplicity, not in its blazing speed.

if you show me bottleneck

Yes, I agree with you 100%. The right way to optimize is to profile first, and then make targeted changes.

Reasons why it's more important for code to be clear than to be fast:

(I know you probably know all of that already, since you're an experienced engineer, but I want to state it here for the benefit of future contributors.)

I came to this PR with an open mind, but I'm becoming convinced that this was an unnecessary change, albeit a small one; possibly even very slightly detrimental.

Finally, I want to add: Overall, I very highly appreciate the efforts you're putting into this project, which is near and dear to my heart. Thank you for all your recent improvements. I'd just like to challenge open source contributors in general to step back and think at a higher level about the changes they propose. My goal (like yours) is to have the best possible code out there. Thanks again!