Profiling
- Linux:
perf
- Anywhere: vtune
When profiling, make sure to compile your code with:
-d:release
to turn on optimizations-d:lto
to enable LTO which significantly helps Nim in general--debugger:native
to enable native debug symbols- Incorporate libbacktrace or disable stack traces
- the stack trace algorithm that comes with nim is too slow for practical use
--stacktrace:off
as an alternative