Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
Trunk, Upcoming Branch
-
None
Description
With the javolution collection cleaning (OFBIZ-5169,OFBIZ-5781) , we need to realize a second pass to control what instantiation would be better.
For List between LinkedList, ArrayList
Using ArrayList, rather than LinkedList, as a default is a good approach because ArrayList will work better in most situations (in terms of algorithmic runtimes and memory footprints).
However I think it is important to wisely choose ArrayList or LinkedList based on the context, because sometimes a linked list may be a better choice: I am not saying we should do it now and we can tackle this at a later moment, possibly focusing only on list that can be very big and analyzing their usage to see if array or linked list is better; it would be also nice, when we use ArrayList, to see if we can predict the capacity of the list and allocate it at creation: if we can do this we will have a more predictable memory usage and less unpredictable peaks under heavy load (when the array capacity is reached and the array is copied to a new one with double capacity).
more documentation on :
- https://docs.oracle.com/javase/tutorial/collections/implementations/list.html
- http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist
For Map between HashMap and LinkedHashMap :
Javolution Map Iterators return items in insertion sequence (HashMap does not), so any code relying on the original insertion order must use a LinkedHashMap.
For Set beetwen HashSet and LinkedHashSet. (OFBIZ-6299)
If you detect an optimization, please comments this issues
Attachments
Issue Links
- is related to
-
OFBIZ-5169 Removing Javolution from framework components
- Closed
- relates to
-
OFBIZ-10369 ConfigXMLReader - Events are not executed in the order defined
- Closed
-
OFBIZ-6299 Field order is not correct in the auto-complete for look-ups.
- Closed