![]() |
|
#1
|
||||
|
||||
which is faster (C++)Okay,
my question is this. Which is faster on execution, and why? 1)storing data in a vector of strings or 2) opening a file and storing the data in the file. note: there is about 800 pages of data. note: I will also be accessing the data several times in the program __________________
This message is a natural product made from recycled electrons. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects. |
||||
|
#2
|
|||
|
|||
|
Hey.
This is a tough question to answer. It's quite a large chunk of data, so will you have enough memory for 800pages worth of strings? Since you're operating on them frequently, then yes that'd be to fastest option - if you've done it right. You should try and have the data sorted in the memory, to speed up fetch times. However, if you run out of memory, there goes you're operation. On the other hand, you'll definately have plenty of space on the HD for the data, but how to store it so that you can look up stuff in it fast? It'd have to be sorted to be most efficient, and then it has to be binary searched each time something is wanted - will be slow. So I hope you've got the memory! GF |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The