-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wontfix] [profiling] provide good support for valgrind's callgrind #10121
Comments
[2] (linked from top post)
EDIT: just filed upstream bug for valgrind: https://bugs.kde.org/show_bug.cgi?id=402696 |
Aww. |
well I fixed the main blocker for using valgrind/callgrind in #10124 ; For the remaining point (un-mangling mangled nim symbols appearing in callgrind.out.$pid), I was hoping to use EDIT: looks like it could be |
[Please don't close as "not Nim problem; won't fix", at least not before some discussion]
motivation
valgrind's callgrind likely offers the most accurate profiling results, eg see: http://gernotklingler.com/blog/gprof-valgrind-gperftools-evaluation-tools-application-level-cpu-profiling-linux/
, at the expense of large slowdown eg 50x.
In short, it uses valgrind's VM with JIT recompilation of x86 => RISC-like Ucode.
IMO we should have a good support for it, as it can inform us more accurately than other tools about nim compiler (or any other nim program)'s actual hotspots, which is important when optimizing code (eg helps avoiding blindly optimizing stuff that's not actual hotspot). For nim itself, that means: making nim compiler faster!
While I'm making some improvements to
--profile:on
(eg #10119), I'm not yet convinced Nim profiling story starts and ends with--profile:on
until I can at least compare results with valgrind's callgrind, for several reasons:{.push profiler: off.}
here and there that could affect profiling resultsBesides accuracy, valgrind's callgrind has other advantages:
--passC:-g
, but that's less intrusive, and IIUC, optional)callgrind usage example
callgrind issues
callgrind_annotate
(see [1]) to Nim source code(with line info and un-mangled name, IIRC there was some filename generated by some tool (?) that generated a mapping bw mangled Nim names and C names); EDIT: probably--genMapping
valgrind --tool=callgrind nim c main.nim
fails with : see [2] [wontfix] [profiling] provide good support for valgrind's callgrind #10121 (comment)Note that it works with some other programs built by nim, just not
nim
itselflinks
[1] example output with callgrind_annotate
The text was updated successfully, but these errors were encountered: