Before each `time` call, so that you're not getting really bad data due
to GC costs of other code, do this:
(collect-garbage)
(collect-garbage)
(collect-garbage)
The three times, like "there's no place like home", is a bit of folklore
that I'm not certain is still necessary or sufficient, with the current
default GC setup, but I'd do it until Matthew says otherwise.
I do have a kludgey old Racket package that needs rewriting (I made it
before `time`, or before I knew about `time`), and it was never
documented well:
http://www.neilvandyke.org/racket/shootout/
Later on, I was usually more busy with holistic optimizing in a large
real-world system, so, instead of `shootout` or just a quick `time`, I
mostly used Racket's statistical profiler (IIRC, Eli Barzilay made it),
with its text report renderer. I hooked it up into one system
permanently, so that profiling could optionally be enabled in a
development or production environment, and profile data would be saved
from multiple runs, together with some other metadata, for later analysis.
http://docs.racket-lang.org/profile/index.html
Once you find a reasonable sampling frequency and other options for the
statistical profiler in your system, and you learn how to trace your way
through the reports, it can be very useful. (And you get to feel like a
smart engineer, when your analysis activity locates a bottleneck, and
then you figure out how to improve performance in an immediately
cost-effective way, and without compromising long-term quality.)
There's some more recent Racket optimization-related tools, but I
haven't had a chance to use them.
--
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.