Settings

Theme

Ask HN: What do you recommend for optimization and profiling?

3 points by westicecoast32 6 years ago · 4 comments · 1 min read


I'm writing an app from scratch and I'd like to pay attention to places where I can optimize and profile things. So far I converted a few important functions to SIMD and wrote my own algorithm for another. The other day I got a tip on branch prediction and realized there's more I could learn.

Do you have any recommendations for profiling or optimization?

photawe 6 years ago

You know premature optimization is the root of all evil ;)

Personally, I do optimization every now and then, when I see bottlenecks and I see that it hurts the UI. Then you run some profiling tools and optimize those hot paths.

Optimizing from the get go will probably end up with you optimizing too much and the benefits will likely be invisible (and worst of all, optimizing will surely take quite a bit of extra time, and you can also end up with buggier code).

Having said that, I use dotTrace from JetBraints. It's for .net

If you expect your project will be complex, I would advise against C/C++, since that will complicate stuff even further (note: I've actually done 13 years of C++, so I do know what I'm talking about). I would recommend C#/F# - you'd be waaay more productive there.

thomas43 6 years ago

Do you have some more detaile about your app?

I use perf, sysprof, trace32, visual studio profiler for profiling, but this highly depends on your environment.

These assorted links might be interesting to you:

- https://github.com/Kobzol/hardware-effects

- https://www.youtube.com/watch?v=FJJTYQYB1JQ

- https://godbolt.org/

- http://igoro.com/archive/gallery-of-processor-cache-effects/

chrisbennet 6 years ago

For windows I use 2 C++ profilers (memory and speed) from https://www.softwareverify.com/index.php

I like to memory profile on a regular basis. It a is lot easier to catch and fix a memory leak if you discover it soon after you’ve introduced it.

notemaker 6 years ago

Anyone have experience with coz? The talk made it seem brilliant, but I haven't been able to make it work.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection