You'll generally want to look at:
- gc profiles
Do not get bogged down in microoptimizations before you've assessed any macro optimizations that are available. IO and the choice of algorithm dominate any low level changes you may make. In the end you have to think hard about your code!
Topos> For example, if i see that a particular pure function is taking a long time relative to the rest of the code, and that it's Text, and I'm seeing ARR_WORDS rise linearly in the heap, I probably have a thunk-based memory leak. This is knowledge you build up over time.
Those are pretty useful when you need to figure out the cost centers (the hot path):
Then you need to figure out what is going-on on the heap:
Finally, you need to benchmark your code and try to apply optimizations:
- criterion: benchmarking (nice statistics)
Having a look at Core may help.
- Locating Performance Bottlenecks
- Detecting Space Leaks
- Beating C with 80 lines of Haskell: wc