Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 141647 - XPATH analysis engine too slow
Summary: XPATH analysis engine too slow
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Eugene Chan CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords:
: 155686 (view as bug list)
Depends on: 138213 154894
Blocks:
  Show dependency tree
 
Reported: 2006-05-12 18:39 EDT by Eric Labadie CLA
Modified: 2016-05-05 10:47 EDT (History)
6 users (show)

See Also:


Attachments
FastXPath engine patch (18.02 KB, text/plain)
2006-07-27 19:12 EDT, Alex Nan CLA
no flags Details
Apache access log (19.46 KB, application/octet-stream)
2006-08-23 17:01 EDT, Malcom Zung CLA
no flags Details
CBE file and symptom file used. (1.33 MB, application/zip)
2006-08-23 17:25 EDT, Eugene Chan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Labadie CLA 2006-05-12 18:39:38 EDT
Import the WAS symptom database and analyze a log file. 

157 events in the log
all four new symptom catalogs.
catalog1 : 1279 rules, catalog2: 1482 rules, catalog3: 200 rules, catalog4 : 7812 rules

~3 min 51 sec with xpath on my X40 thinkpad
 
This performance is not acceptable
Comment 1 Valentina Popescu CLA 2006-05-15 10:35:46 EDT
Marius, please take a look
Comment 2 Marius Slavescu CLA 2006-05-15 11:06:51 EDT
Moved to 4.2 i4, needs to be fixed in 4.2. 
I'll keep both this and bug 138213 for now.
Comment 3 Marius Slavescu CLA 2006-05-15 23:51:26 EDT
Marked as P1 for further investigation and approval.
Comment 4 Marius Slavescu CLA 2006-05-25 12:16:07 EDT
*** Bug 138213 has been marked as a duplicate of this bug. ***
Comment 5 Marius Slavescu CLA 2006-06-06 15:51:52 EDT
Moved to 4.2.1 as per discussion with Sri and Valentina.
Comment 6 Eric Labadie CLA 2006-06-21 16:52:44 EDT
See also defect TPTP Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=143454 
Comment 7 Alex Nan CLA 2006-07-27 19:11:13 EDT
Eugene attached find the patch for the fast XPath engine that adds support for caching compiled rules and loading them on demand from an indexed byte code cache.
Comment 8 Alex Nan CLA 2006-07-27 19:12:00 EDT
Created attachment 46917 [details]
FastXPath engine patch
Comment 9 Eugene Chan CLA 2006-07-27 19:41:22 EDT
Alex. Model side patch is committed, except for method selectNodesContext() and evalContext() which is not applicable to this bug.
Comment 10 Alex Nan CLA 2006-07-27 23:46:09 EDT
Fix checked in for the XPathCorrelationEngine.
Comment 11 Eugene Chan CLA 2006-07-31 10:40:43 EDT
Model and Correlation Engine code are updated and migrated to compile mode usage with file caching.

This is the latest performance measurement:
1999 CBE records, 11603 symptom definitions.
fresh workspace analysis all: deltaTime=556172ms
analysis all: deltaTime=284719ms
analysis all: deltaTime=281235ms
analysis 1 event: deltaTime=750ms
analysis 1 event: deltaTime=797ms
analysis 1 event: deltaTime=828ms
analysis all: deltaTime=288391ms
fresh workspace, analysis 1 event: deltaTime=14766ms
analysis 1 event: deltaTime=813ms
analysis 1 event: deltaTime=828ms

Bug 138213 Provide a builder for XPath is not yet addressed in this bug. I will close this bug and reopen 138213 post 4.2.1 target.
Comment 12 Malcom Zung CLA 2006-08-01 15:43:05 EDT
Thanks for fixing the problem.  This fix is urgently required for an IBM component.  We will pursue getting this fix into a TPTP 4.2.0.x patch via PMC approval and the normal channels.
Comment 13 Malcom Zung CLA 2006-08-23 17:00:27 EDT
Here is a scenario where TPTP 4.2.1 analysis is slower that TPTP 4.2.0.2:

1) Start eclipse with -Xmx500m
2) Import WAS SDB
3) Import Apache access log (attached)
4) Analyze all

TPTP 4.2.0.2: 100% complete in 96 seconds (on my machine)
TPTP 4.2.1: 35% complete in 96 seconds

This is a typical scenario user scenario since it uses an actual SDB from the FTP site.
Comment 14 Malcom Zung CLA 2006-08-23 17:01:12 EDT
Created attachment 48524 [details]
Apache access log
Comment 15 Eugene Chan CLA 2006-08-23 17:14:54 EDT
This is the performance data I collected between TPTP 4202+patch and TPTP421(0804) driver:

TPTP 4.2.0.2+patch, Fresh workspace, Analysis all 4 times and anslysis one event 3 times.
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=19177
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9634
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=8503
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=8933
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=120
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=140
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=161

TPTP 4.2.1, Fresh workspace. Analysis all 4 times and analysis one event 3 times.
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=18667
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9453
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=10125
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9203
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=120
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=150
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=180

TPTP 4.2.0.2+patch, Fresh workspace, Analysis one events 3 times and analysis all 4 times.
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=1181
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=81
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=80
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=11276
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9093
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9123
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9033

TPTP 4.2.1, Fresh workspace, Analysis one events 3 times and analysis all 4 times.
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=1382
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=80
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=50
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=12278
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9734
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=9543
!MESSAGE ExtendedAnalyze.run - org.eclipse.tptp.symptom.analysis.XPathAnalysisOperation: deltaTime=10626
Comment 16 Eric Labadie CLA 2006-08-23 17:19:30 EDT
This fix now introduces the following problem as described in TPTP defect 154894
Comment 17 Eugene Chan CLA 2006-08-23 17:25:13 EDT
Created attachment 48529 [details]
CBE file and symptom file used.
Comment 18 Eugene Chan CLA 2006-08-23 17:27:18 EDT
Malcom, I run my test on JVM 1.4.2
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cndev-20040511 (JIT enabled: jitc))
Comment 19 Eugene Chan CLA 2006-08-23 18:10:55 EDT
Eric, the same problem exists in both TPTP4202 and TPTP421 with IBM JVM1.5. Hence,  bug 154894 is not introduced by the fix here.
 
Comment 20 Malcom Zung CLA 2006-08-24 09:19:54 EDT
The slowdown I am seeing with the WAS SDB is with IBM JVM 1.5.
Comment 21 Eugene Chan CLA 2006-08-30 10:20:05 EDT
*** Bug 155686 has been marked as a duplicate of this bug. ***
Comment 22 Eugene Chan CLA 2006-08-30 10:20:59 EDT
From bug 155686

From Abdi Salahshour

It appear that there are 2 identical methods in TPTP XpathCorrelationEngine, 
i.e., processCBECommonBaseEvents and processCommonBaseEvents with 2 different 
signature type for event -first one CBECommonBaseEvent event  and second 
methods has it as CommonBaseEvent event .   In JD we use  
processCommonBaseEvents and we now how to create events of type 
CommonBaseEvent and we do not understand what CBECommonBaseEvent type is?  

So, why are there 2 identical methods with 2 different signature and why not 
the optimization code implemented in both?   This looks like too late in the 
cycle to make consumer make this kind of changes to take advantage of a 
performance bug in the original code.   

We need this same fix in processCommonBaseEvents api too for JD to gain the
same performance.
Comment 23 Alex Nan CLA 2006-08-30 19:16:46 EDT
Optimization code added to CBE producer handler.
Comment 24 Eugene Chan CLA 2006-08-31 00:11:56 EDT
close bug
Comment 25 Paul Slauenwhite CLA 2009-06-30 13:46:59 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 this enhancement/defect has been resolved and unverified for more than 1 year 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.
Comment 26 Paul Slauenwhite CLA 2009-06-30 13:54:56 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 this enhancement/defect has been resolved and unverified for more than 1 year 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.