xsl-list
[Top] [All Lists]

RE: [xsl] current-dateTime()

2008-04-19 00:37:55
Using this simple principle of dependency (causual) ordering, 
one can write code that is guaranteed to be evaluated in a 
certain sequential manner.

While it's true that causes always precede their effects, I think it's very
hard to take advantage of this fact in a way that is totally resilient to
processor optimizations. For example if $x depends on $y then it's true that
you can't finish evaluating $x until you have finished evaluating $y; but
there is no guarantee that $y will only be evaluated once; the process might
decide that to save memory, it should evaluate $y every time it is
referenced; and there is no guarantee that the processor won't start
evaluating $x before it has finished evaluating $y.

Even with extension functions written in Java, processors have all sorts of
tricks they could play if they wanted, such as analyzing the bytecode of the
extension function to see what use it makes of its arguments, or rewriting
the bytecode to do lazy evaluation of the arguments. In a processor that did
JIT compilation of XSLT to Java bytecode, I think such effects might well
happen.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>