-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] [WIP] Remove MediaSourceContentInitializer, add CoreInterface #1627
base: dev
Are you sure you want to change the base?
Conversation
7569943
to
47b4bf7
Compare
a203984
to
d97c89e
Compare
d97c89e
to
809f8e8
Compare
c632c93
to
33ce62e
Compare
Automated performance checks have been performed on commit Tests results✅ Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
This is a proof-of-concept where I try to put in common the "content initialization" logic for our "multithread" mode and our monothreaded mode. The idea is to replace that mode-specific code to a very thin layer (here called `CoreInterface`) between our "init" code (always running in main thread) and our "core" code (in a WebWorker in "multithread" mode) which would handle both modes: - in multithreaded mode, it would be the part doing `postmessage` calls and `onmessage` registering for thread communication - in monothreaded mode, it would just do the same thing through a very simple EventEmitter-like approach Or written another way: "multithread" and single-threaded mode would now share the same logic beside the communication system used at the frontier between the main-thread and potential worker (respectively `src/main_thread` code and `src/core` code). The end goal is to remove a lot of code, and to reduce the difference between the multithreaded and monothreaded logic, so our tests (integration, manual tests etc.) actually almost test the two in one go. There might be some performance lost due to steps we are now performing unnecessarily when in monothreaded mode (e.g. we serialize the Manifest structure even though it's not needed when a single thread is used, we create another PlaybackObserver on the core even though the main thread one could be re-used etc.). To see if that lead to a visible difference and if it does, it shouldn't be that hard to work-around.
33ce62e
to
3126d2e
Compare
Automated performance checks have been performed on commit Tests results✅ Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
Based on #1630 as performance regression is the main risk here
This is a proof-of-concept where I try to put in common the "content initialization" logic for our "multithread" mode and our monothreaded mode.
The idea is to replace that mode-specific code to a very thin layer (here called
CoreInterface
) between our "init" code (always running in main thread) and our "core" code (in a WebWorker in "multithread" mode) which would handle both modes:in multithreaded mode, it would be the part doing
postmessage
calls andonmessage
registering for thread communicationin monothreaded mode, it would just do the same thing through a very simple EventEmitter-like approach
Or written another way: "multithread" and single-threaded mode would now share the same logic beside the communication system used at the frontier between the main-thread and potential worker.
The end goal is to remove a lot of code, and to reduce the difference between the multithreaded and monothreaded logic, so our tests (integration, manual tests etc.) actually almost test the two in one go.
There might be some performance lost due to steps we are now performing unnecessarily when in monothreaded mode (e.g. we serialize the Manifest structure even though it's not needed when a single thread is used, we create another PlaybackObserver on the core even though the main thread one could be re-used etc.). To see if that lead to a visible difference and if it does, it shouldn't be that hard to work-around.