xml,dataBase or txt file is faster?

hi

i wanted to ask which is faster to read data from

if i wanted to save a strings in the form of

"12334 3334 12345

"12334 3334 12345

"12334 3334 12345""

and then to be read by java application which will parser it

and place the values to an (int size=12334, int pos_x=3334, int pos_y12345)

will an xml file be faster to read from, or a database, or a txt file, and also which one will have smallst size , also which one will produce a smaller size when gziped ?

thank you

[533 byte] By [decodaa] at [2007-10-3 2:36:31]
# 1

If you are only reading in those 3 numbers all disk access will be the same because you read from the disk in large blocks

In terms of parsing the data, if you don't count time spent writing your parser code (which is partly done for you in XML and in a database) you will be able to parse the shorter strings faster i.e. .txt will be faster.

In terms of reducing the file size when zipping, the .txt file will zip smaller than either the XML or the database.

marlin314a at 2007-7-14 19:34:50 > top of Java-index,Other Topics,Algorithms...