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

Add compile time selection for copying data with specialised paths #9331

Merged
merged 1 commit into from Nov 9, 2019

Conversation

@ZehMatt
Copy link
Contributor

ZehMatt commented May 30, 2019

This improves the performance of IStream/MemoryStream most where the effect is most prominent with the recently introduced gamestate snapshots system.

openrct2 host parks/bpb.sv6:

In-Game FPS bpb.sv6 at 1080p Software (HW):
  Average Before: 39
  Average After: 56

GameStateSnapshots::Capture:
  Average Before: 0.003934 secs
  Average After: 0.002075 secs

This should also affect other areas where those functions are used, there are 280~ references to Read/ReadValue and 110~ references to Write/WriteValue

@janisozaur janisozaur self-requested a review May 30, 2019
@ZehMatt ZehMatt force-pushed the ZehMatt:istream-optimization branch from 7a45147 to 84608d3 May 30, 2019
@Gymnasiast

This comment has been minimized.

Copy link
Member

Gymnasiast commented May 30, 2019

Result of doing openrct2 benchgfx sc0.sc4 100:


Without:
Rendering 100 times with drawing engine Software took 1.74 seconds. = 57 FPS

With:
Rendering 100 times with drawing engine Software took 1.63 seconds. = 61 FPS

I love how you managed to squeeze out more FPS, even though OpenRCT2 went through a lot of optimisations already.

@ZehMatt

This comment has been minimized.

Copy link
Contributor Author

ZehMatt commented May 30, 2019

Interesting, I didn't think it would influence singleplayer but I won't complain 😆

src/openrct2/core/MemoryStream.h Outdated Show resolved Hide resolved
src/openrct2/core/MemoryStream.h Outdated Show resolved Hide resolved
@ZehMatt ZehMatt force-pushed the ZehMatt:istream-optimization branch from 84608d3 to 2c01b6b Nov 8, 2019
@ZehMatt ZehMatt force-pushed the ZehMatt:istream-optimization branch from 2c01b6b to 972a883 Nov 8, 2019
@ZehMatt ZehMatt requested a review from janisozaur Nov 8, 2019
@Gymnasiast Gymnasiast merged commit f6a23fd into OpenRCT2:develop Nov 9, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.