Closed
Bug 2021345
Opened 4 months ago
Closed 3 months ago
Move WebSerial reads to a separate thread for performance/power reasons
Categories
(Core :: DOM: Web Serial, enhancement)
Core
DOM: Web Serial
Tracking
()
RESOLVED
FIXED
152 Branch
People
(Reporter: gstoll, Assigned: gstoll)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Right now in dom/webserial/SerialPlatformRunnable.cpp we poll the serial port device and redispatch fairly frequently (at time of writing kReadPollIntervalMs is 20) to avoid missing data. If we moved this to a separate thread for each device, we could instead just block the thread, similar to what Chromium does.
| Assignee | ||
Comment 1•3 months ago
|
||
Updated•3 months ago
|
Assignee: nobody → gstoll
Attachment #9570687 -
Attachment description: WIP: Bug 2021345 - make WebSerial reads asynchronous → Bug 2021345 - make WebSerial reads asynchronous r=nika!
Status: NEW → ASSIGNED
Updated•3 months ago
|
Pushed by gstoll@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/f1ea8daf3b5b
https://hg.mozilla.org/integration/autoland/rev/e526f0c103e9
make WebSerial reads asynchronous r=nika,jld
Comment 3•3 months ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
status-firefox152:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Comment 4•3 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: poor performance for reading from WebSerial devices
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: low
- Explanation of risk level: Reworks how we read from WebSerial devices, but should only affects those devices and we've done manual validation for the most common ones.
- String changes made/needed?: n/a
- Is Android affected?: no
Attachment #9575262 -
Flags: approval-mozilla-beta?
| Assignee | ||
Comment 5•3 months ago
|
||
Note that this relies on the new PlatformPipeReader class added for
bug 2031881. Using this and NS_AsyncCopy() means that we no longer have
to poll for new data from serial devices, which means we're faster to
receive that data and also yields better power usage.
Original Revision: https://phabricator.services.mozilla.com/D294690
Updated•3 months ago
|
Attachment #9575262 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Updated•3 months ago
|
status-firefox151:
--- → fixed
Updated•10 days ago
|
Component: DOM: Device Interfaces → Dom: Web Serial
You need to log in
before you can comment on or make changes to this bug.
Description
•