Browser-laptop: How does Brave browser optimize webview loading and rendering?

Created on 27 May 2016  路  8Comments  路  Source: brave/browser-laptop

I notice Brave loads webpage more quickly and with less content flashes in comparison to standard electron webview.

I created 2 clips below to see the difference.

Brave: https://dl.dropboxusercontent.com/u/2271268/brave.mp4
Electron webview: https://dl.dropboxusercontent.com/u/2271268/electron.mp4

What are the optimizations have been done by the Brave team?

question

Most helpful comment

At this point we're significantly diverged from electron and also we remove some APIs that cause performance trouble like sync IPC calls. This trend will continue as we use more built-in chromium things and adjust things that profiling finds are bottlenecks.

All 8 comments

This is pretty broad but we're fully open source so just take a look.
Mainly the difference is probably by not rendering ads and tracking elements.

I actually disabled the adblocker for the testing.

I had explored the code some, but did not find anything specific.
If anyone has any pointers, please do share. Thanks.

maybe it's faster by us doing less? Not sure. We aren't full chromium we just use libchromiumcontent via electron.

@bbondy I have the same question. For example, https://google.com loads smoothly with Brave but not in other electron apps.

You can try this sample: https://github.com/hokein/electron-sample-apps/tree/master/webview/browser and compare to Brave. I can't find anything specific in the Brave's source code. It seems like it's because the webview blocks the rendering process but Brave avoids this situation somehow.

@bbondy @steverandy Got it! I use https://github.com/brave/muon and recognize huge performance boost!

@quanglam2807 nice! Let us know in the Muon project if you encounter any issues or have any questions 馃槃

At this point we're significantly diverged from electron and also we remove some APIs that cause performance trouble like sync IPC calls. This trend will continue as we use more built-in chromium things and adjust things that profiling finds are bottlenecks.

@bbondy @bsclifton Thank you, guys! At the moment, I still need to keep using electron instead of muon because my app relies on electron-packager and it doesn't work well with muon.

Was this page helpful?
0 / 5 - 0 ratings