FlowscopeDocs

Performance

How Flowscope stays fast with many charts, the measured numbers, and the performance overlay.

Flowscope is built to keep sixty charts open, each with its own heatmap and order flow, without the interface thread doing market work. Markets are processed in parallel on a worker pool; the interface only reads and paints.

How the work is split

WhereWhat runs there
Network threads (two on desktop)Websocket decoding and routing by symbol
Engine workers (cores − 1 on desktop)One actor per market: book, liquidity runs, tape, bars, footprints, context. Heatmap rasters run as jobs.
Interface threadReads each pane’s data under a short lock and paints

Each market actor drains up to 512 messages, applies them under one write lock, and does follow-up work (snapshots, history paging, series rebuilds) outside the lock. Idle workers park until their mailbox wakes them.

In the browser there are no threads. The engine runs actors and jobs for up to 8 ms per frame, and network callbacks feed the same mailboxes.

A chart converts only new bars each frame and recomputes studies only when their inputs or the bars changed. Costly aggregates of live data (profiles, bubbles, the book) refresh a few times a second.

Measured

Simulator, 60 charts with heatmap, bubbles and book profile over 40 markets, release build under Xvfb with software OpenGL (llvmpipe):

MeasureValue
Events processed~4 200 / s
Market memory137 MB
Process RSS~430 MB
Interface CPU per frame6.1 ms average, 9.3 ms max
Heatmap rasters90 / s
Engine worker CPUNear zero

The frame rate in that run, 11 fps, was bound by software rasterization. On a GPU that cost moves off the CPU.

Live, with BTC on all five venues plus ETH and books running, the probe runs saw 0 decode errors and 0 reconnects.

Run the load test

Terminal
make stress

This starts the release build on the simulator with the 60 charts (load test) preset and the performance overlay open. It is the same as:

Terminal
FLOWSCOPE_SIM=1 FLOWSCOPE_PRESET=stress FLOWSCOPE_PERF=1 cargo run --release -p flowscope

To watch the overlay on live data:

Terminal
make perf

The load-test preset is available through make stress or FLOWSCOPE_PRESET=stress; Add pane is reserved for individual charts and widgets.

The performance overlay

Toggle it with the pulse icon in the top bar, or start with FLOWSCOPE_PERF set. Values are measured over rolling one-second windows.

RowMeaning
Frame rateFrames painted per second
UI frame timeInterface CPU per frame, average and maximum
PanesPanes in the layout
Heatmap rastersRaster jobs finished per second
MarketsMarkets open in the engine
Market memoryMemory held by all markets
EventsMarket events processed per second
WorkersEngine worker threads
ActorsTasks running on the workers
Queued jobsBackground jobs waiting
ConnectionsOpen websocket connections
FramesWebsocket frames received per second
BandwidthNetwork bytes received per second
ReconnectsReconnects since start
Decode errorsMessages that failed to decode

The bottom bar shows a short summary at all times: markets open, market memory, events per second and frame rate.

Tip

Rising Queued jobs means the workers cannot keep up. Rising Reconnects or Decode errors points at the network or a venue, not at Flowscope’s rendering.

Memory

The engine has a fixed budget, 3 GB on the desktop and 768 MB in the browser, divided among the open markets. When a market reaches its share, the oldest chunks leave memory first. Footprint days load from the data hub again when needed. See History and data.

Tips

  • Use the release build (make release) for real work. make desktop runs an unoptimized debug build.
  • Maximizing a pane (double-click its header) draws that pane alone until you restore it.