GithubHelp home page GithubHelp logo

Comments (5)

ssivov avatar ssivov commented on May 19, 2024

We did experiment with Clarity on a few of our internal resources and also tried it out on top100 popular websites. In the early stages there has been some noticeable impact, but we optimized for performance a lot since then and now it is running well on the vast majority of sites.

If you are experiencing performance issues on some website or have suggestions on how to improve perf even further, please let us know and we'll address such issues.

from clarity-js.

Nithanaroy avatar Nithanaroy commented on May 19, 2024

@ssivov That's awesome. Will certainly do if we observe any.

  • Could you share some high level learnings and optimizations you did?
  • Also could you share some numbers / charts on the top 100 popular sites?

These would help me persuade my case better. Thank you.

from clarity-js.

Nithanaroy avatar Nithanaroy commented on May 19, 2024

Every mutation takes ~0.25 ms to process. Since we have thousands of mutations, it takes up to 500 ms. This is just an estimate on our synthetic runs. It may be more / less on real user data. Due to this we are unable to proceed with this powerful library. Hence was requesting some numbers / charts based on your results. Thank you.

from clarity-js.

ssivov avatar ssivov commented on May 19, 2024

Nithanaroy, we analyzed the function-level aggregate timings and eliminated the biggest bottlenecks. Given the large amount of invocations, DOM access and HTMLCollections showed to be really slow, blocking the thread for multiple seconds in extreme cases. Switching from getting elements by id in the shadowdom document to manual "id to element" mapping in array yielded great gains. Also, iterating over HTMLCollection (getElementsByClassName) turned out to be much slower than turning that HTMLCollection into an array and iterating that array. Besides that we added web workers to carry out data compression in a different thread, which was our biggest perf improvement to date. We continue our work to reduce payloads so that there is less work done for compressing them, less data to send over network and store on the back end - all of those factor into better perf too.

Of course, websites with the high end amount of mutations are going to be more complex to observe no matter what implementation you use - there are simply more things going on, however what it really comes down to is the end user experience. If your mutations are small enough that thread is consistently yielded to the browser, it will not have such a sever impact on the user. Or, if your mutations are spread in time over multiple seconds and come as a result of user's interaction with the page - it will also be unlikely to cause noticeable slow down.

We do have a plan of adding monitoring of how much time Clarity actually takes in the browser for its main functions (page discovery, mutations processing, compression), so we will be able to talk more detailed numbers when that's ready.

from clarity-js.

Nithanaroy avatar Nithanaroy commented on May 19, 2024

That's great. Thank you.

from clarity-js.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.