admin管理员组

文章数量:1123145

I'm rewriting my landing page.

It consists of a single html file, a css file, and a bunch of javascript.

I don't use any third party libraries, nor want to.

The webpage run an "engine" that tick at 30hz. The rendering is around 60hz. Each frame I update few thousands elements in the viewport. The engine is constantly running.

What I realized is that over time, performances get better, both in firefox or chrome.

When I launch the browser, I sometimes hit performance bottleneck that affects the rendering done by the browser, and sometimes a bit the engine, according to the metrics I compute for monitoring.

But that never happens when the page had been running for "a long time" (few hours), even with reload during that period. It almost never bottleneck. Even when trying "harder" with bigger loads.

But if I close the browser and generate those spikes, the "lag" apear again.

If I clean the cache etc, after running the browser for a few hours, the bottlenecks doesn't appear. But on killing the browser process and restarting it, they come back.

I would like to troubleshoot and understand what is causing this behavior, as it starts to be hard, while developing, to assess those bottlenecks.

I guess it's some form of caching mechanism, but I can't understand exactly which one, nor how to work around it outside restarting the browser to get the real performance of my webapp.

Now, I'm all in for browser optimizing stuffs, but I don't care about optimization coming after that much time, I want those that you get from the start, not the ones coming after an hour of usage, as users will not spend more than a few minutes on that page.

What can I do to prevent that behavior ? And what is responsible for it ?

Thank you for your insights, google didn't helped me.

本文标签: google chromeWhy are performance in my web browser better over timeStack Overflow