4 ms·
Think of using slow patterns as using a slow programming language. After you've optimised your python program and eliminated all hotspots, the python profiler i
by fvdessen 4y ago
Think of using slow patterns as using a slow programming language. After you've optimised your python program and eliminated all hotspots, the python profiler isn't going to say 'hey, this could be still 10x faster if rewritten in go'. Note that if you write a graphics engine, you aren't going to use python or even go, but something more like c, c++, rust, even though your code would be cleaner in python. Clean code techniques elevate your level of abstraction and prevent some problems, but at the (significant) cost of performance. It's of course always a matter of trade-offs and this matters more or less depending on which problem you are trying to solve.
- DeathArrow 4y ago>Clean code techniques elevate your level of abstraction and prevent some problems What problems do they prevent?
- Applejinx 4y agoUnemployment :) If you're able to make a program into a sort of puzzle concealing its state inside a twisty maze of tiny virtual functions so it's impossible to see plainly how anything is done, then you become indispensable as the only one who's internalized how the thing works. And then you insist it's all for easier comprehension… for those sufficiently intelligent to comprehend it.
- trashtester 4y agoEven more new clothes for the emperor.
- fvdessen 4y agoIf the average programmer didn’t use ‘clean code’ techniques they would end up with crazy spaghetti, not the fast and clear code shown in the video. (the average programmer is not on HN and can’t do fizzbuzz)
- badsectoracula 4y ago> After you've optimised your python program and eliminated all hotspots, the python profiler isn't going to say 'hey, this could be still 10x faster if rewritten in go'. No it wont say something like that but if you profile Python itself and see that a lot of time is spent in Python you can get a hint that rewriting it in another language that doesn't have Python's overhead might help.