Skip to content
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

Consider making Fathom async #133

Open
biancadanforth opened this issue Aug 15, 2019 · 0 comments
Open

Consider making Fathom async #133

biancadanforth opened this issue Aug 15, 2019 · 0 comments

Comments

@biancadanforth
Copy link
Collaborator

biancadanforth commented Aug 15, 2019

Closing issue #118 provided a correctness but only small performance improvement (~13%) to Fathom-related jank in Price Tracker (which is dominated by calls to isVisible as perhaps many rulesets would be).

In that issue, we limited the isVisible improvement to a synchronous implementation. What I learned (second section) as part of that performance exploration is that simply by changing when isVisible is executed (i.e. running it async), we can reduce Fathom-related jank by upwards of 40%. This would be on top of any performance gains by changing the implementation itself (such as the 13% mentioned above).

We discussed optionally adding an async pre-processing step, though my suspicion is that that alone won't be enough, as we would still have a large chunk of main-thread-blocking, sync code execution on the order of 10s or even 100s of ms depending on the complexity of the ruleset.

Further, there may be instances, as in Price Tracker, where we want to run Fathom multiple times on a page if the page changes or if the earliest attempt is unsuccessful.

Therefore, it would be wise to pursue some ways to make all or part of Fathom async, to ensure we minimize or chunk up the jank especially at critical times like during page load, if the user is scrolling, etc.

One option is to execute Fathom on the page during browser idle times, though for some applications, this may be too late for the results to be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant