Skip to content

Conversation

@wouterlucas
Copy link
Contributor

@wouterlucas wouterlucas commented May 27, 2024

ThreadX is a feature implemented to support offscreen canvas multithreading, however browser support for ThreadX will not come soon to our space (TV / STB market) and the current implementation has some negative side effects.

With the introduction of Drivers there is a lot of double housekeeping, maintaining two tree's of nodes, the DriverNode and CoreNode. This causes additional processing overhead (mainly extra function invocations and emitters) and an additional list of nodes stored in memory.

In the future we should ensure all ThreadX specifics are retained in the ThreadX module, likely by providing a RendererMain replacement from the ThreadX project and proxy the CoreNode respectively as we communicate over threads. And keep the specifics to ThreadX to where they belong.

Early test results:
current master: 20k nodes create 2867ms @ 65 MB HEAP:
image_2024_05_27T19_51_20_477Z image_2024_05_27T19_52_05_633Z

this pr: 20k nodes create 1272ms @ 35 MB HEAP:
image_2024_05_27T19_51_27_553Z image_2024_05_27T19_52_11_967Z

About 2.2x faster and nearly 50% less memory on an excessive stress test.

Todo:

  • Fix RTT
  • Fix/review VRT test results
  • Run an app on it

@pecoram
Copy link
Contributor

pecoram commented May 28, 2024

#281

@erikhaandrikman
Copy link
Contributor

🎉

@wouterlucas wouterlucas marked this pull request as ready for review June 4, 2024 13:26
@wouterlucas
Copy link
Contributor Author

Latest results with the PR compared to latest release:
image

@wouterlucas wouterlucas merged commit 4b592d7 into lightning-js:dev Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants