[edk2-devel] [PATCH] OvmfPkg: enable multiprocessor builds when using build.sh
Jordan Justen
jordan.l.justen at intel.com
Mon Jul 22 07:11:12 UTC 2019
Maybe a commit message tweak would be:
OvmfPkg/build.sh: enable multithreaded build by default
On 2019-07-21 17:58:16, Rebecca Cran wrote:
> When building both BaseTools and OvmfPkg, enable multiprocessor builds,
> using up to the number of cores available in the system. This can
> drastically reduce build times.
> For example, on a modern ThreadRipper system the
> time required to build decreases from 3 minutes to 1 minute.
>
> Signed-off-by: Rebecca Cran <rebecca at bsdio.com>
> ---
> OvmfPkg/build.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
> index 4fcbdd2bc9..5d3a672bd2 100755
> --- a/OvmfPkg/build.sh
> +++ b/OvmfPkg/build.sh
> @@ -40,7 +40,7 @@ ARCH_X64=no
> BUILDTARGET=DEBUG
> BUILD_OPTIONS=
> PLATFORMFILE=
> -THREADNUMBER=1
> +THREADNUMBER=$(getconf _NPROCESSORS_ONLN)
Based on OvmfPkg/build.sh --help, I think initializing THREADNUMBER to
0 might have the same effect, but not depend on getconf. Does that
work?
I'm not sure why I defaulted this to single threaded build way back in
578630802e.
It looks like if we tweaked things more, and omitted adding the -n
parameter to the build command by default, then it would use the
Conf/target.txt value, which by default appears to also be 0, so this
could accomplish the same thing, but also let a user set it in
target.txt.
-Jordan
> LAST_ARG=
> RUN_QEMU=no
> ENABLE_FLASH=no
> --
> 2.22.0
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#44098): https://edk2.groups.io/g/devel/message/44098
Mute This Topic: https://groups.io/mt/32553200/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list