profiler

Por mzoran

Master (131)

imagem de mzoran

04-12-2020, 14:11

Hey all,

I can't find any decent documentation on profiling sections of code. I found this
https://hg.sr.ht/~grauw/neonlib/browse/tools/profile.tcl?rev...
and tried with in & out to 2ch but I see no updates.
There are a lot of commands profile:: but really not sure how to measure and see a result.
Can anyone give me an example or point me to documentation ?

Thanks

Entrar ou registrar-se para comentar

Por Grauw

Ascended (10024)

imagem de Grauw

04-12-2020, 14:55

See this thread: Performance Profiler - A first attempt

Seems like you linked to the older version of my profiler code (controlled with outs), I wrote some notes on that on the first page of that thread. In newer versions I moved away from that and instead specify the profiling start/end-points with TCL (although the outs control is easy to reinstate if desired, as I describe).

Por mzoran

Master (131)

imagem de mzoran

04-12-2020, 17:34

So if I do your example:
profile::section_scope_bp frame 0xfd9f
plus the function I am interested in
profile::section_scope_bp

profile_osd t
will start profiler display, but the problem is that the function that interests me does not execute each H.TIMI so profile display shows 0.
How to make it update data only when the function is called. If I omit frame section I never get an update, even when using profile:Shocked!sd_update

Por mzoran

Master (131)

imagem de mzoran

04-12-2020, 19:03

it seems that the magic keyword is frame
if I only use
profile::section_scope_bp frame
profile_osd t

I will get the results wanted

Por Grauw

Ascended (10024)

imagem de Grauw

04-12-2020, 19:24

The frame section divides the profile for visual display each frame, however if you are not interested in per-frame data you can omit it. In that case the visual display does not update, however you can still show the overall time spent in the openMSX console with the profile command.

If you want the visual display but for one frame, iirc the OSD updates when a “frame” section starts, so you can start a “frame” section at the end of the program.