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

Cache VariableExpressions on load. #14524

Merged
merged 1 commit into from Dec 17, 2017

Conversation

Projects
None yet
3 participants
@RoosterDragon
Member

RoosterDragon commented Dec 16, 2017

Compiling these expressions is sadly expensive, and we needed new ones for every trait on every actor each time one was generated. The expressions thankfully can be shared as they are pure functions, which removes this overhead.

Saves 15% of CPU during initial game load (caused by loading actors for the RA shellmap). This would also save a bit of CPU when creating new actors during regular games too.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Dec 16, 2017

Member

Confirmed that this provides a 10-15% improvement in RA startup time on macOS/mono 5.4.1.7.
The speedup on Linux is potentially much larger because of #13526.

Member

pchote commented Dec 16, 2017

Confirmed that this provides a 10-15% improvement in RA startup time on macOS/mono 5.4.1.7.
The speedup on Linux is potentially much larger because of #13526.

@pchote pchote modified the milestones: Next + 1, Next release Dec 16, 2017

@pchote pchote added the PR: Needs +2 label Dec 16, 2017

Cache VariableExpressions on load.
Compiling these expressions is sadly expensive, and we needed new ones for every trait on every actor each time one was generated. The expressions thankfully can be shared as they are pure functions, which removes this overhead.
@RoosterDragon

This comment has been minimized.

Show comment
Hide comment
@RoosterDragon

RoosterDragon Dec 16, 2017

Member

(fixed naming to appease StyleCop)

Member

RoosterDragon commented Dec 16, 2017

(fixed naming to appease StyleCop)

@reaperrr

This comment has been minimized.

Show comment
Hide comment
@reaperrr

reaperrr Dec 17, 2017

Contributor

Reproduceably improves RA startup time by 20% (~2400ms vs. ~3000ms on bleed) on my system (Win10x64, msbuild-compiled debug build).

Contributor

reaperrr commented Dec 17, 2017

Reproduceably improves RA startup time by 20% (~2400ms vs. ~3000ms on bleed) on my system (Win10x64, msbuild-compiled debug build).

@reaperrr reaperrr merged commit de38313 into OpenRA:bleed Dec 17, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@RoosterDragon RoosterDragon deleted the RoosterDragon:cache-expressions branch Dec 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment