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

Cleanup osp_Toolbox_Check #749

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

alexcraven
Copy link
Contributor

osp_Toolbox_Check would indiscriminately attempt to enable every addon available on the system, incurring substantial delay in certain cases. This patch selectively enables only the necessary ones.

On a test system (Linux, Matlab 2023b, >100 addons available) the osp_Toolbox_Check added about 10 seconds of startup time to every module which called it. This was mostly due to the loop at the top which blindly calls matlab.addons.enableAddon for every available addon (including un-needed addons, already enabled addons, and perhaps addons which have been deliberately disabled for a reason), every time the toolbox check is initiated.

Even so, it was unlikely to actually succeed in enabling the required addons on older releases, since enableAddon operates on the addon identifier rather than name (newer releases can accept either, perhaps unless there are multiple versions)

This patch:

  • Selectively enables only those addons which are indicated as "needed" by the modle and which are not already enabled, and
  • Maps the module name to the unique identifier to do so, thereby successfully enabling the addons even on older matlab releases

Tested R2023b and R2019a.

osp_Toolbox_Check would indiscriminately attempt to enable every toolbox available on the system. This patch selectively enables only the necessary ones.
@HJZollner HJZollner merged commit 5e4d4c0 into schorschinho:develop Jul 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants