[jira] Commented: (XMLBEANS-389) List accessors generated with -javasource=1.5 produce lists that scale poorly with the size of the list

2009-01-15 Thread Radu Preotiuc-Pietro (JIRA)

[ 
https://issues.apache.org/jira/browse/XMLBEANS-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12664307#action_12664307
 ] 

Radu Preotiuc-Pietro commented on XMLBEANS-389:
---

Do you have a particular place in mind where this documentation would fit, or 
is it generic FAQ?


 List accessors generated with -javasource=1.5 produce lists that scale poorly 
 with the size of the list
 ---

 Key: XMLBEANS-389
 URL: https://issues.apache.org/jira/browse/XMLBEANS-389
 Project: XMLBeans
  Issue Type: Bug
  Components: Compiler
Affects Versions: Version 2, Version 2.1, Version 2.2, Version 2.2.1,  
 Version 2.3,  Version 2.3.1, Version 2.4 , Version 2.4.1 
Reporter: Philip Aston
 Attachments: testcase.tgz


 When a schema is compiled with -javasource=1.5, convenient list based 
 accessors are generated as well as the array accessors. E.g. 
 java.util.Listjava.lang.String getParamList()
 The implementation of the List is built upon java.lang.AbstractList. The 
 AbstractList iterator's hasNext() method calls size(). For an XMLBean 
 generated list, size() walks the store and so iteration scales quadratically.
 Here are some numbers showing the problem:
  XMLBeans backed list of 1 strings: 0.013766 ms
  XMLBeans backed list of 16 strings: 0.255458 ms
  XMLBeans backed list of 256 strings: 1.612057 ms
  XMLBeans backed list of 1024 strings: 25.458934 ms
  XMLBeans backed list of 2048 strings: 123.393447 ms
  XMLBeans backed list of 4096 strings: 505.594661 ms
  plain list of 1 strings: 0.002304 ms
  plain list of 16 strings: 0.007788 ms
  plain list of 256 strings: 0.013384 ms 
  plain list of 1024 strings: 0.052215 ms 
  plain list of 2048 strings: 0.103550 ms
  plain list of 4096 strings: 0.206648 ms
 I think the generated list should override iterator(), and return an Iterator 
 that calculates the list size once per iteration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: dev-h...@xmlbeans.apache.org



[jira] Commented: (XMLBEANS-389) List accessors generated with -javasource=1.5 produce lists that scale poorly with the size of the list

2009-01-15 Thread Philip Aston (JIRA)

[ 
https://issues.apache.org/jira/browse/XMLBEANS-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12664417#action_12664417
 ] 

Philip Aston commented on XMLBEANS-389:
---

Unless I'm missing something, the List accessors aren't documented anywhere. 
Its probably easier to phrase it as an FAQ.

 List accessors generated with -javasource=1.5 produce lists that scale poorly 
 with the size of the list
 ---

 Key: XMLBEANS-389
 URL: https://issues.apache.org/jira/browse/XMLBEANS-389
 Project: XMLBeans
  Issue Type: Bug
  Components: Compiler
Affects Versions: Version 2, Version 2.1, Version 2.2, Version 2.2.1,  
 Version 2.3,  Version 2.3.1, Version 2.4 , Version 2.4.1 
Reporter: Philip Aston
 Attachments: testcase.tgz


 When a schema is compiled with -javasource=1.5, convenient list based 
 accessors are generated as well as the array accessors. E.g. 
 java.util.Listjava.lang.String getParamList()
 The implementation of the List is built upon java.lang.AbstractList. The 
 AbstractList iterator's hasNext() method calls size(). For an XMLBean 
 generated list, size() walks the store and so iteration scales quadratically.
 Here are some numbers showing the problem:
  XMLBeans backed list of 1 strings: 0.013766 ms
  XMLBeans backed list of 16 strings: 0.255458 ms
  XMLBeans backed list of 256 strings: 1.612057 ms
  XMLBeans backed list of 1024 strings: 25.458934 ms
  XMLBeans backed list of 2048 strings: 123.393447 ms
  XMLBeans backed list of 4096 strings: 505.594661 ms
  plain list of 1 strings: 0.002304 ms
  plain list of 16 strings: 0.007788 ms
  plain list of 256 strings: 0.013384 ms 
  plain list of 1024 strings: 0.052215 ms 
  plain list of 2048 strings: 0.103550 ms
  plain list of 4096 strings: 0.206648 ms
 I think the generated list should override iterator(), and return an Iterator 
 that calculates the list size once per iteration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: dev-h...@xmlbeans.apache.org