It turned out this was just forgotten left-overs of redundant code that slowed down every page load. Brave’s developers didn’t need to work on the script to improve its performance they needed to delete it. Specifically, it was the cosmetic filter - a component responsible for adjusting page layouts to correct for breakages caused by adblocking. So, what caused all this extra work that slowed down page loads? The majority of the work came from JavaScript that the Brave browser injected into every page to help its adblocker. Brave’s developers looked into and addresses the performance issue within a few weeks of my initial report. I felt kind of stupid for having wasted my own time. Once I took the time to analyze the performance results, it turned out - as has been the theme this month - my code performed fine. I wasted hours optimizing my own code as I had not bothered analyzing the performance results. I discovered the performance problem while I was looking into some performance problems on a project I was working on. However, tiny amounts repeated hundreds of times a day multiplied by 36 million users (self-reported) equals a lot in aggregate. The improvement directly translates to faster page loads, less memory usage, more battery time, and a lower carbon footprint. it won’t scroll).īrave version 1.32.17 (a preview release) showing the same 475 ms period as above. The red area at the top indicates how much time the page is unresponsive (e.g. Ignore the minutia of the graphs, just look at the big differences.īrave version 1.29.81 (current stable release) 475 ms to load a page. The colored bars indicate work the browser has to complete to finish the page load. The two flame graphs below show a 475 ms window during a page load with the current stable release build of Brave (top), compared to the new and improved nightly releases (bottom). I could spend time describing the change with numbers (I do at the end), but let’s look at the bigger picture first. However, leftovers from its old system have remained in the browser and have quietly held back its performance potential. The Brave browser introduced a shiny new and more performant adblocking system in late 2019. An adblocker doesn’t necessarily make your web browser load pages faster.
0 Comments
Leave a Reply. |