From 00e17ab51f0e18be86016d7cbf82a26146eefc2a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 24 May 2011 08:02:09 -0600 Subject: [PATCH] adjust Guide to warn about performance measurement in DrRacket --- collects/scribblings/guide/performance.scrbl | 24 +++++++++++++++++++ .../scribblings/optimization.scrbl | 5 ++++ 2 files changed, 29 insertions(+) diff --git a/collects/scribblings/guide/performance.scrbl b/collects/scribblings/guide/performance.scrbl index d85fa533fa..c4d6640f71 100644 --- a/collects/scribblings/guide/performance.scrbl +++ b/collects/scribblings/guide/performance.scrbl @@ -5,6 +5,9 @@ @title[#:tag "performance"]{Performance} +@section-index["benchmarking"] +@section-index["speed"] + Alan Perlis famously quipped ``Lisp programmers know the value of everything and the cost of nothing.'' A Racket programmer knows, for example, that a @racket[lambda] anywhere in a program produces a value @@ -20,6 +23,27 @@ and memory performance of Racket code. @; ---------------------------------------------------------------------- +@section[#:tag "DrRacket-perf"]{Performance in DrRacket} + +By default, DrRacket instruments programs for debugging, and +debugging instrumentation can significantly degrade performance for +some programs. Even when debugging is disabled through the +@onscreen{Choose Language...} dialog's @onscreen{Show Details} panel, +the @onscreen{Preserve stacktrace} checkbox is clicked by default, +which also affects performance. Disabling debugging and stacktrace +preservation provides performance results that are more consistent +with running in plain @exec{racket}. + +Even so, DrRacket and programs developed within DrRacket use the same +Racket virtual machine, so garbage collection times (see +@secref["gc-perf"]) may be longer in DrRacket than when a program is +run by itself, and DrRacket threads may impede execution of program +threads. For the most reliable timing results for a program, run in +plain @exec{racket} instead of in the DrRacket development +environment. + +@; ---------------------------------------------------------------------- + @section[#:tag "JIT"]{The Bytecode and Just-in-Time (JIT) Compilers} Every definition or expression to be evaluated by Racket is compiled diff --git a/collects/typed-scheme/scribblings/optimization.scrbl b/collects/typed-scheme/scribblings/optimization.scrbl index 6124fdd2e6..0985d19eed 100644 --- a/collects/typed-scheme/scribblings/optimization.scrbl +++ b/collects/typed-scheme/scribblings/optimization.scrbl @@ -12,6 +12,11 @@ Typed Racket provides a type-driven optimizer that rewrites well-typed programs to potentially make them faster. It should in no way make your programs slower or unsafe. +@margin-note{For general information Racket performance and +benchmarking, see @secref[#:doc '(lib +"scribblings/guide/guide.scrbl")]{performance}.} + + @section{Turning the optimizer off} Typed Racket's optimizer is turned on by default. If you want to