我想用不同项目的不同补丁为自己编译Chromium for windows(至少今天是这样(。我遵循以下官方指示:https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md所有的步骤都顺利通过了,但我的表现非常糟糕。规范中的OMeter基准(https://browserbench.org/Speedometer2.0/)我的构建只得到5分,而官方构建得到116分!这是我使用的GIT命令:
gclient
mkdir chromium && cd chromium
fetch --no-history chromium
cd src
gn gen --ide=vs out/Default "--args=target_cpu="x86""
autoninja -C out/Default chrome -j 6
我尝试了什么,但这没有帮助:
- 删除仓库工具文件夹,然后重新开始
- 将-j从10减至8并减至6
- 删除参数--ide=vs
- 获取历史记录
- 使用命令";gn gen";不带--args部分
- 禁用windows defender&防火墙
正如Asesh正确指出的,问题处于调试模式。但是添加键";is_debug=false";光有gn gen命令是不够的。最好的解决方案是添加";is_official_build=true";钥匙以下是描述:
is_official_build
Current value (from the default) = false
From //build/config/BUILDCONFIG.gn:136
Set to enable the official build level of optimization. This has nothing
to do with branding, but enables an additional level of optimization above
release (!is_debug). This might be better expressed as a tri-state
(debug, release, official) but for historical reasons there are two
separate flags.
IMPORTANT NOTE: (!is_debug) is *not* sufficient to get satisfying
performance. In particular, DCHECK()s are still enabled for release builds,
which can halve overall performance, and do increase memory usage. Always
set "is_official_build" to true for any build intended to ship to end-users.
感谢Asesh为我指明了正确的方向。