Subject: Re: Re: Will Saxon 9 optimize or cache this so performance doesn't degrade?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 06 Feb 2013 08:19:29 +0000
|
On 06/02/2013 08:09, Andrew Welch wrote:
What's a memo function?
A function that will always return the same result for the same set of
arguments.
eg if you had a function that added 1 to a number, you can make it a
memo function so the 2nd time it gets called with the same number, it
will return the known previous result from a map, rather than compute
it again.
More specifically a deterministic or pure function is one that will
always return the same result for the same set of arguments. A memo
function is one that takes advantage of this property by caching the
result of previous evaluations. You can declare a function as a memo
function in Saxon using the attribute saxon:memo-function="yes".
Michael Kay
Saxonica
|