-
Notifications
You must be signed in to change notification settings - Fork 84
[CORE] Enable and improve buffered IO in LocalFile to reduce its cost by up to 90% #1299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is mostly code written by EA, but I would suggest removing the option to have the class operate in text mode as the original posix API used does not support text mode as far as I understand it and all code using this class will assume binary mode and act accordingly. Any code that needs text mode using stdio directly.
Also the comments clearly said to nuke it after 2003, shame on you for not following instructions :D
Chat GPT says _O_TEXT does something, but it is Windows specific. I think we can keep it. It also will have a use in terms of line buffering for fopen (in the follow up change). Chat GPTThe Summary:
Context:In C on Windows, int open(const char *filename, int oflag [, int pmode]); The
Example:#include <fcntl.h>
#include <io.h>
#include <stdio.h>
int fd = open("example.txt", _O_RDONLY | _O_TEXT); This opens Important Notes:
Comparison:
|
In theory this should improve the loading of data from BIG archives as well |
This change enables and improves the buffered IO in Game Engine's File System.
The original implementation was from EA, but it was lacking a few things which have been corrected.
Measurements in #1074 have shown that the unbuffered IO can be 10x slower than the buffered IO on game launch.
GameText STR files greatly benefit from the file IO buffer.
Win32BIGFileSystem::openArchiveFile
does as well with many small reads.