-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #27680: MR11: Lazy initialization of libgap
E. Madison Bray ([https://gitlab.com/embray @embray]) opened a merge request at https://gitlab.com/sagemath/sage/merge_requests/11: ---- {{{ #!markdown Previously the `Gap` class that implements the (effectively singleton) `libgap` instance variable in `sage.libs.gap.libgap` called `initialize()` (the function which initializes libgap for the process) in its `__init__` method. Because of this, it was impossible to import it without causing libgap to be initialized, creating slowdown during Sage initialization. The tradeoff is that most code in Sage that uses the libgap interface has to awkwardly use inline imports of `from sage.libs.gap.libgap import libgap` all over the place. I would like to do away with that, especially for work on [#18267](https://trac.sagemath.org/ticket/18267). This removes `initialize()` from `Gap.__init__()` and instead carefully places calls to `initialize()` just in the few places where it's absolutely crucial to ensure libgap is initialized first (specifically in code paths that users and developers are actually intended to use directly; it is not added directly to every single function that uses GAP objects). This sacrifices some simplicity in implementation of the libgap interface for simplicity in using it, which I think is crucial for updating more code in Sage to use it over the pexpect interface. }}} URL: https://trac.sagemath.org/27680 Reported by: galois Ticket author(s): Erik Bray Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
3 changed files
with
8 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters