binhonglee / coco

Code coverage for Nim lang (CLI + library)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discussion: profiler

timotheecour opened this issue · comments

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

links

commented

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.

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

I'm fixing this in nim-lang/Nim#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 nim-lang/Nim#10132 which compares 4 profilers as applied to nim

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

of course

commented

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.

commented

@timotheecour : I've seen that nim-lang/Nim#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.