Project

Profile

Help

Bug #645

closed

Performance bug in MemoClosure

Added by Anonymous over 18 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Performance
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-1252878
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

SourceForge user: mhkay

This performance bug was reported in

https://sourceforge.net/forum/message.php?msg_id=3280657

It turns out to be a problem that was present in the

code in Saxon 8.4, but had never been noticed - it

didn't affect this particular query because of slight

(and essentially irrelevant) differences in the query

execution plan.

The MemoClosure class is supposed to delay evaluation

of an expression, and then remember the value when it

is eventually evaluated, so that it never needs to be

computed more than once. However, there is one method

in MemoClosure, materialize(), which in certain states

evaluates the expression without remembering the value,

so that it is re-evaluated on each call.

It's not possible to describe in source query terms

what conditions are likely to trigger this problem. In

manycases it's likely that the effect on performance

will not even be noticeable.

Attached is a replacement version of the

net.sf.saxon.value.MemoClosure.java module that fixes

the problem. For use only with Saxon 8.5.


Files

MemoClosure.java (9.56 KB) MemoClosure.java Anonymous, 2005-08-05 23:27

No data to display

Please register to edit this issue

Also available in: Atom PDF