ScottLogic / kdb-boothroyd

a prototype re-implementation of KDB Studio using JavaScript and Electron
Apache License 2.0
5 stars 2 forks source link

Optimize windows build #91

Closed gyorokpeter closed 2 years ago

gyorokpeter commented 2 years ago

Apparently this step takes ages:

  • building        target=nsis-web file=dist\nsis-web\Boothroyd Web Setup 1.4.0.exe archs=x64 oneClick=false perMachine=false

By looking at process manager, this spawns two 7za.exe processes that use maxed CPU and even that way this step takes about 5 minutes.

Just having a separate build command that doesn't include this would also work as I'm not going to use that installer anyway.

OiNutter commented 2 years ago

We're using https://github.com/electron-userland/electron-builder to compile the app for the various platforms so we don't have much control over how they're doing the build stuff. I haven't played around with the nsis-web installer to see if it's worth keeping yet but I wanted to try it out as a way of giving users another option for installs. If you want to build without it you should be able to run npm run dist -- -w nsis to just build the nsis installer.

As our builds are happening in an automated pipeline speeding them up isn't a huge priority for us at this point.

gyorokpeter commented 2 years ago

What if I don't want to build either, and just run out of the win-unpacked directory?

OiNutter commented 2 years ago

You could try passing one of the options listed here instead of nsis. I'd imagine dir might do what you want.

gyorokpeter commented 2 years ago

So the solution is:

setlocal
set PATH=D:\Utility\nodejs\v16.5.0;%PATH%
call npm install
call npm run pack

It is the pack option that skips generating the installers. However even with this change, the build took 3 min 45 sec when I measured it.