Skip to content

Conversation

BinaryMuse
Copy link
Contributor

@BinaryMuse BinaryMuse commented Sep 11, 2020

Currently, we run a Fuse query on the main thread when the user enters a search term. This causes a lot of GC and some page jank.

Before

This PR moves the Fuse search into the background via web workers. In my testing, this reduced event handler run time from hundreds of milliseconds to around 10.

After

@vercel
Copy link

vercel bot commented Sep 11, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

doctocat – ./

🔍 Inspect: https://vercel.com/primer/doctocat/r8e4900t6
✅ Preview: https://doctocat-git-mkt-search-in-bg.primer.vercel.app

gatsby-theme-primer-example – ./

🔍 Inspect: https://vercel.com/primer/gatsby-theme-primer-example/dblzep6k8
✅ Preview: https://gatsby-theme-primer-example-git-mkt-search-in-bg.primer.vercel.app

Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woooo!! This is awesome 🔥 Thanks, @BinaryMuse!

@ethomson
Copy link

ethomson commented Nov 2, 2020

Thanks for doing this @BinaryMuse! We just pulled this change into docs.npmjs.com which uses a fork of doctocat. 🎉 npm/feedback#78

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

Successfully merging this pull request may close these issues.

3 participants