Clément 148 Posted February 18, 2021 I use a profiler and I try to avoid wasting memory allocation. I've seen code searching for POST,PUT,GET,DELETE in a string spread all over the place. Why does one need to search so much? Parse and search once. Use enumerated types. There's a plethora of ready to use structures. Sometimes too KISSy is not KISS but simply S. 1 Share this post Link to post
dummzeuch 1515 Posted February 18, 2021 23 hours ago, Bill Meyer said: Performance optimization should be done because of performance issues, not simply to see whether you can buy another 10% improvement in a routine which doesn't affect user perception at all. You forgot one important reason to optimize: The pure fun of it. 😉 4 Share this post Link to post
Bill Meyer 337 Posted February 18, 2021 1 minute ago, dummzeuch said: You forgot one important reason to optimize: The pure fun of it. 😉 You're right. But I find the fun proportional to the improvement. Share this post Link to post
dummzeuch 1515 Posted February 18, 2021 1 hour ago, Bill Meyer said: You're right. But I find the fun proportional to the improvement. Hey, I am the German here (*1). But now you sound like one. 😉 Spoilsport! (*1: Of course I am not the only German here.) 1 Share this post Link to post
Bill Meyer 337 Posted February 18, 2021 Just now, dummzeuch said: Hey, I am the German here (*1). But now you sound like one. 😉 Spoilsport! (*1: Of course I am not the only German here.) I'm three generations removed from my German ancestry. Share this post Link to post
Mike Torrettinni 198 Posted February 26, 2021 (edited) I just realized I can do a better comparison of new vs old methods, when optimizing code: in the past I would profile old version, and save profiling results, then run new and compare screenshots of timings. But is much better if you run both methods at the same time and compare results: This way I can keep both methods in the same code, compare small improvements and I can switch on/off old vs new when profiling and see the progress of eliminating or reducing bottlenecks. Edited February 26, 2021 by Mike Torrettinni Share this post Link to post
Attila Kovacs 631 Posted February 26, 2021 (edited) I think you are doing it very well... Edited February 26, 2021 by Attila Kovacs Share this post Link to post
Mike Torrettinni 198 Posted March 3, 2021 On 2/18/2021 at 7:42 AM, Clément said: I've seen code searching for POST,PUT,GET,DELETE in a string spread all over the place. Why does one need to search so much? Parse and search once. Use enumerated types. There's a plethora of ready to use structures. I had similar situation with using Copy, Left, MidStr... It started years ago with one search, then same or similar search in another feature and so on... and each time I was asking myself do I really need more robust solution, if I just need it 'this time' (forgetting about the other 'this times'), and so it went unchecked for years until it was time to refactor and finding fast and robust solution. I have same thing now with refactoring all different look-up tables (arrays). Many many different implementations and now going to refactor into fast and robust solution(s). And just refactoring and improving memory consumption and using faster algorithms instead of many slow different implementation, I'm improving performance of the whole project, even though there was no single bottle-neck related to this. So, I guess I could say the bottle-neck were all these inefficient implementations all over the project, so everything 😉 Share this post Link to post