[jira] [Comment Edited] (JXPATH-183) XMLGregorianCalendar existence adding a lot of performance penalty

2015-11-28 Thread Michele Vivoda (JIRA)

[ 
https://issues.apache.org/jira/browse/JXPATH-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15030710#comment-15030710
 ] 

Michele Vivoda edited comment on JXPATH-183 at 11/28/15 11:59 PM:
--

Registering the class as atomic value should be the solution of this issue, the 
trick is that one must not register the abstract super class but the 
implementation class:

{noformat}
try {
JXPathIntrospector.registerAtomicClass(

DatatypeFactory.newInstance().newXMLGregorianCalendar("2010-02-02").getClass());
} catch (DatatypeConfigurationException e) {
e.printStackTrace();
// ignore, no datatype lib
}
{noformat}

Maybe this should be done in the constructor of {{JXPathIntrospector}} and 
probably also for {{GregorianCalendar}}. I noticed also that, after registering 
a class as atomic is still possible to access the properties using a "direct" 
xpath, for example given a calendar {{cal}} the timezone is {{cal/timeZone}}, 
looks like that the difference is only in that the properties are not iterable, 
for example when using {{cal//*}}


was (Author: vivodamich...@hotmail.com):
Registering the class as atomic value should be the solution of this issue, the 
trick is that one must not register the abstract super class but the 
implementation class:

{noformat}
try {
JXPathIntrospector.registerAtomicClass(

DatatypeFactory.newInstance().newXMLGregorianCalendar("2010-02-02").getClass());
} catch (DatatypeConfigurationException e) {
e.printStackTrace();
// ignore, no datatype lib
}
{noformat}

Maybe this should be done in the constructor of {{JXPathIntrospector}} and 
probably also for {{GregorianCalendar}}. I noticed also that, after registering 
a class as atomic is still possible to access the properties using a "direct" 
xpath, for example calendar timezone {{cal/timeZone}}, looks like that the 
difference is only in that the properties are not iterable, for example when 
using {{cal//*}}

> XMLGregorianCalendar existence adding a lot of performance penalty
> --
>
> Key: JXPATH-183
> URL: https://issues.apache.org/jira/browse/JXPATH-183
> Project: Commons JXPath
>  Issue Type: Improvement
>Affects Versions: 1.3
> Environment: Windows 7, Amazon Unix, Weblogic
>Reporter: Ganna Shmatova
>  Labels: performance
> Attachments: JXPath183Test.java
>
>
> We're using JXPath to parse some input from a client. When they give us a 
> valid date it gets transformed from a SOAP message into Java objects. When 
> this happens JXPath queries suddenly take 1-8 seconds more (depending on 
> system -- the optimized system it's 1 second, dev & test machines it's 8).
> Kicker is, we don't even look for this field. Just its existence does it.
> (we've quickfixed to omit the xml tags before the string is parsed into Java 
> for now)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (JXPATH-183) XMLGregorianCalendar existence adding a lot of performance penalty

2015-11-27 Thread Michele Vivoda (JIRA)

[ 
https://issues.apache.org/jira/browse/JXPATH-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15029885#comment-15029885
 ] 

Michele Vivoda edited comment on JXPATH-183 at 11/27/15 1:58 PM:
-

I attach a test case that more or less shows the issue

What shows the test is that {{//*}} traverses also the properties of Calendar 
*(124 values) and XMLGregorianCalendar (18 values), I thought that registering 
them as Atomic would have changed this, since they are not present in the list 
of atomic classes of {{JXPathIntrospector}} but this is not the case. A Long is 
not traversed, but this probably happens only because it has no properties 
starting with {{getXXX}} 


was (Author: vivodamich...@hotmail.com):
I attach a test case that shows the issue

> XMLGregorianCalendar existence adding a lot of performance penalty
> --
>
> Key: JXPATH-183
> URL: https://issues.apache.org/jira/browse/JXPATH-183
> Project: Commons JXPath
>  Issue Type: Improvement
>Affects Versions: 1.3
> Environment: Windows 7, Amazon Unix, Weblogic
>Reporter: Ganna Shmatova
>  Labels: performance
> Attachments: JXPath183Test.java
>
>
> We're using JXPath to parse some input from a client. When they give us a 
> valid date it gets transformed from a SOAP message into Java objects. When 
> this happens JXPath queries suddenly take 1-8 seconds more (depending on 
> system -- the optimized system it's 1 second, dev & test machines it's 8).
> Kicker is, we don't even look for this field. Just its existence does it.
> (we've quickfixed to omit the xml tags before the string is parsed into Java 
> for now)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)