Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Build Slow #4323

Closed
davidfritsche17 opened this issue May 6, 2019 · 7 comments
Closed

Release Build Slow #4323

davidfritsche17 opened this issue May 6, 2019 · 7 comments

Comments

@davidfritsche17
Copy link

@davidfritsche17 davidfritsche17 commented May 6, 2019

Description

I am building a POC on Windows to determine what's possible with the code. I was able to build a Release version with some simple branding changes. In general the browser works. I am using 0.63.48 as this is the version on the released Brave Browser.

In some simple testing, my build of this browser is slow. Example:

  • Clearing Cache and loading MSN.com on Brave takes about 2 seconds.
  • Doing the same on my version takes 12 seconds.

My question is, are there other build settings I should use to increase the performance of the Built Browser?

I noticed this on the debug build as well, but thought this non-debug build would solve it. Here's some settings I have tried to help do two things:

  1. decrease the size of the Installer (non debug went from 1.3GB down to 550MB
  2. increase performance.

These are in Config.js:
is_component_build: false, //Chromium indication this is faster performance.
proprietary_codecs: true,
ffmpeg_branding: "Chrome",
enable_nacl: false,
// branding_path_component: "brave",
enable_widevine: true,
target_cpu: this.targetArch, //x64
is_official_build: false,
is_debug: false,
dcheck_always_on: this.buildConfig !== 'Release',
//this.channel,
brave_channel: 'release',

Steps to Reproduce

  1. Git Brave version 0.63.48 (current version should give the same results as well)
  2. Build this version using NPM Run Create_dist
  3. Test from either OUT/Release Directory or Dist directory
  4. Load various sites to test performance as compared to Brave or Chrome.

Actual result:

Browser is slow loading sites.

Expected result:

Brave browser is very fast.

Reproduces how often:

every time. I have done multiple builds. Most were debug builds and these were all slow performing as well. This one is a release build with the same result. Also others were with the current build at the time which I think was 0.66.48

Brave version (brave://version info)

Windows x64
0.63.48

Version/Channel Information:

not sure this applies

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
    settings are the same in both browsers. Disabling for the site being tested had no affect.
  • Does the issue resolve itself when disabling Brave Rewards?
    Not enabled
  • Is the issue reproducible on the latest version of Chrome?
    Chrome is fast.

Miscellaneous Information:

@davidfritsche17
Copy link
Author

@davidfritsche17 davidfritsche17 commented May 7, 2019

Ran some tests on several website to see where the slowness may be occurring. Ran several sites with basicly the same results. The Compiled Brave browser is 600% slower than the Released brave browser. The dev tools break it up into 5 categories (hopefully the graphics will transfer here. All categories are slower except system.

Just FYI, all tests were on the same computer with

Hoping to find that magic compile setting that gives comparable speed. Any ideas?
Times in MS

image

image

@bbondy
Copy link
Member

@bbondy bbondy commented May 8, 2019

--official_build=true I think will makeup the difference.

@davidfritsche17
Copy link
Author

@davidfritsche17 davidfritsche17 commented May 8, 2019

Thank you. That worked. The build is fast and the installed went from 554mb to 67 mb.

However, it did not take any of my branding changes. I re-ran them and they are in the SRC. But this build seems to ignore them. I was under the impression that Official Build meant only for the Brave employees. Can you give me an idea of what its for and if i can get these benefits and still retain my changes?

Thanks in advance.

David

@davidfritsche17
Copy link
Author

@davidfritsche17 davidfritsche17 commented May 8, 2019

Additional info I found helpful. Maybe the next person will as well:

From Chromium
Build arguments. Examples:

  • is_component_build = true (much faster incremental build, very slightly slower performance)
  • is_debug = false (true means no optimizations, much slower performance)
  • symbol_level = 1 (2 = source-level debugging but slower build, 1 = functions only)
  • dcheck_always_on = true (enable all runtime checks, somewhat slower performance)

In Config.js
For best performance use:

  • is_component_build = false
  • is_debug = false
  • dcheck_always_on = false
  • symbol_level = 1

Brian is correct - The true performance gain is the official_build=true

However, per my question above, it did not retain my branding changes. I rebuilt again without this flag and my branding changes were there. It should be noted that doing an official build rebuilds everything...all 38,000 items. :-)

Hopefully there's a way to do the official build and retain the changes. Awaiting your reply :-)

David

@davidfritsche17
Copy link
Author

@davidfritsche17 davidfritsche17 commented May 10, 2019

just repeating the question here since I am stuck on my POC - see details above.
Is there anyway to do an Official Build (--official_build=true) and maintain the branding changes?

Thanks in advance.

David

@bsclifton
Copy link
Member

@bsclifton bsclifton commented May 20, 2019

@davidfritsche17 there are guards in the code specifically around OFFICIAL_BUILD. You'll want to look at these. Often, one code path will be taken for official builds, otherwise a different path is taken. This is likely the case

Let me know if you are needing an example

In the GN files, you'll see it referenced as is_official_build and in the C++, you'll see it referenced as #if defined(OFFICIAL_BUILD)

@bsclifton bsclifton added the question label May 20, 2019
@bsclifton
Copy link
Member

@bsclifton bsclifton commented May 20, 2019

Closing as the original ask has been solved and there is no action needed from our side. Please do continue the conversation here 😄

@bsclifton bsclifton closed this May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.