2009-12-03, 01:15 PM
For fun, I tried a new method of patch reading. Instead of constantly seeking and reading from the patched file every time I wanted to grab a few bytes from it, I just read the entire file into memory. Then I tried to apply a 28 MB patch. The numbers speak for themselves:
ENTIRE FILE NOT IN MEMORY: 6m 52s
ENTIRE FILE IN MEMORY: 1m 35s
Reading the file in the memory results in 85% faster patch reading - a truly spectacular increase. However, it also means that extremely large files, such as Map.wz and Sound.wz, are read into memory at once. Not everyone has 500 - 700MB of RAM to utilize for this.
So... what do you guys think? Should I read the entire file into memory and get the speed advantage, or is the current way just fine?
ENTIRE FILE NOT IN MEMORY: 6m 52s
ENTIRE FILE IN MEMORY: 1m 35s
Reading the file in the memory results in 85% faster patch reading - a truly spectacular increase. However, it also means that extremely large files, such as Map.wz and Sound.wz, are read into memory at once. Not everyone has 500 - 700MB of RAM to utilize for this.
So... what do you guys think? Should I read the entire file into memory and get the speed advantage, or is the current way just fine?
