Closed Bug 1716606 Opened 3 years ago Closed 3 years ago

Replace keyup handling of history metadata typing metrics with C++ implementation

Categories

(Firefox :: Bookmarks & History, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: acreskey, Assigned: acreskey)

References

Details

Attachments

(3 files)

In Bug 1713385 we added the collection of typing metrics to history metadata (i.e. how much time was spent typing).
Disabled behind a pref.

However we took some measurements and found that the "keyup" handler, bound in JavaScript in the parent process, was introducing a measurable performance hit compared to a C++ implementation.
These are results are from a simple typing test. Baseline refers to running without history metadata enabled.

Time (ms) from PreHandleEvent to PostHandleEvent. Parent process. Reference Laptop, 2017, PGO build			
        Baseline           JS	              CPP
Mean	0.10073	           0.22207	      0.08720
Median	0.09050	           0.18040	      0.08375

Roughly 0.1 ms, with some slow outliers visible when plotted.

Measurements were taken on other devices that reproduced similar effects.

We did try minimizing the JS key handler function, but even an empty JS function introduced a measurable performance drop (~30%) in event handling.

This bug is to update the implementation of Bug 1713385 to replace the JS implementation of typing metrics with a C++ one.

Assignee: nobody → acreskey

Due to measured performance issues in the Chrome process, moving this code to C++.

Severity: -- → N/A
Priority: -- → P2

Measured on a Macbook pro, PGO build, the C++ implementation from the attached patch is within the noise, performance wise, of having interactions disabled.

Pushed by acreskey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5bbffb65c5e2
Replace keyup handling of history metadata typing metrics with C++ implementation r=Standard8,smaug
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: