[racket] profiling

From: Neil Toronto (neil.toronto at gmail.com)
Date: Thu Nov 10 14:50:35 EST 2011

Expanding on what Robby said about the statistical profiler (the 
`profile' module) being more useful: I've found that the statistical 
profiler more often correctly reports the names and source locations of 
functions. It also doesn't require compiling your code with profiling 
enabled - it just works. It doesn't do the nice graphical stuff, so 
you'd have to learn how to read its textual output.

Anyway, if you get stuck because the graphical profiler can't tell you a 
source location, try the statistical one.

FWIW, I've just done a major bout of profiling and speed tweaking in the 
plot library (managed 2x-5x faster on everything), and I've discovered that:

  - for/* macros are fairly fast
  - match and match-define are very fast, as well as being very readable
    (this is ace: you almost can't lose by destructuring with match)
  - function application is not generally a big performance hit
  - higher-order contracts and contract regions are slow

Neil T

On 11/10/2011 08:47 AM, Adam Shaw wrote:
> Excellent! This is very helpful -- thanks!
> Regards,
> Adam
> On Nov 10, 2011, at 9:44 AM, Robby Findler wrote:
>> Turning on profiling is an action in the Language dialog. It needs to
>> be set up before your program is compiled (which the below doesn't
>> do).
>> Robby
> _________________________________________________
>    For list-related administrative tasks:
>    http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.