On this page:
8.18
top
← prev up

Futures VisualizerπŸ”— i

Parallelism with Futures in The Racket Guide introduces

The futures visualizer is a graphical profiling tool for parallel programs written using future . The tool shows a timeline of a program’s execution including all future-related events, as well as the overall amount of processor utilization at any point during the program’s lifetime.

syntax

( visualize-futures e...)

procedure

( visualize-futures-thunk thunk)any

thunk:(->any)
The visualize-futures macro enables the collection of data required by the visualizer and displays a profiler window showing the corresponding trace. The visualize-futures-thunk provides similar functionality where program code is contained within thunk.

A typical program using profiling might look like the following:

(require racket/future
future-visualizer)
(let ([f(future (lambda ()... ))])
...
(touch f)))

The preceding program is equivalent to:

(require racket/future
future-visualizer/trace
future-visualizer)
(let ([f(future (lambda ()... ))])
...
(touch f))

procedure

( show-visualizer #:timelinetimeline)void?

timeline:(listofindexed-future-event? )
Displays the visualizer window. If the function is called with no arguments, it must be preceded by the following sequence: a call to start-future-tracing! , program code that is being traced, and a call to stop-future-tracing! – in which case the visualizer will show data for all events logged in between those calls (via timeline-events ). Note that visualize-futures and visualize-futures-thunk are simpler alternatives to using these primitives directly. The timeline argument can be used to show the visualizer for a previously-generated trace.

top
← prev up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /