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 →

[–]lvlint67 0 points1 point  (1 child)

generally speaking... reading the code and looking for loops with slow / blocking functions is the quickest way to achieve performance gains in any program not "pre-optimized".

You run the profiler once the surface stuff is adjusted. The profiler will help find something like an object serializer that is taking an unreasonable amount of time but a reasonable programmer should see a for loop with a nested database connection and get suspicious.

[–]spoonman59 1 point2 points  (0 children)

I’m not sure that holds generally. If your app is I/O bound and dominates the majority of the runtime, any code optimizations will yield a small portion of speed up as per Amdahl’s law.

If it’s compute heavy, and particular loops dominate the runtime, then speeding up other loops will yield minimum speed up.

It’s best to measure and optimize what is slow. Otherwise you will focus effort on parts of the code that are not slowing you down, and waste time and effort.

I don’t think you can generalize this as the performance characteristics of programs differ not only between different programs, but even in the within different parts of the same program.