empire-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <doeb...@esteam.de>
Subject re: Why ArrayList with Unknown Result Count?
Date Sun, 29 Nov 2009 12:31:52 GMT
Hi Amin,

these functions are provided for convenience only and are indeed intended for small result
sets.
For special needs people can implement their own function - in fact they should use a DBReader.

But what we could easily do, is to provide an overload for those functions that allow to supply
the collection. Hence the use can decide which collection to use.
I will create an JIRA issue for this too.

Thanks again
Rainer


Amin Abbaspour wrote:
> re: Why ArrayList with Unknown Result Count?
> 
> 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.
> 
> Regards,
> Amin Abbaspour
> 
> 
> 
> 

Mime
View raw message