More docs about contract costs in TR.
This commit is contained in:
parent
3a2c2514a6
commit
1fa0bb0e03
|
@ -166,3 +166,7 @@ Additionally, macros that are defined in Typed Racket modules cannot
|
||||||
be used in ordinary Racket modules because such uses can
|
be used in ordinary Racket modules because such uses can
|
||||||
circumvent the protections of the type system.
|
circumvent the protections of the type system.
|
||||||
|
|
||||||
|
@section{Expensive contract boundaries}
|
||||||
|
|
||||||
|
Contract boundaries installed for typed-untyped interaction may cause
|
||||||
|
significant slowdowns. See @secref{contract-costs} for details.
|
||||||
|
|
|
@ -159,7 +159,7 @@ preferable to vectors. Typed Racket can optimize struct access in all
|
||||||
cases.
|
cases.
|
||||||
|
|
||||||
|
|
||||||
@subsection[#:tag "optimization-coach"]{Optimization Coaching}
|
@subsection[#:tag "optimization-coach"]{Optimization coaching}
|
||||||
|
|
||||||
The Optimization Coach package provides optimization coaching support to help
|
The Optimization Coach package provides optimization coaching support to help
|
||||||
you get the most of the Typed Racket optimizer.
|
you get the most of the Typed Racket optimizer.
|
||||||
|
@ -173,3 +173,18 @@ debugging information. Setting the Racket logging level can be done on the
|
||||||
command line with the @racket[-W] flag:
|
command line with the @racket[-W] flag:
|
||||||
|
|
||||||
@commandline["racket -W debug@TR-optimizer my-typed-program.rkt"]
|
@commandline["racket -W debug@TR-optimizer my-typed-program.rkt"]
|
||||||
|
|
||||||
|
|
||||||
|
@subsection[#:tag "contract-costs"]{Contract boundaries}
|
||||||
|
|
||||||
|
When interoperating with untyped code (see @secref{typed-untyped-interaction}),
|
||||||
|
contracts are installed between typed and untyped modules. Contracts can have
|
||||||
|
significant overhead, thus typed-untyped boundary crossings should be avoided
|
||||||
|
in performance-sensitive code.
|
||||||
|
|
||||||
|
Typed Racket provides types for most of the bindings provided by @tt{#lang
|
||||||
|
racket}; using @racket[require/typed] is unnecessary in these cases.
|
||||||
|
|
||||||
|
If you suspect that contracts at a typed-untyped boundary may be have a
|
||||||
|
significant cost in your program, you can investigate further using the
|
||||||
|
contract profiler.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user