Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How efficient is PhysFS at buffering file IO data.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 ill   Members   

320
Like
0Likes
Like

Posted 26 December 2012 - 02:14 PM

So I'm using PhysFS to do file I/O on windows, linux, mac, Android, and I think it'll work on iOS as well.

 

PhysFS has file read functions like PHYSFS_ReadSLE16 to read a signed little endian 16 bit value from a file.

 

I assume it does something internally with the files to make this efficient, such as unzipping blocks of the file at a time and keeping a buffer to read from rather than unzipping the file every time I want to read a single value.

 

 

 

 

OK, after a lot of reading of the docs I found the PHYSFS_SetBuffer function.  It says that file IO is unbuffered by default.  I guess that solves that question.


Edited by ill, 26 December 2012 - 02:16 PM.


#2 Sik_the_hedgehog   Members   

3002
Like
0Likes
Like

Posted 27 December 2012 - 10:35 PM

Thanks for bringing this up to my attention =P *modified his code to enable buffering*

 

What would be a good buffering size? Assume it's for reading files from compressed archives (e.g. ZIP or 7Z, assume they aren't solid). Currently I set it to 4KB but I'd like to know if there's a better value for this.


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#3 ill   Members   

320
Like
0Likes
Like

Posted 30 December 2012 - 07:35 PM

I looked into it and it seems like 4KB is in fact one of the best values.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.