I have put together a set of queries, the output, and corresponding xml. The files are attached. These queries were performed using BaseX 8.5.2 on JBoss 6.4.9, and Java 8.102.
I appreciate your support.
Carl R Bondeson IT Analyst 3 Information Technology Connecticut Department of Public Health 410 Capitol Ave Hartford, CT 06134 Phone: 860-509-7434 carl.bondeson@ct.govmailto:carl.bondeson@ct.gov [logosmall]
From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Friday, July 29, 2016 5:07 AM To: Bondeson, Carl Carl.Bondeson@ct.gov; Luiz Matos luizmatos@ic.uff.br Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] BaseX performance 7.x vs 8.x
Hi Carl, hi Luiz,
With every version of BaseX, we are adding new query optimizations (usually, this can be experienced if you run newer code with older version of BaseX). Existing optimization should of course be preserved. To be able to understand why your queries run slower than before, I would be more than glad if you could both provide me with little examples that we can try by ourselves. The Query Info output for both versions of BaseX would be helpful as well; it indicates which optimizations are performed or not.
Thanks in advance Christian
On Thu, Jul 28, 2016 at 8:36 PM, Bondeson, Carl <Carl.Bondeson@ct.govmailto:Carl.Bondeson@ct.gov> wrote: As a follow up for performance a few queries are listed with execution times
declare option output:item-separator "
"; for $h in //ValidationDictionary/Validation let $g := $h/Parent[@Element='PatientDefinition'] let $i := $g/Child[@Element='PartyDefinition'] let $j := $i/Item[@Attribute='Gender'] for $k in $j/@Type where $h/ProductCode='ZIKA' return <BaseXValidation Parent='{$g/@Element}' Child='{$i/@Element}' Action='{$k/../@Action}' Attribute='{$k/../@Attribute}' DataType='{$k/..//@DataType}' Effect='{$k/../@Effect}' Name='{$k/../@Name}' Type='{$k}' LogEvent='{$k/../@LogEvent}' Extra1='{$k/../@Extra1}' Extra2='{$k/../@Extra2}' Extra3='{$k/../@Extra3}'/> Version: 7.9 execution time: 3.82 ms Version: 8.5.1 execution time: 138.8 ms
declare option output:item-separator "
"; for $h in //ValidationDictionary/Validation let $g := $h/Parent[@Element='PatientDefinition'] let $i := $g/Child[@Element='PartyDefinition'] let $j := $i/Item[@Attribute='FirstName'] for $k in $j/@Type where $h/ProductCode='ZIKA' return <BaseXValidation Parent='{$g/@Element}' Child='{$i/@Element}' Action='{$k/../@Action}' Attribute='{$k/../@Attribute}' DataType='{$k/..//@DataType}' Effect='{$k/../@Effect}' Name='{$k/../@Name}' Type='{$k}' LogEvent='{$k/../@LogEvent}' Extra1='{$k/../@Extra1}' Extra2='{$k/../@Extra2}' Extra3='{$k/../@Extra3}'/> Version: 7.9 execution time: 3.3 ms Version: 8.5.1 execution time: 133.8 ms
Query:declare option output:item-separator "
";for $g in //ValidationDictionary//Validation let $h := $g//Parent[@Element='PatientDefinition']let $i := $h//Child[@Element='PartyDefinition'] where $g//ProductCode='ZIKA' return <BaseXValidation Parent='{$h/@Element}' Child='{$i/@Element}'/> Version: 7.9 execution time: 2.2 ms Version: 8.5.1 execution time: 156.1 ms
These queries are called from an XSLT transformer via all callout and are performed in very type loops. I was wondering why the transforms were never completing. 40-70x decrease in performance would slow any process down.
Carl R Bondeson IT Analyst 3 Information Technology Connecticut Department of Public Health 410 Capitol Ave Hartford, CT 06134 Phone: 860-509-7434 carl.bondeson@ct.govmailto:carl.bondeson@ct.gov [logosmall]
From: basex-talk-bounces@mailman.uni-konstanz.demailto:basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.demailto:basex-talk-bounces@mailman.uni-konstanz.de] On Behalf Of Bondeson, Carl Sent: Thursday, July 28, 2016 1:36 PM To: basex-talk@mailman.uni-konstanz.demailto:basex-talk@mailman.uni-konstanz.de Subject: [basex-talk] BaseX performance 7.x vs 8.x
I am seeing huge differences in the performance of a multi-threaded JBoss application recently upgraded from 7.9 to 8.4. The problem is that 8.4 is much slower than 7.9. Any ideas? Do I need to add indices or something along those lines?
Carl R Bondeson IT Analyst 3 Information Technology Connecticut Department of Public Health 410 Capitol Ave Hartford, CT 06134 Phone: 860-509-7434 carl.bondeson@ct.govmailto:carl.bondeson@ct.gov [logosmall]