ox-charts

The sandbox and its limits

Scripts run in Web Workers with work, time and size caps, so a script can never hang the chart.

Scripts run in a pool of Web Workers (one per spare CPU core, up to eight), not on the page. The page sends source, inputs and bars, and gets back columns, drawings, alerts and order intents. A script cannot touch the page, the network or a broker.

LimitValueWhen hit
Operations per bar50,000,000Script stops with an error
Loop iterations per bar1,000,000Script stops with an error
Wall-clock per bar500 msScript stops with an error
Recursion depth200Script stops with an error
Full history run4 sThe run is abandoned
One live update250 msThe run is abandoned
Array / matrix items100,000Script stops with an error
Map entries50,000Script stops with an error
Drawings per kind50 (up to 500)Oldest removed
String length40,000Script stops with an error

A worker that stops answering is terminated after its budget plus a short grace period, and the script is marked with the reason. The rest of the chart keeps running.