Terms are constructed dynamically, even when they are are constant at compile time. Constant term caching is a transformation that lifts out constant terms and constructs them once at program initialization time.

Advantages

  • repeated construction of the same term becomes O(1)

Drawbacks

  • constant terms that would never be constructed dynamically are now constructed
  • the order of term construction changes, this may affect strategies such as new
  • constant terms can no longer be garbage collected

Lifting may done by nested function calls during initialization or by storing the constant term in a string (either in textual or BinaryATermFormat?) and reading that in at run-time.

-- EelcoVisser - 09 Dec 2001

Implemented in StrategoRelease07. Performance effects should be evaluated.

-- EelcoVisser - 16 Jan 2002


CategoryDone? | ToDo | StrategoOptimization

Revision: r1.2 - 15 Jan 2002 - 23:36 - EelcoVisser
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback