Skip to content

tweak(recorder): Improve performance of Replay playback slightly by increasing the Replay file read buffer to 8192 bytes#1389

Merged
xezon merged 1 commit intoTheSuperHackers:mainfrom
Mauller:tweak-recorder-buffer-size
Aug 13, 2025
Merged

tweak(recorder): Improve performance of Replay playback slightly by increasing the Replay file read buffer to 8192 bytes#1389
xezon merged 1 commit intoTheSuperHackers:mainfrom
Mauller:tweak-recorder-buffer-size

Conversation

@Mauller
Copy link
Copy Markdown

@Mauller Mauller commented Jul 30, 2025

This PR changes how replay files are opened so they open with a larger than standard file buffer.

This is to help reduce disk access and aid replay playback speed in the long run.
As other bottlenecks are removed in the future, this PR should present a biffer performance boost.

@Mauller Mauller self-assigned this Jul 30, 2025
@Mauller Mauller added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Jul 30, 2025
@Mauller Mauller force-pushed the tweak-recorder-buffer-size branch from 0609758 to 69f67cb Compare July 30, 2025 19:35
@tintinhamans tintinhamans changed the title teak(recorder): open the replay file with a larger than standard buffer tweak(recorder): open the replay file with a larger than standard buffer Aug 5, 2025
@Mauller Mauller force-pushed the tweak-recorder-buffer-size branch from 69f67cb to 5bc5ef0 Compare August 5, 2025 19:29
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Aug 5, 2025

This was just rebased to catch up to changes on the recorder class and main, can be looked at after recorder is done

@Mauller Mauller force-pushed the tweak-recorder-buffer-size branch 2 times, most recently from 4672610 to 6a94ea8 Compare August 9, 2025 09:09
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Aug 9, 2025

This should be good now and ready to merge.

@Mauller Mauller force-pushed the tweak-recorder-buffer-size branch from 6a94ea8 to 4f84de0 Compare August 10, 2025 16:20
@Mauller
Copy link
Copy Markdown
Author

Mauller commented Aug 10, 2025

Tweaked and pushed.

Copy link
Copy Markdown

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Looks good.

What is the measured performance improvement now?

@Mauller
Copy link
Copy Markdown
Author

Mauller commented Aug 10, 2025

Looks good.

What is the measured performance improvement now?

During an ingame replay it is not that large, probably around 5-10 seconds over a 4 minute replay.
But as we improve bottlenecks elsewhere we should start seeing more benefits over time.

@xezon xezon changed the title tweak(recorder): open the replay file with a larger than standard buffer tweak(recorder): Reduce cost of Replay playback by around 3% by increasing the Replay file read buffer to 8192 bytes Aug 11, 2025
@xezon xezon added Performance Is a performance concern and removed Enhancement Is new feature or request labels Aug 11, 2025
@xezon
Copy link
Copy Markdown

xezon commented Aug 11, 2025

Updated title.

@xezon xezon changed the title tweak(recorder): Reduce cost of Replay playback by around 3% by increasing the Replay file read buffer to 8192 bytes tweak(recorder): Improve performance of Replay playback slightly by increasing the Replay file read buffer to 8192 bytes Aug 13, 2025
@xezon xezon merged commit c2db217 into TheSuperHackers:main Aug 13, 2025
19 checks passed
@xezon xezon deleted the tweak-recorder-buffer-size branch August 13, 2025 17:22
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
…ncreasing the Replay file read buffer to 8192 bytes (TheSuperHackers#1389)

Replay playback was measured to be about 3% faster
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Feb 23, 2026
…ncreasing the Replay file read buffer to 8192 bytes (TheSuperHackers#1389)

Replay playback was measured to be about 3% faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Performance Is a performance concern ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants