Skip to content

Improve performance of R8Loader.#21357

Merged
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:r8-perf
Mar 9, 2024
Merged

Improve performance of R8Loader.#21357
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:r8-perf

Conversation

@RoosterDragon
Copy link
Copy Markdown
Member

The repeated small stream reads of ReadUInt16 generate a lot of overhead. Instead, consume the data in a single ReadBytes call and then unpack within the same buffer.

Reduces the CPU used by the R8Loader.Frame constructor when opening the d2k mod from 7.1% to 1.5%.

The repeated small stream reads of ReadUInt16 generate a lot of overhead. Instead, consume the data in a single ReadBytes call and then unpack within the same buffer.
Copy link
Copy Markdown
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

LGTM

@PunkPun PunkPun merged commit 519db10 into OpenRA:bleed Mar 9, 2024
@PunkPun
Copy link
Copy Markdown
Member

PunkPun commented Mar 9, 2024

Changelog

@RoosterDragon RoosterDragon deleted the r8-perf branch March 10, 2024 14:06
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.

2 participants