coco icon indicating copy to clipboard operation
coco copied to clipboard

discussion: profiler

Open timotheecour opened this issue 6 years ago • 4 comments

  • wondering if code profiler is out of scope for this project or whether there are opportunities for code reuse (eg visualization etc)

links

timotheecour avatar Nov 06 '18 20:11 timotheecour

I looked into nimprof and nim system/profiler.nim, it's interesting. I even thought it could be useful for solving our issues with code coverage when I saw the object system.StacktraceEntry which holds everything we need. Unfortunately the profiler has only a stacktrace object without any line number.

Sure we could work out a code profiler, starting by creating a chart out of nimprof results or creating our own profiler. But first it would be nice to have a proper code coverage tool.

samuelroy avatar Nov 06 '18 21:11 samuelroy

Unfortunately the profiler has only a stacktrace object without any line number.

I'm fixing this in https://github.com/nim-lang/Nim/pull/10119

Sure we could work out a code profiler, starting by creating a chart out of nimprof results or creating our own profiler

see also https://github.com/nim-lang/Nim/issues/10132 which compares 4 profilers as applied to nim

But first it would be nice to have a proper code coverage tool.

of course

timotheecour avatar Dec 31 '18 00:12 timotheecour

I'm fixing this in nim-lang/Nim#10119

Super interesting, I think it would be very helpful for what we're trying to do here.

samuelroy avatar Jan 02 '19 16:01 samuelroy

@timotheecour : I've seen that https://github.com/nim-lang/Nim/pull/10119 is unfortunately rejected.

Is there any plans to add line numbers to the stacktrace in lib/system/profiler.nim?

From your commits, it seems like a light addition and it might allow code coverage for any nim backends.

samuelroy avatar Oct 30 '19 21:10 samuelroy