Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 143454

Summary: Time taken to process CBE takes more time with TPTP Fast xpath engine
Product: z_Archived Reporter: Peter Kim <petekim>
Component: TPTPAssignee: jkubasta
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ajay_garga, apnan, rohit.shetty, sluiman
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460
Attachments:
Description Flags
XPath Filters
none
Sample CBE log none

Description Peter Kim CLA 2006-05-24 09:55:28 EDT
Hardware Environment:
CPU 2.8 Ghz
2GB RAM

Software Environment:
OS : Windows XP SP2
JRE : IBM JDK1.4.2

Build:

TPTP Build ID : TPTP-4.2.0-200605220100
jar file: fastxpath.jar
URL: http://download.torolab.ibm.com/cgi-bin/TPTP/4.2.0/generate-downloads.sh

LTA-JD Build : LTAJD-4.2.0-200605232327
jar file: fastxpath.jar,emffxp.jar
URL: http://download.torolab.ibm.com/cgi-bin/LTAJD/4.2.0/generate-downloads.sh

The fast xpath engine from TPTP-4.2.0-200605220100 process CBEs against XPath
filter three times slower compared to fast xpath engine from IIOSB-20050321-1(IBM)).


------- Additional Comment #1 From Ajay G. Rengasayee 2006-05-24 05:47 EST -------

Code to create an instance and use the FastXPathAPI from TPTP for XPath filter:

import java.io.File;

import org.eclipse.hyades.logging.events.cbe.CommonBaseEvent;
import org.eclipse.tptp.platform.provisional.fastxpath.FastXPathAPI;

public class FastXPathEngine implements XPathEngine {
	
    private static final String EXPRESSION_FILENAME = "expressions.fxp";
    FastXPathAPI api;

    public FastXPathEngine() throws InstantiationException {
        api = new FastXPathAPI(null);
        try {
            api.loadCompiledExpressions(new File(EXPRESSION_FILENAME));
        } catch (Exception e) {
        } 
    }

    public boolean matches(CommonBaseEvent cbe, String xpathExpr) {
        try {
            return api.match(cbe, xpathExpr);
        } catch (Exception e) {
            return false;
        }
    }
}
 --------------------------------------------------------------------------------

Code to create an instance and use the FastXPathAPI from IIOSB for XPath filter:
import java.io.File;

import org.eclipse.hyades.logging.events.cbe.CommonBaseEvent;
import com.ibm.xml.fastxpath.FastXPathAPI;

public class FastXPathEngine implements XPathEngine {
	
    private static final String EXPRESSION_FILENAME = "expressions.fxp";
    FastXPathAPI api;

    public FastXPathEngine() throws InstantiationException {
        api = new FastXPathAPI();
        try {
            api.loadCompiledExpressions(new File(EXPRESSION_FILENAME));
        } catch (Exception e) {
        } 
    }

    public boolean matches(CommonBaseEvent cbe, String xpathExpr) {
        try {
            return api.match(cbe, xpathExpr);
        } catch (Exception e) {
            return false;
        }
    }
}


------- Additional Comment #2 From Ajay G. Rengasayee 2006-05-24 07:23 EST -------

Created an attachment (id=1342)
Sample CBE log 

When this log is imported into LTAJD and highlighters(XPath filters) run on
them, 
it takes the time as folows:

1. 1733 microseconds with FastXPath from IIOSB
2. 2413 microseconds with FastXPath from TPTP.

The gap is much with Windows System events log. In that case, the gap is more
than 3 times.


------- Additional Comment #3 From Ajay G. Rengasayee 2006-05-24 07:24 EST -------

Created an attachment (id=1343)
XPath Filters
Comment 1 Peter Kim CLA 2006-05-24 09:55:56 EDT
Created attachment 42395 [details]
XPath Filters
Comment 2 Peter Kim CLA 2006-05-24 09:56:23 EDT
AC Bugzila: 9093
Comment 3 Peter Kim CLA 2006-05-24 09:56:44 EDT
Created attachment 42396 [details]
Sample CBE log
Comment 4 Steve Gutz CLA 2006-05-24 10:00:41 EDT
I think this is assigned to the wrong component - reassigning
Comment 5 Dave Smith CLA 2006-05-24 17:00:10 EDT
Marius, I believe this one is for you.  Is it a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=141647
Comment 6 Ajay Garga Rengasayee CLA 2006-05-25 10:08:27 EDT
Please raise the severity to "Critical" and also the target milestone to 4.2i4 as the similar defect(duplicate) 141647 has target as 4.2i4.

Comment 7 Marius Slavescu CLA 2006-06-02 10:02:52 EDT
After an initial investigation the differenc is much smaller (the IBM original impl is around 1.15 times faster). I'll attach the testcase that I've been using.

There were several problems that I fixed this week regarding the compiled mode (basically most of the rules from your example were not compiled (so you've been measuring the eval method), they will be in by Monday.

I will leave this defect open for further investigation in 4.3, no need to increase the severity as the performance difference is very small, and you need to take in consideration other changes the I put in regarding support for IBM and SUN 1.5 JREs (the original IBM code didn't support them).

Comment 8 Eric Labadie CLA 2006-06-21 16:56:11 EDT
We need this for 4.2.1
Comment 9 Valentina Popescu CLA 2006-07-11 13:35:49 EDT
Normal severity; moving to 4.3
Comment 10 Eugene Chan CLA 2006-10-19 17:51:08 EDT
mass update:
retarget from 4.3 to 4.4. Cannot be contained in 4.3 due to resource limtation.
Comment 11 Harm Sluiman CLA 2008-01-02 15:42:42 EST
Alex, please assess if this defect is required.
Comment 12 Paul Slauenwhite CLA 2008-07-16 11:57:24 EDT
Reassigning to new component lead.
Comment 13 Harm Sluiman CLA 2008-07-16 13:10:46 EDT
this part of TPTP is no longer being enhanced/supported
Comment 14 Paul Slauenwhite CLA 2009-06-30 10:26:26 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.