Sign in to follow this  
ill

How efficient is PhysFS at buffering file IO data.

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this