forked from digraphs/Digraphs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: make memory usage more dynamic
This commit combines all the changes by @DanielPointon, with a few cleanups by me on top. The aim of this commit it to make the memory allocation more dynamic in the kernel extension of Digraphs for computing homomorphisms and cliques. Namely, instead of allocating memory for a bunch of fixed sized (512) arrays we only allocate the memory required to perform any requested computations, and we reuse that if possible for subsequent computations, and only allocate more memory if there isn't enough allocated previously. This commit also exposes two functions DIGRAPHS_FREE_* that can be used to release the allocated memory for computing homomorphisms or cliques. There might be a small performance penalty for these changes, for example, with these changes: gap> Test("~/digraphs/tst/extreme/cliques.tst"); Digraphs package: standard/cliques.tst msecs: 2848 true gap> Test("~/digraphs/tst/extreme/cliques.tst"); Digraphs package: standard/cliques.tst msecs: 2923 true gap> Test("~/digraphs/tst/extreme/grahom.tst"); Digraphs package: extreme/grahom.tst msecs: 65177 true gap> Test("~/digraphs/tst/extreme/grahom.tst"); Digraphs package: extreme/grahom.tst msecs: 65956 true and before: gap> Test("~/digraphs/tst/extreme/cliques.tst"); Digraphs package: standard/cliques.tst msecs: 2861 true gap> Test("~/digraphs/tst/extreme/cliques.tst"); Digraphs package: standard/cliques.tst msecs: 2928 true gap> Test("~/digraphs/tst/extreme/grahom.tst"); Digraphs package: extreme/grahom.tst msecs: 64881 true gap> Test("~/digraphs/tst/extreme/grahom.tst"); Digraphs package: extreme/grahom.tst msecs: 64997 true
- Loading branch information
1 parent
0760603
commit 4c8aa6d
Showing
23 changed files
with
915 additions
and
1,459 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
Oops, something went wrong.