bilred / jenabean

Automatically exported from code.google.com/p/jenabean
0 stars 0 forks source link

Bean2RDF slow when serializing large arrays #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use deep copy on object with very large array
2.
3.

What is the expected output? What do you see instead?
Expected decent serialization time.  Instead, getting exponential growth on 
runtime based on array size.

What version of the product are you using? On what operating system?
Version 1.0.7, Linux Ubuntu 11.10

Please provide any additional information below.

In Bean2RDF.java, I changed the class of the 'cycle' field to a HashSet<Object> 
instead of an ArrayList.  Since the major operation of this field is to 
identify the presence of an object already serialized,  the 'contains' and 
'add' methods are the only methods used.  For this, I think a HashSet would be 
a much better data structure to use as we can get constant time performance on 
both these operations.

Original issue reported on code.google.com by Albbithe...@gmail.com on 13 Dec 2011 at 8:18