-
Notifications
You must be signed in to change notification settings - Fork 26
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
Generating new game takes a long time #37
Comments
So OpenNotrium is a lot slower, and it's not compile speed or anything. It's because basic Notrium is a bit broken. The main slowdown comes from logging, and that's mainly because each line logged opens a file, writes the line, then closes it again, forcing a flush. That's a lot of disk IO. But if you install Notrium in Program Files, it doesn't have permission to write log files in that directory. So it doesn't log, and everything goes a lot faster. If you take it to a directory where it does have write permissions, it'll take as long as OpenNotrium. Anyway. Logging shouldn't slow down game loading from 2 seconds to 12. I guess we should log a whole lot less by default, but provide the option to mod writers. |
I would first suggest not flushing when we know there are more log entries to come, such as when generating a new game. It would only lose some of the log in case of a severe crash, and such cases would have to be analysed with a debugger anyway. |
On the other hand, how about we integrate an existing logging library for C++? Not only the library would know how to handle file I/O when logging, but would also give us many levels of freedom on what to log and what to print to the console, usually without introducing overheads. Easylogging++ looks pretty amazing and suitable for OpenNotrium. How about we attempt to integrate it (or some other tool, there are plenty out there)? Edit: just keeping record of a branch in which I started replacing logging with Easylogging++. |
On my PC, starting a new game in a release build of OpenNotrium takes about 12 seconds. Contrast with Ville's Notrium 1.345 which takes about 2 seconds to create a new game.
It might be compiler settings but that is a huuuuge difference.
The text was updated successfully, but these errors were encountered: