From 9f7a0be1f2260c670d43518f070446d72f615a5e Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 8 Jan 2013 16:29:45 -0500 Subject: [PATCH] Document profiler support. original commit: 903eec448e5978c7cd1f0ad2b25bacb1aeb577e6 --- .../scribblings/guide/optimization.scrbl | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/collects/typed-racket/scribblings/guide/optimization.scrbl b/collects/typed-racket/scribblings/guide/optimization.scrbl index 8a4f6a83..c4e50a83 100644 --- a/collects/typed-racket/scribblings/guide/optimization.scrbl +++ b/collects/typed-racket/scribblings/guide/optimization.scrbl @@ -193,3 +193,38 @@ Racket to display performance debugging information. Setting the Racket logging level can be done on the command line with the @racket[-W] flag: @commandline{racket -W debug my-typed-program.rkt} + +@subsubsection{Refining Recommendations with Profiling Information} + +Given profiling information about your program, Optimization Coach can tailor +its recommendations to help you focus on the parts of your program that really +matter. + +@; TODO when OC is moved to its own collect, change this, and declare exporting +@(require (for-label (only-in typed-racket/base-env/prims optimization-coach-profile))) + +@defform[(optimization-coach-profile body ...)]{ +To gather profiling information for use with Optimization Coach, wrap the +portion of your program that you want to profile (typically an entry point to +the program) with @racket[optimization-coach-profile]. + +When you next run your program, profiling information will be written to a +file, ready to be used by Optimization Coach. The output filename is +constructed by appending the @tt{.profile} suffix to the program's filename. +} + +Once you have gathered profiling information, you can feed it to Optimization +Coach by specifying the profile file and clicking the @bold{Refine} button. +Optimization Coach will then reanalyze your program and produce new +recommendations. + +Compared to the pre-profiling recommendations, those new recommendations should +be both more targeted and more aggressive. +Post profiling, Optimization Coach only recommends changes to functions that +had a significant impact on program performance according to profile data. +These are the functions where your tuning efforts are likely best spent. + +In addition, Optimization Coach's post-profiling recommendations are more +aggressive. For example, it may recommend replacing convenient, high-level +constructs---such as structs--with more performant but lower-level ones---such +as vectors.