Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legendary slowness on macOS precompiled binary #581

Open
blackxfiied opened this issue Jul 12, 2023 · 7 comments
Open

Legendary slowness on macOS precompiled binary #581

blackxfiied opened this issue Jul 12, 2023 · 7 comments

Comments

@blackxfiied
Copy link

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

  1. use legendary on macos

Additional information

@blackxfiied
Copy link
Author

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.

@blackxfiied blackxfiied changed the title Legendary commands take < 5 seconds to return an output. Legendary slowness on macOS precompiled binary Sep 19, 2023
@derrod
Copy link
Owner

derrod commented Sep 19, 2023

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.

@blackxfiied
Copy link
Author

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

@derrod
Copy link
Owner

derrod commented Sep 21, 2023

macOS binaries are currently created on CI, see https://github.com/derrod/legendary/blob/master/.github/workflows/python.yml

@blackxfiied
Copy link
Author

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

@blackxfiied
Copy link
Author

tldr: it's slow because it has to do an extra step before running

@kotx
Copy link

kotx commented May 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants