Take the terminal layout that measures a node once
Scrolling a conversation was choppy, and the reason was not the
scrolling: jolt-tui's paint cost 0.39ms per message in the backlog
whether that message was on screen or not. Two dozen messages and a frame
no longer fits in sixty a second; four hundred and it takes 157ms, so a
wheel notch moved the list six frames later.
Nothing upstream asked a node its size once — a box measured every child
to divide its room, placed them by measuring again, and the painter then
recursed and had the child repeat it — and a scroll painted its whole
content into a grid as tall as itself before copying a viewport out of
it. Sizes are now remembered against a revision each node carries, and a
scroll paints the rows it is showing. Measured through this client, on a
wheel notch and the frame it causes:
messages before after
25 45.3ms 0.83ms
200 371.5ms 1.88ms
400 814.9ms 2.98ms
Nothing on this side changes. The headless screenshot is the same bytes
it was, tag for tag, which is the check that says a paint that skipped
most of the backlog skipped the part nobody could see.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>590779a parent: 230bbef modified
flake.lock +5 -5 | @@ -110,16 +110,16 @@ | ||
| 110 | 110 | "jolt-native": { |
| 111 | 111 | "flake": false, |
| 112 | 112 | "locked": { |
| 113 | - "lastModified": 1788464616, | |
| 114 | - "narHash": "sha256-MvLa9/ipW3phQjBu+f1vNyzZtyFCvfwOeqKWxuw+lTg=", | |
| 113 | + "lastModified": 1788471157, | |
| 114 | + "narHash": "sha256-uHU8c4naFpJmwvmriVR2CEn6xhfwUFhqmMQzEjSyWt0=", | |
| 115 | 115 | "ref": "refs/heads/main", |
| 116 | - "rev": "384390d0e216cb6f0e9be8e597b9d16e7a64bb29", | |
| 117 | - "revCount": 42, | |
| 116 | + "rev": "c41903b106d04e5cf80828c49e2d7d456a54739d", | |
| 117 | + "revCount": 43, | |
| 118 | 118 | "type": "git", |
| 119 | 119 | "url": "https://gitlab.com/nandithebull/jolt-native" |
| 120 | 120 | }, |
| 121 | 121 | "original": { |
| 122 | - "rev": "384390d0e216cb6f0e9be8e597b9d16e7a64bb29", | |
| 122 | + "rev": "c41903b106d04e5cf80828c49e2d7d456a54739d", | |
| 123 | 123 | "type": "git", |
| 124 | 124 | "url": "https://gitlab.com/nandithebull/jolt-native" |
| 125 | 125 | } |
| @@ -110,16 +110,16 @@ | |||
| 110 | "jolt-native": { | 110 | "jolt-native": { |
| 111 | "flake": false, | 111 | "flake": false, |
| 112 | "locked": { | 112 | "locked": { |
| 113 | - "lastModified": 1788464616, | 113 | + "lastModified": 1788471157, |
| 114 | - "narHash": "sha256-MvLa9/ipW3phQjBu+f1vNyzZtyFCvfwOeqKWxuw+lTg=", | 114 | + "narHash": "sha256-uHU8c4naFpJmwvmriVR2CEn6xhfwUFhqmMQzEjSyWt0=", |
| 115 | "ref": "refs/heads/main", | 115 | "ref": "refs/heads/main", |
| 116 | - "rev": "384390d0e216cb6f0e9be8e597b9d16e7a64bb29", | 116 | + "rev": "c41903b106d04e5cf80828c49e2d7d456a54739d", |
| 117 | - "revCount": 42, | 117 | + "revCount": 43, |
| 118 | "type": "git", | 118 | "type": "git", |
| 119 | "url": "https://gitlab.com/nandithebull/jolt-native" | 119 | "url": "https://gitlab.com/nandithebull/jolt-native" |
| 120 | }, | 120 | }, |
| 121 | "original": { | 121 | "original": { |
| 122 | - "rev": "384390d0e216cb6f0e9be8e597b9d16e7a64bb29", | 122 | + "rev": "c41903b106d04e5cf80828c49e2d7d456a54739d", |
| 123 | "type": "git", | 123 | "type": "git", |
| 124 | "url": "https://gitlab.com/nandithebull/jolt-native" | 124 | "url": "https://gitlab.com/nandithebull/jolt-native" |
| 125 | } | 125 | } |
modified
flake.nix +1 -1 | @@ -46,7 +46,7 @@ | ||
| 46 | 46 | # drift this comment warns about wearing a different hat: one input, and |
| 47 | 47 | # the window and the terminal are the same library either way. |
| 48 | 48 | jolt-native = { |
| 49 | - url = "git+https://gitlab.com/nandithebull/jolt-native?rev=384390d0e216cb6f0e9be8e597b9d16e7a64bb29"; | |
| 49 | + url = "git+https://gitlab.com/nandithebull/jolt-native?rev=c41903b106d04e5cf80828c49e2d7d456a54739d"; | |
| 50 | 50 | flake = false; |
| 51 | 51 | }; |
| 52 | 52 | |
| @@ -46,7 +46,7 @@ | |||
| 46 | # drift this comment warns about wearing a different hat: one input, and | 46 | # drift this comment warns about wearing a different hat: one input, and |
| 47 | # the window and the terminal are the same library either way. | 47 | # the window and the terminal are the same library either way. |
| 48 | jolt-native = { | 48 | jolt-native = { |
| 49 | - url = "git+https://gitlab.com/nandithebull/jolt-native?rev=384390d0e216cb6f0e9be8e597b9d16e7a64bb29"; | 49 | + url = "git+https://gitlab.com/nandithebull/jolt-native?rev=c41903b106d04e5cf80828c49e2d7d456a54739d"; |
| 50 | flake = false; | 50 | flake = false; |
| 51 | }; | 51 | }; |
| 52 | 52 | ||