Closed
Bug 1514908
Opened 7 years ago
Closed 7 years ago
Make WorkerRef take an rvalue reference to its callback
Categories
(Core :: DOM: Workers, enhancement, P2)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla66
| Tracking | Status | |
|---|---|---|
| firefox66 | --- | fixed |
People
(Reporter: mrbkap, Assigned: mrbkap)
Details
Attachments
(1 file)
StrongWorkerRef::Create and WeakWorkerRef::Create currently take a const reference to the callback and copy it around. Given that pretty much all of the closures passed to these functions capture RefPtrs to atomically refcounted objects, it seems worth the effort to reduce the number of copies. We can do that with rvalue references and std::move.
| Assignee | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Comment 2•7 years ago
|
||
By taking an rvalue reference and using std::move more aggressively, we can
avoid at least two copies of these closures, which avoids a bit of atomic
refcounting.
Updated•7 years ago
|
Priority: -- → P2
Pushed by mrbkap@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3359ea05f0ee
Reduce deep copies of the closures passed to this function. r=baku
Comment 4•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in
before you can comment on or make changes to this bug.
Description
•