On 2021-06-28 21:18, Alessandro Motta wrote:> One thing that is still puzzling 
/ worrying me: I completely failed to
> identify the actual bottleneck when profiling the code.
> 
> Did I simply misinterpret the profiling output / flame graph? Or is the
> problem rather that memory allocations and garbage collection are not
> tracked by the profiler?

Some things that might help (at least they helped me :-) ) ...

- Use the `profile-thunk` function described at
  https://docs.racket-lang.org/profile/ (most likely that's
  how you got your profile data to begin with).

- Use the `errortrace` option, i. e. run the instrumented
  program with `racket -l errortrace -t program.rkt`. The
  errortrace functionality is described as:

    When using Errortrace, profiles are more precise and
    more fine-grained (expression-level instead of
    function-level) but profiling has higher overhead and
    recompilation may be necessary.

- Note the remark about recompilation. It took me a bit to
  realize that I had to delete the `.zo` files. :-) In
  practice, I remove the `compiled` folders for the program
  I want to run. If you don't remove the compiled code, the
  old code - without errortrace information - will be used,
  but as far as I remember you'll get no error message or
  warning.

- There's also an option for the sample interval, so you can
  lower it to get finer-grained measurements. I don't find
  this now. Maybe someone else can point to more
  information.

- Learn to read the text output of the profiler as described
  under
  https://docs.racket-lang.org/profile/#%28part._.Textual_.Rendering%29
  Especially the distinction between the times with and
  without calls to nested functions is helpful. The profiler
  output may seem a bit overwhelming first, but with some
  time and experimentation it becomes better (like with so
  many things regarding Racket ;-) ).

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/08b4bcb1-145f-0824-55c0-05bf6641bf06%40sschwarzer.net.

Reply via email to