GAM-team / GAM

command line management for Google Workspace
https://github.com/GAM-team/GAM/wiki
Apache License 2.0
3.54k stars 473 forks source link

Use PyInstaller "One Directory" builds #1701

Closed jay0lee closed 1 month ago

jay0lee commented 1 month ago

PyInstaller supports two modes of operation:

GAM has used one file as far back as my memory serves because it's cleaner and easier to package but it comes at a big performance cost. On execution, "one file" builds need to decompress their Python libraries and text files to a temporary directory on the filesystem and run from there. This causes a significant delay when GAM is executad before GAM actually starts doing any real work. On a 2021 Macbook Pro (M1 CPU, 64gb RAM, 1tb SSD) one file takes about 7 seconds to run "gam version", "one directory" takes less than half a second to run the same command. That's an order of magnitude difference. Further, the extraction to a temp directory has caused various issues in the past. Some restrictive Linux systems don't let users write to their $TEMPDIR. As broken as that is they tend to first notice the behavior with GAM one file.

So yes, let's switch to one directory. A few notes:

GAM 7.00.03 pre-release will be first to use one directory on MacOS only. Future releases will implement it for Linux and (ugh, MSI) Windows.

jay0lee commented 1 month ago

Marking this as done now that Windows uses onedir and MSI successfully packages it (ugh, that was messy).

GAM 7.00.13 will be the first release where Windows uses onedir.