Investigate performance impact of prioEncode
Categories
(Toolkit :: Telemetry, enhancement, P3)
Tracking
()
People
(Reporter: florian, Unassigned)
References
(Blocks 1 open bug)
Details
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Comment 8•6 years ago
|
||
Reporter | ||
Comment 9•6 years ago
|
||
Any progress on this? It's still pretty visible when profiling Nightly: https://perfht.ml/2DeDqgJ
Comment 10•6 years ago
|
||
I think that this will be moved out of the main ping soon as part of bug 1522657 - chutten is that correct?
As mentioned in comment 4 Prio is currently only enabled for the main ping on Nightly so I wouldn't expect this to show up in profiles of Release or Beta users (but do correct me if that's wrong)
Comment 11•6 years ago
|
||
That is the plan. I just now added a "Performance" section under "Details" in the proposal to ensure we remember to not call libprio on the main thread.
Comment 12•6 years ago
|
||
(In reply to Chris H-C :chutten from comment #11)
That is the plan. I just now added a "Performance" section under "Details" in the proposal to ensure we remember to not call libprio on the main thread.
Cool. Just FYI we haven't explicitly tested but do expect libprio to be thread-safe, and the current PrioEncoder.encode()
is synchronous but should therefore be fine to run in a worker (assuming the webidl is modified to allow it to be exposed to workers, right now it is Chrome-only.) Running in a separate process would be safe and easy too although probably not worth the overhead.
It'd be pretty easy to make .encode()
return a promise and handle threading internally too, a bit more work than the above but if you wanted to be able to call it seamlessly from JS on the main thread this would be a nice approach.
Comment 13•6 years ago
|
||
(In reply to Jan-Erik Rediger [:janerik] from comment #3)
There seem to be some inefficiencies in Prio, e.g. doing to much:
https://searchfox.org/mozilla-central/rev/
f997bd6bbfc4773e774fdb6cd010142370d186f9/third_party/prio/prio/config.c#29-31There's also a lot of time spent in
toupper
, upcasing data from this
array:
https://searchfox.org/mozilla-central/rev/
f997bd6bbfc4773e774fdb6cd010142370d186f9/third_party/prio/prio/params.h#32
FYI Henry opened a PR which should fix this in https://github.com/mozilla/libprio/pull/69
If anyone wants to help review please do!
Comment 14•6 years ago
|
||
(In reply to Robert Helmer [:rhelmer] from comment #13)
(In reply to Jan-Erik Rediger [:janerik] from comment #3)
There seem to be some inefficiencies in Prio, e.g. doing to much:
https://searchfox.org/mozilla-central/rev/
f997bd6bbfc4773e774fdb6cd010142370d186f9/third_party/prio/prio/config.c#29-31There's also a lot of time spent in
toupper
, upcasing data from this
array:
https://searchfox.org/mozilla-central/rev/
f997bd6bbfc4773e774fdb6cd010142370d186f9/third_party/prio/prio/params.h#32FYI Henry opened a PR which should fix this in https://github.com/mozilla/libprio/pull/69
If anyone wants to help review please do!
This has been merged upstream, it'll be vendored into Firefox by bug 1539715.
Updated•2 years ago
|
Description
•