Commit Graph

4 Commits (252c4083779a488c86e74362b4f3bb4bf927cc67)

Author SHA1 Message Date
Ludovic Courtès 252c408377
memoization: Add profiling support.
* guix/memoization.scm (%memoization-tables): New variable.
(%make-hash-table*, show-memoization-tables): New procedures.
(make-hash-table*): New macro.
Add top-level call to 'register-profiling-hook!'.
(memoize): Adjust to pass the resulting procedure to
'make-hash-table*'.
(%mlambda): Likewise.
2017-12-12 18:11:22 +01:00
Ludovic Courtès e3c83a7cd3
memoization: (mlambda () ...) allows for inner 'define'.
Previously (mlambda () (define foo 2) bar) would trigger a syntax error.

* guix/memoization.scm (%mlambda): In the zero-argument case, move
BODY... to a lambda to allow for inner 'define' and such.
2017-09-03 23:36:17 +02:00
Ludovic Courtès 146db52a18
memoization: Micro-optimize code produced by 'define-cache-procedure'.
* guix/memoization.scm (%nothing): Remove.
(define-cache-procedure): Make '%nothing' a local variable, with a
literal list.
2017-03-16 22:50:15 +01:00
Ludovic Courtès f9704f179a
Add (guix memoization).
* guix/combinators.scm (memoize): Remove.
* guix/memoization.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm, gnu/packages/bootstrap.scm,
guix/build-system/gnu.scm, guix/build-system/python.scm,
guix/derivations.scm, guix/gnu-maintenance.scm,
guix/import/cran.scm, guix/import/elpa.scm,
guix/modules.scm, guix/scripts/build.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/store.scm, guix/utils.scm: Adjust imports accordingly.
2017-01-28 18:55:20 +01:00