Here's another optimisation I thought of, aiming to reduce memory usage. This removes the element pointer in node and puts it in screenLine. On a 64-bit platform, this halves the size of node (16 bytes to 8 bytes) and increases screenLine by 24 bytes. Since most logs are pure text, this should be a win.
Like the last optimisation, it turns out this is also faster (between 3% - 15% on RendererNpm depending on platform). The memory allocation stats are identical between platforms.
Here's another optimisation I thought of, aiming to reduce memory usage. This removes the element pointer in
node
and puts it inscreenLine
. On a 64-bit platform, this halves the size ofnode
(16 bytes to 8 bytes) and increasesscreenLine
by 24 bytes. Since most logs are pure text, this should be a win.Like the last optimisation, it turns out this is also faster (between 3% - 15% on RendererNpm depending on platform). The memory allocation stats are identical between platforms.
Docker / Linux / AWS:
Linux / WSL / Intel i9-12900K:
Linux / older Xeon:
macOS / M1 Max:
wasmtime (on macOS on M1 Max):