ZipEngine - Multiple Readers?

BlitzMax Forums/BlitzMax Programming/ZipEngine - Multiple Readers?

Gabriel(Posted 2006) [#1]
It's kinda late and I'm a bit bleary eyed, so I want to make sure I'm not missing anything here. I'm going through the source of ZipEngine ( which is great work, by the way, GMan ) and I'm just wondering if there's much of a downside to having multiple readers, say one for each large .zip file. I don't know how many I might want. Let's say 20 for the sake of argument.

I can't see anything in the code which would suggest that this is unhealthy or likely to hog huge chunks of ram or generally do anything unpleasant, but like I say I'm a bit groggy ( these lithium pills aren't helping either :P ) so I'd like to make sure before I start tearing huge chunks out of my game engine and rewriting them to include a reader for each new archive opened.


Grisu(Posted 2006) [#2]
There shouldn't be problems like a huge ram usage.

But I think it wouldn't be good having 20 files open at the same time and read data out of them simultaniusly.

Depending on the users hdd and the clusters on the hdd where the files are stored, you might suffer a speed decrease.

Sure, in general you can keep the files opened and read out of them whenever needed.


Gabriel(Posted 2006) [#3]
Thanks Grisu. I'm just writing up my resource handling layer, and I'm thinking that it would be better to have a reader for each archive so that I'm not opening and closing each archive every time I load a file ( since there's no way to know whether the next 49 files you load are in the same archive or not in advance.


Grisu(Posted 2006) [#4]
^^ That should work well.


gman(Posted 2007) [#5]
greetings :) i agree with Grisu in that having multiple open should not be that much overhead. it will take up a bit of memory as each open handle stores an index of all the files within, but thats of minimal size.