java - CSV file, faster in binary format? Fastest search? -


if have csv file, faster keep file place text or convert other format? (for searching)

in terms of searching csv file, fastest method of retrieving particular row (by key)? not referring sorting file sorry, mean looking arbitrary key in file.

some updates:

  1. the file read-only
  2. the file can read , kept in memory

there several things consider this:

  • what kind of data store? make sense, convert binary format? binary format take less space (the time takes read file dependent on size)?

  • do have multiple queries same file, while system running, or have load file each time query?

  • do need efficiently transfer file between different systems?

all these factors important decision. common case need load file once , many queries. in case hardly matters format store data in, because stored in memory afterwards anyway. spend more time thinking data structures handle queries.

another common case is, cannot keep main application running , hence cannot keep file in memory. in case, rid of file , use database. database can use faster come with. not easy transfer database between system.

most though, file format not real issue consider. i've read quite few long csv files , time took read file negligible compared needed data afterwards.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -