File Access from CD-ROM
-
Hello everbody, I created a hashtable in a file to search the contents of some database. I use the standard operations (fseek, fread etc) to access the file. Everything works ok, as long as my indexfile is read from harddisk. (There are more then 200000 entry in it and it takes less then a second to search for an specific entry). However, if i put this on cd-rom its about 2800% !!! slower. Especially if my search returns more then one result. Is there anyone around here who knows how to optimize a file for cd-rom access? Sorry for my english, what i am trying to say is: How has i file to be constructed so that it can be read from cd-rom real fast? Any help would be highly appreciated.
-
Hello everbody, I created a hashtable in a file to search the contents of some database. I use the standard operations (fseek, fread etc) to access the file. Everything works ok, as long as my indexfile is read from harddisk. (There are more then 200000 entry in it and it takes less then a second to search for an specific entry). However, if i put this on cd-rom its about 2800% !!! slower. Especially if my search returns more then one result. Is there anyone around here who knows how to optimize a file for cd-rom access? Sorry for my english, what i am trying to say is: How has i file to be constructed so that it can be read from cd-rom real fast? Any help would be highly appreciated.
Gunnar Mätzler wrote: ...it and it takes less then a second to search for an specific entry). However, if i put this on cd-rom its about 2800% !!! slower. So every second of HDD time equates to 29 seconds of CD time? It's true that CD-ROM drives will be slower than HD drives, but how much slower depends on a lot of factors. I suggest reading this guide to see what all is going on.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Hello everbody, I created a hashtable in a file to search the contents of some database. I use the standard operations (fseek, fread etc) to access the file. Everything works ok, as long as my indexfile is read from harddisk. (There are more then 200000 entry in it and it takes less then a second to search for an specific entry). However, if i put this on cd-rom its about 2800% !!! slower. Especially if my search returns more then one result. Is there anyone around here who knows how to optimize a file for cd-rom access? Sorry for my english, what i am trying to say is: How has i file to be constructed so that it can be read from cd-rom real fast? Any help would be highly appreciated.
Every time you ask for data on a CD that is not right after the last data you asked for the CD will need 1 second to position. So you need to figure out how you can read your table in order. Suggestion: Get Knuth's "The art of computer programing" out, and look for the sections on searching from tape.