Skip to content
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

use buffer in LuaStateFactory file comparison #137

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

charagarlnad
Copy link

LuaStateFactory compares files using non-buffered, single byte reads. This PR wraps the FileInputStream in a BufferedInputStream to buffer reads.

before: _root > Loading > PreInitialization > OpenComputers 4.757485(s)
after: _root > Loading > PreInitialization > OpenComputers 1.149008(s)

@Dream-Master Dream-Master requested a review from a team December 7, 2024 20:56
Copy link

@YannickMG YannickMG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. The change makes sense and it does save a precious few seconds of pack startup time!

Before: > 3s

[08:28:20] [Client thread/INFO] [OpenComputers]: Initializing OpenComputers API.
[08:28:21] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-nei-manual-offset-fix.1+1c446545d4-52-libjnlua52-windows-x86_64.dll'.
[08:28:22] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-nei-manual-offset-fix.1+1c446545d4-53-libjnlua53-windows-x86_64.dll'.
[08:28:23] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-nei-manual-offset-fix.1+1c446545d4-54-libjnlua54-windows-x86_64.dll'.
[08:28:23] [Client thread/INFO] [OpenComputers]: Done with pre init phase.

After : < 1s

[08:54:37] [Client thread/INFO] [OpenComputers]: Initializing OpenComputers API.
[08:54:37] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-fork-charagarlnad-master.1+fdccaa7d90-52-libjnlua52-windows-x86_64.dll'.
[08:54:37] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-fork-charagarlnad-master.1+fdccaa7d90-53-libjnlua53-windows-x86_64.dll'.
[08:54:37] [Client thread/INFO] [OpenComputers]: Found a compatible native library: 'OpenComputersMod-1.10.27-GTNH-fork-charagarlnad-master.1+fdccaa7d90-54-libjnlua54-windows-x86_64.dll'.
[08:54:37] [Client thread/INFO] [OpenComputers]: Done with pre init phase.

@Dream-Master Dream-Master merged commit 28fe621 into GTNewHorizons:master Dec 14, 2024
1 check passed
Dream-Master pushed a commit that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants