Text File Processing in Java: Which will be more logical to perform? -


i have search , copy files total of 1.8 million files. here have do:

i have 40 filename in array , 18,00,000 files in folder.

what option perform?

a) pick 1 file folder (having 1.8 millions), , loop through 40 files.   or  b) pick 1 filename array , loop through 1.8 million files. 

i have search , copy files contain filename (present in array) matched in 1.8 million files.

please guide me, reasons.

my tips:

1) split files in folder. filesystems not in 1 folder.

2) can't put data db? if not structured - @ least blobs...

3) option 1) seems promise better performance, because traversing dir structure more expensive comparing string (it's system call).

but better be:

go trough files @ once, put crc32 hash map, , check against 40 files in list. in other words, build meta data based on compare "copy files" (by guess mean exact copies) , in map these meta data..

i hope understood question well.


Comments