[ http://nagoya.apache.org/jira/browse/XALANJ-1443?page=history ]

Henry Zongaro updated XALANJ-1443:
----------------------------------

      Assign To:     (was: Xalan Developers Mailing List)
           type: Improvement  (was: Bug)
    Description: 
Idea: 
Replace expressions in the form of "position() X last()" to the call of 
internal optimized function FuncIsLast. This approach improves performance of 
such queries and allows to obtain correct results for streaming documents such 
as org.apache.xalan.lib.sql.SQLDocument. All these benefits come in expense of 
caching just one node per "position() X last()" predicate in the nodeset.

Changes:
All changes are groupped into three attachments: "cvs diff" with current CVS 
revision and two new files: FuncIsLast amd DTMIteratorIsLast.

Basic Changes:
1. New interface org.apache.xml.dtm.DTMIteratorIsLast is intended to work with 
DTMIterator and responsible for this optimization. It just defines one method: 
isLastPos. 

2. extended interface org.apache.xpath.axes.SubContextList to include similar 
method isLastPos.

3. added internal function org.apache.xpath.functions.FuncIsLast. This function 
is created as the result of optimization. It uses DTMIteratorIsLast.isLastPos 
and SubContextList.isLastPos methods if available, otherwise, it 
performs "position() = last()".

3. Class org.apache.xpath.compiler.Compiler: added code for optimization of 
expressions "position() X last()", where X is '=', '!=', '>', '<', '>=', '<='. 
Const OPTIMIZE_IS_LAST switches this optimization on/off.

5. Classes in the org.apache.xpath.axes package: implemented next-node-prefetch 
system for is-last optimization.

Testing:
Obtained code has been tested against existing conf-gold tests. No problems 
have been discovered. Results of testing will be posted as an additional 
attachement.

Peformance:
Performance testing was executed. Results will be posted as an additional 
comments.

  was:
Idea: 
Replace expressions in the form of "position() X last()" to the call of 
internal optimized function FuncIsLast. This approach improves performance of 
such queries and allows to obtain correct results for streaming documents such 
as org.apache.xalan.lib.sql.SQLDocument. All these benefits come in expense of 
caching just one node per "position() X last()" predicate in the nodeset.

Changes:
All changes are groupped into three attachments: "cvs diff" with current CVS 
revision and two new files: FuncIsLast amd DTMIteratorIsLast.

Basic Changes:
1. New interface org.apache.xml.dtm.DTMIteratorIsLast is intended to work with 
DTMIterator and responsible for this optimization. It just defines one method: 
isLastPos. 

2. extended interface org.apache.xpath.axes.SubContextList to include similar 
method isLastPos.

3. added internal function org.apache.xpath.functions.FuncIsLast. This function 
is created as the result of optimization. It uses DTMIteratorIsLast.isLastPos 
and SubContextList.isLastPos methods if available, otherwise, it 
performs "position() = last()".

3. Class org.apache.xpath.compiler.Compiler: added code for optimization of 
expressions "position() X last()", where X is '=', '!=', '>', '<', '>=', '<='. 
Const OPTIMIZE_IS_LAST switches this optimization on/off.

5. Classes in the org.apache.xpath.axes package: implemented next-node-prefetch 
system for is-last optimization.

Testing:
Obtained code has been tested against existing conf-gold tests. No problems 
have been discovered. Results of testing will be posted as an additional 
attachement.

Peformance:
Performance testing was executed. Results will be posted as an additional 
comments.

    Environment: 
Operating System: Other
Platform: Other

  was:
Operating System: Other
Platform: Other

       Priority: Major
    Bugzilla Id:   (was: 17941)

> position() = last() optimization
> --------------------------------
>
>          Key: XALANJ-1443
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1443
>      Project: XalanJ2
>         Type: Improvement
>   Components: XPath
>     Versions: CurrentCVS
>  Environment: Operating System: Other
> Platform: Other
>     Reporter: Dimitry E Voytenko
>  Attachments: diff.txt, islast-test-20030305.zip, 
> org.apache.xml.dtm.DTMIteratorIsLast.java, 
> org.apache.xpath.functions.FuncIsLast.java
>
> Idea: 
> Replace expressions in the form of "position() X last()" to the call of 
> internal optimized function FuncIsLast. This approach improves performance of 
> such queries and allows to obtain correct results for streaming documents 
> such 
> as org.apache.xalan.lib.sql.SQLDocument. All these benefits come in expense 
> of 
> caching just one node per "position() X last()" predicate in the nodeset.
> Changes:
> All changes are groupped into three attachments: "cvs diff" with current CVS 
> revision and two new files: FuncIsLast amd DTMIteratorIsLast.
> Basic Changes:
> 1. New interface org.apache.xml.dtm.DTMIteratorIsLast is intended to work 
> with 
> DTMIterator and responsible for this optimization. It just defines one 
> method: 
> isLastPos. 
> 2. extended interface org.apache.xpath.axes.SubContextList to include similar 
> method isLastPos.
> 3. added internal function org.apache.xpath.functions.FuncIsLast. This 
> function 
> is created as the result of optimization. It uses DTMIteratorIsLast.isLastPos 
> and SubContextList.isLastPos methods if available, otherwise, it 
> performs "position() = last()".
> 3. Class org.apache.xpath.compiler.Compiler: added code for optimization of 
> expressions "position() X last()", where X is '=', '!=', '>', '<', '>=', 
> '<='. 
> Const OPTIMIZE_IS_LAST switches this optimization on/off.
> 5. Classes in the org.apache.xpath.axes package: implemented 
> next-node-prefetch 
> system for is-last optimization.
> Testing:
> Obtained code has been tested against existing conf-gold tests. No problems 
> have been discovered. Results of testing will be posted as an additional 
> attachement.
> Peformance:
> Performance testing was executed. Results will be posted as an additional 
> comments.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to