-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Dont load all GAP packages when resetting a workspace #37049
Dont load all GAP packages when resetting a workspace #37049
Conversation
This is currently done in gap_reset_workspace(), but I think it's less surprising to find the GAP initialization in the GAP initialization file. Here we add it to sage.gaprc so that it can later be removed from gap_reset_workspace().
This is currently done in gap_reset_workspace(), but I think it's less surprising to find the GAP initialization in the GAP initialization file. Here we add it to sage.g (for the pexpect interface) so that it can later be removed from gap_reset_workspace(). It has already been added to sage.gaprc (for the library interface) in an earlier commit.
Resetting the GAP workspace already initializes a new Gap instance and loads our default collection of packages. There's no need to load anything else in gap_reset_workspace(). The disabling of the color prompt is now handled in both sage.gaprc and sage.g (both GAP interfaces) so we remove that as well. Fixes: sagemathGH-31761
@antonio-rojas does this help your memory usage? |
Documentation preview for this PR (built with commit 9cbf569; changes) is ready! 🎉 |
Yes, the only remaining issue with all gap-packages installed (besides the Browse issue) is the test in |
We already load-test those as soon as we use GAP in any other doctest. Now that |
sagemathgh-37049: Dont load all GAP packages when resetting a workspace The `gap_reset_workspace()` function currently loops through all installed GAP packages (both by sage and on the system) and loads them before saving the new workspace. This is no longer necessary or desired: the two GAP initialization files already load a specific set of packages used in sage, and loading more can cause problems including wasted memory and unexpected changes of behavior. Moreover, the need for _users_ to load additional packages interactively has been documented. Fixes: - sagemath#31761 URL: sagemath#37049 Reported by: Michael Orlitzky Reviewer(s):
sagemathgh-37049: Dont load all GAP packages when resetting a workspace The `gap_reset_workspace()` function currently loops through all installed GAP packages (both by sage and on the system) and loads them before saving the new workspace. This is no longer necessary or desired: the two GAP initialization files already load a specific set of packages used in sage, and loading more can cause problems including wasted memory and unexpected changes of behavior. Moreover, the need for _users_ to load additional packages interactively has been documented. Fixes: - sagemath#31761 URL: sagemath#37049 Reported by: Michael Orlitzky Reviewer(s):
sagemathgh-37049: Dont load all GAP packages when resetting a workspace The `gap_reset_workspace()` function currently loops through all installed GAP packages (both by sage and on the system) and loads them before saving the new workspace. This is no longer necessary or desired: the two GAP initialization files already load a specific set of packages used in sage, and loading more can cause problems including wasted memory and unexpected changes of behavior. Moreover, the need for _users_ to load additional packages interactively has been documented. Fixes: - sagemath#31761 URL: sagemath#37049 Reported by: Michael Orlitzky Reviewer(s):
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
The
gap_reset_workspace()
function currently loops through all installed GAP packages (both by sage and on the system) and loads them before saving the new workspace. This is no longer necessary or desired: the two GAP initialization files already load a specific set of packages used in sage, and loading more can cause problems including wasted memory and unexpected changes of behavior. Moreover, the need for users to load additional packages interactively has been documented.Fixes: