Advertisement

How efficient is PhysFS at buffering file IO data.

Started by December 26, 2012 08:14 PM
1 comment, last by ill 11 years, 11 months ago

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.

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.
Advertisement

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

This topic is closed to new replies.

Advertisement