Legendary slowness on macOS precompiled binary
Platform
Operating system and version: macOS 14 | beta 2
Legendary version (legendary -V): 20.33, Undue Alarm
Expected Behavior
After typing a command into the terminal, the expected response should take milliseconds.
Current Behavior
legendary status --offline takes 6 seconds to return an output.
it's even longer when trying to launch a game (< 30s)
Steps to Reproduce
- use legendary on macos
Additional information
This issue is still present. On the pip-installed and compiled version of legendary, it's responsive as a cli should be. But on the universal macos legendary binary, it's much slower for some reason and takes a long time to return outputs for commands or even to just execute them to begin with.
This is largely due to PyInstaller just being not all that great for CLI apps (on Windows/Linux it does better, on macOS it's really slow for some reason). Perhaps using https://github.com/indygreg/PyOxidizer will help there, I plan to investigate that in the future.
Also worth noting that current macOS builds should not be universal, they are x86 only.
hmm what do you normally do to generate a pyinstaller binary of legendary? i might dig deeper becuase i want to integrate it into an epic launcher ui im making
macOS binaries are currently created on CI, see https://github.com/derrod/legendary/blob/master/.github/workflows/python.yml
k I did some further investigation and apparently it has something to do with pyinstaller's bootloader when "--onefile" is specified as a command.
It's slow because it has to unpack the libraries "just-in-time", instead of fully compiling it beforehand. using onedir rectifies the problem but makes portability a bit more of a challenge see https://stackoverflow.com/questions/9469932/app-created-with-pyinstaller-has-a-slow-startup
tldr: it's slow because it has to do an extra step before running
Any way to install legendary without this really slow startup time from "one file" mode? Edit: installing the python package via pip/pipx as shown in the README helps a LOT