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

mpm is quite slow on macOS (when used interactively) #114

Open
versionbayjc opened this issue Jul 26, 2024 · 0 comments
Open

mpm is quite slow on macOS (when used interactively) #114

versionbayjc opened this issue Jul 26, 2024 · 0 comments
Assignees
Labels
mpm MATLAB Package Manager related

Comments

@versionbayjc
Copy link

I believe macOS does some time consuming scanning of binaries when first running them, which makes using mpm interactively on macOS quite slow.

Running mpm a second time is just as slow as the first: on my Intel Core i7 Mac Mini (2018) it takes >40s to run mpm on macOS Sonoma (14.5), even to get the version number or the help text. I think this is because every time you run mpm, it will extract to a temp dir and then run it from there and then it removes its extracted self. And as such the XProtectService is rechecking the mpm application every time again. You could argue, there should be a more efficient way to this by macOS, but I also don't think it makes that much sense for a CLI to always extract itself and remove itself after every invocation.

❯ time ./mpm --version
MATLAB Package Manager 2024.2.1 (maci64)
./mpm --version  2.12s user 2.56s system 10% cpu 44.035 total
❯ time ./mpm --version
MATLAB Package Manager 2024.2.1 (maci64)
./mpm --version  2.10s user 2.43s system 10% cpu 42.043 total

If I copy the folder that mpm created in my temp dir (while XProtectService is scanning it) and run it from there, the second time is much faster:

❯ time ./mpmCOPY/bin/maci64/mpm --version
MATLAB Package Manager 2024.2.1 (maci64)
./mpmCOPY/bin/maci64/mpm --version  0.62s user 0.03s system 61% cpu 1.060 total

One idea I had, could mpm (also!) be distributed in a different way for macOS, such that the installation takes care of extraction and as such that only when first time running, it will be scanned?

My first thought would be to use homebrew for macOS, but maybe another package manager that is cross platform would also be useful for Windows and/or Linux?

It may sound a bit weird, to use a package manager to install another package manager, and it doesn't seem very useful in the case of CI pipelines, but for troubleshooting and interactive use cases, a 40s delay for a CLI is somewhat frustrating. And if mpm can be installed via another package manager, it can then also keep mpm up to date by checking all outdated packages installed by that package manager.

@michaelmcdonnellmw michaelmcdonnellmw added the mpm MATLAB Package Manager related label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mpm MATLAB Package Manager related
Projects
None yet
Development

No branches or pull requests

3 participants