incubator-empire-db-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amin Abbaspour <>
Subject Why ArrayList with Unknown Result Count?
Date Sun, 29 Nov 2009 10:57:32 GMT
Hello everyone,

This is my first email in empire-db's developers mailing list :) First of all thanks for your
ideas and attempts.

I was reading source code and noticed that ArrayList is used to store results in querySimpleList
and queryObjectList and also to hold values in tables, relations, and views.

While the second usage (for tables, relations, etc) is not much critical since they are limited
in size, IMHO using ArrayList without initial size is prohibited for large datasets such as
those returned by queries. As you all know this will result in many times memory allocation
and collection since it goes from size 10 -> 20 -> 40 -> etc.

I recommend that in the cases that there is a known return value count (like selectSingle
or select with Limit value), ArrayList should be used with initial size in constructor; otherwise
LinkedList is a better choice.

Amin Abbaspour


View raw message