Lokyr
Documentation

0.8.0's latency tail, startup and motion again, and allow-jit

On this page

Measured on 2026-11-09, from 18:07 to 19:57, after 0.8.0's A/B, whose latency's p99 was 7.4 ms longer than 0.7.0's in seven rounds of eight and whose startup's gap was 7 ms longer in its first two rounds; then from 22:01 to 22:45 on a MacBook Pro of no management, below. The sessions' scripts, reports and tables are in rest-F4-58; the micro-benchmarks' program in spikes/jit-entitlement.

Each session ran of that A/B's config, Menlo at 13 points, 120 × 40 cells, an opaque window, on the Dell P2721Q at 60 Hz, of balanced orders, the same pause of 2 s before each run, each copy started before its measured rounds. Microsoft Defender's enterprise inventory scripts, its endpoint extension and its data loss prevention agent ran through all of them, 20 % to 140 % of a core, as they do on this managed Mac; no session could wait for them to end.

In short

The sessions of 0.8.0 against 0.7.0 and of allow-jit

SessionWhenComparedp99, without the entitlementp99, of allow-jitRounds where it is longer
0.8.0's A/B15:550.7.0's DMG and 0.8.0's39.9 ms47.3 ms7 of 8
The A/B's second17:00the same, Defender scanning 36 GB of recordings68.3 ms70.4 mswithin the spread
At rest18:07the same44.9 ms55.8 ms13 of 16
allow-jit18:570.7.0 and 0.8.0, each also signed again, 0.7.0's with allow-jit and 0.8.0's without43.4 ms49.9 msboth ways: 0.7.0 longer of it, 0.8.0 shorter without it
The phases19:37a build of HEAD as signed, without allow-jit, and of allow-unsigned-executable-memory50.0 ms47.2 msnone
allow-jit again19:47the copies of 18:57, 12 rounds47.4 ms46.6 msnone
The M122:05the copies of 18:57, 16 rounds, on a Mac of no management at 120 Hz46.4 ms44.9 msnone, 15 of 32

The p50 is alike in every session, 19.2 to 20.6 ms but the second, loaded one's. Where the tail is longer, it is in most rounds; where it is not, it is not even of the same copies. What tells the sessions apart is not known: not the load average, which was alike, nor what the sparse records of the busiest processes show.

A sign test of the rounds, the two-sided chance of as many rounds longer one way under even odds, weighs each: 7 of 8 in 0.8.0's A/B, p = 0.07; 13 of 16 at rest, p = 0.02; 11 of 16 of allow-jit's copies against none at 18:57, 0.7.0's and 0.8.0's together, p = 0.21; 12 of 24 at 19:47, p = 1. The sessions that compared allow-jit alone, of the same code, never reach the at-rest session's weight, which compared 0.7.0's code with 0.8.0's too.

The builds between them

bisect: six release binaries of lokyr-app, of 0.7.0, a review's fixes (d4082d94), the host's hardening (5ffaed2d), the Luau host, its review's fixes and the timers (13b7d6f0), the installed plugins, the consent and the reloads with their review's fixes (1806ada0), and 0.8.0, each run outside a bundle, of no hardened runtime, in 12 rounds, each build twice in each place.

Buildp50p99In the fourth refresh or later
0.7.019.76 ms48.30 ms17 of 2388
The review's fixes19.72 ms42.53 ms5 of 2388
The host's hardening19.43 ms45.19 ms13 of 2388
The Luau host and its timers19.40 ms44.23 ms8 of 2387
The installed plugins19.53 ms48.54 ms14 of 2388
0.8.019.66 ms47.34 ms28 of 2388

The binary grows from 11.5 to 15.5 MB at 1806ada0, as the installed plugins reach Luau; its latency does not move.

The startup at rest

Four rounds of the floor and both apps, each started many times before: the gap to the minimal app's first window 26.9 ms of 0.7.0's, 20.4 ms of 0.8.0's, their medians 237.5 and 231.0 ms. The A/B's 7 ms longer of 0.8.0 were of a new copy, as startup-F3-228 found.

What the entitlement changes, of a program of its own

spikes/jit-entitlement signs the same binary five ways: ad hoc of no hardened runtime, the hardened runtime alone, of allow-jit, of allow-unsigned-executable-memory, and of both.

SignatureCode of MAP_JIT, as Luau's code generator maps itCode of a plain mapping
No hardened runtimerunsruns
The hardened runtime alonerefused, EINVALkilled, SIGKILL
allow-jitrunskilled
allow-unsigned-executable-memoryrunsruns
Bothrunsruns

Luau maps its code of MAP_JIT and turns it executable with mprotect, never of pthread_jit_write_protect_np; allow-unsigned-executable-memory lets it do so too, a wider exception.

The same program's measures, six rounds of each signature in turned orders (micro), and again with a region of MAP_JIT mapped first (micro-region):

Measure, p99No hardened runtimeThe hardened runtimeallow-jitallow-unsigned-executable-memory
A wake between two threads and back7.10 µs7.81 µs7.79 µs7.21 µs
A sleep of 1 ms, late by, at rest280 µs279 µs281 µs279 µs
The same beside a busy thread on each core3.89 ms3.78 ms3.78 ms3.99 ms
A page's first touch2.75 µs2.79 µs2.71 µs2.75 µs
getppid0.11 µs0.10 µs0.10 µs0.10 µs

The hardened runtime without allow-unsigned-executable-memory, alone or of allow-jit, has a wake between two threads 0.7 µs longer at its p99, 2.2 µs on the M1 below, in each round and with the region alike: microseconds, against a tail of milliseconds, and the same of allow-jit as of the hardened runtime alone, which 0.7.0 had. The rest is alike of all five within their spread. The tables until this session's last summed the four signatures of the hardened runtime into its column, a pattern of the analysis that took hr-*, fixed.

The latency's phases

The bench now tells each key's phases: the press, as the system stamped it, to the app's handling of its key; that to the frame that shows its echo, ready to present; and that to the frame's presentation. Of the session of 19:37, alike of the three signatures:

SignatureLatency p99Handled p50 and p99Framed p50 and p99Presented p50 and p99
allow-jit47.2 ms1.7 and 16.9 ms1.5 and 17.0 ms7.6 and 33.6 ms
None50.0 ms2.1 and 16.9 ms2.3 and 17.1 ms8.3 and 36.1 ms
allow-unsigned-executable-memory50.8 ms2.1 and 16.9 ms2.3 and 17.0 ms8.4 and 36.4 ms

The tail's keys wait a refresh in a phase, the most of them in the presentation's; which holds the wait for a drawable and the frame's encoding too, as the phase framed ends before the renderer draws, as a later review found, so that a wait of the main thread for a drawable counts there.

Luau's interpreter against its native code

As the choice of the entitlement weighs it: a plugin's work of each kind, on the SDK's fake host, of a release build, the median of 30 calls, in both executions, of Luau 0.740.

WorkInterpretedNative
A view of 200 rows rendered0.43 ms0.42 to 0.68 ms
2000 lines matched of string's patterns0.49 ms0.65 ms
A loop of string.byte over 100 KB3.2 ms3.3 ms
A loop of buffer.readu8 over 100 KB2.7 ms2.8 ms
Arithmetic over a table, a million operations6.9 ms2.3 ms
The template's activation0.17 ms0.27 ms
The activation of 2017 lines1.27 ms4.27 ms

The interpreter is native code's speed but for arithmetic in Luau's own loops, three times slower, and activates faster, as it compiles nothing; the byte loops of F0's spike of Lua runtimes, two to five times slower interpreted of an older Luau, are alike in 0.740.

The window's motion

Stopped after its first window: as in 0.8.0's A/B, Microsoft Defender scanned each recording of Instruments as it grew, about 80 % of a core, and 0.7.0's drag showed 29 frames a second and its resize 24, against 58 and 56 in 0.7.0's session. A session of the motion needs Defender quiet, or recordings in a place that it does not scan; the M1's measured it below.

On a Mac of no management

A MacBook Pro of Apple's M1 Max, 64 GB, macOS 26.7.3, just installed again, of no management, Microsoft Defender, Jamf nor any system extension: its built-in display alone, at 120 Hz through ProMotion, on AC power, its screen awake and unlocked, driven over SSH from the managed Mac, its apps opened by open in its desktop's session and the motion run in Terminal, which Accessibility allowed (m1, its setup and scripts). The session began once Spotlight's indexing and the photos' analysis had ended, the busiest process under 1.5 % of a core over 10 s; XProtect looked at each new copy at its first start, the warm-ups', and the window server alone worked through the rounds. The same copies as the managed Mac's: 0.7.0's and 0.8.0's apps of their DMGs, notarized, and each signed again, 0.7.0's with allow-jit and 0.8.0's without, of the same config, Menlo at 13 points, 120 × 40 cells; the results and their tables in m1/results.

The latency

16 rounds of 200 keys, the four apps in orders that turn, the second eight reversed, each in each place four times:

Appp50, meanp99, meanp99, medianIn the fourth refresh or later
0.7.021.52 ms45.85 ms (sd 3.35)45.69 ms739 of 3181
0.7.0 of allow-jit21.40 ms44.41 ms (sd 4.81)44.57 ms708 of 3178
0.8.0, of allow-jit21.63 ms45.34 ms (sd 2.66)45.72 ms733 of 3178
0.8.0 without it21.22 ms46.90 ms (sd 3.51)45.73 ms734 of 3182

allow-jit's copy has the longer p99 in 8 rounds of 16 of 0.7.0 and 7 of 16 of 0.8.0, 15 of 32, p = 0.86; its p99 1.5 ms shorter on the mean, the same on the median. At 120 Hz a refresh is 8.33 ms, so that the fourth refresh begins at 25 ms, which a quarter of every app's keys reach.

The entitlement's micro-benchmarks

Measure, p99No hardened runtimeThe hardened runtimeallow-jitallow-unsigned-executable-memoryBoth
A wake between two threads and back4.79 µs6.54 µs6.65 µs4.35 µs4.38 µs
A sleep of 1 ms, late by, at rest306 µs321 µs310 µs320 µs314 µs
The same beside a busy thread on each core9.17 ms9.19 ms9.18 ms9.17 ms9.23 ms
A page's first touch3.65 µs3.81 µs3.90 µs3.98 µs3.75 µs
getppid0.11 µs0.11 µs0.11 µs0.11 µs0.11 µs

The managed Mac's pattern, larger: the wake 2.2 µs longer of the hardened runtime without allow-unsigned-executable-memory, 6.3 to 6.8 µs in every round against 4.0 to 5.5, allow-jit the hardened runtime's.

The startup

Four rounds, both apps started before, the minimal app's first window each round:

RoundThe minimal app0.7.00.8.00.7.0's gap0.8.0's gap
1229.3 ms283.4 ms285.6 ms54.1 ms56.2 ms
2228.0 ms283.9 ms287.2 ms55.9 ms59.2 ms
3226.2 ms282.1 ms284.8 ms56.0 ms58.6 ms
4226.4 ms286.4 ms288.1 ms59.9 ms61.7 ms
Mean284.0 ms286.4 ms56.5 ms58.9 ms

0.8.0 starts 2.4 ms later in each round, 4 % of the gap, as its binary grows from 11.5 to 15.5 MB; the managed Mac's rounds, of a spread of 4 to 43 ms, could not tell so little. The M1's gap is twice the managed Mac's, of a slower machine; the budget, 35 ms, is of the M5 Pro's sessions.

The window's motion on the M1

As motion-F3-152 measures it, of its config, two rounds, the second reversed, each recording's figures taken and its trace removed before the next (motion.sh): frames a second shown of 120, the mean of the two rounds.

Motion0.7.00.8.0
A drag, opaque83.7, its second round alone85.5
A drag, translucent with a blur82.684.6
A live resize, opaque87.087.6
A live resize, translucent with a blur85.386.6

0.7.0's first drag ran as ProMotion held the display at 60 Hz, 59.2 frames a second of 60, left out. A resize misses 306 to 333 refreshes of about 1150 in both, the compositor's delay 13.2 to 13.5 ms at its p50 and 14.3 to 14.6 at its p95; the window server 43 to 47 % of a core and the app 31 to 36 %. 0.8.0 moves its window as 0.7.0 does.