This sounds like a job for... science! I'll try some experiments and see
if it makes a difference.
Tim
On 05/07/2013 03:42 PM, Masanz, James J. wrote:
do you have any numbers of what sort of impact this will actually have? Not
clear to me what the savings would be from. Instantiating objects either way.
Should we be just initializing the ArrayList to something other than the
default size?
-- James
-----Original Message-----
From: [email protected] [mailto:dev-
[email protected]] On Behalf Of Tim
Miller
Sent: Tuesday, May 07, 2013 2:18 PM
To: [email protected]
Subject: files vs strings in collection reader
The FilesInDirectoryCollectionReader creates an arraylist of java.io.File
objects when it is initialized. For large datasets (~50k
files) this is substantial time overhead and probably memory as well.
Seems like it would be more efficient to use Strings instead of Files
there and just open the File object when getNext() is called. It is pretty
easy to implement, any downside to making this switch?
Tim