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

Optimize compilation for large global arrays #184

Merged
merged 2 commits into from Mar 6, 2018

Conversation

@rsKliPPy
Copy link
Contributor

rsKliPPy commented Mar 5, 2018

Introduces dumpdup opcode (compiler only). It helps with huge arrays with default values by creating only 1 dumpdup opcode instead of many dump opcodes together with a lot of vaues. Array indirection tables still use dump though, but they are small in size compared to the array data itself.

The following array:

bool x[32][1024][1024];

compiles in ~1.7s with this patch instead of ~9.5s on my machine.

defstorage();
} /* while */

stgwrite("dumpdup ");

This comment has been minimized.

Copy link
@dvander

dvander Mar 6, 2018

Member

This change seems good - could you call it "dumpfill" or something instead? "dup" usually means something else in VMs and there's precedent for "fill" here.

This comment has been minimized.

Copy link
@rsKliPPy

rsKliPPy Mar 6, 2018

Author Contributor

Sure, I wasn't keen on the naming anyway. I chose that naming because of ASM <times> DUP(<value>).
Do you want me to amend or create a new commit?

This comment has been minimized.

Copy link
@dvander

dvander Mar 6, 2018

Member

Up to you - I'll squash it in the end.

This comment has been minimized.

Copy link
@rsKliPPy

rsKliPPy Mar 6, 2018

Author Contributor

Done.
Out of curiosity - what's the usual meaning of "dup" in VMs?

@dvander

This comment has been minimized.

Copy link
Member

dvander commented Mar 6, 2018

Thanks!

@dvander dvander merged commit 017cf68 into alliedmodders:master Mar 6, 2018
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
@rsKliPPy rsKliPPy deleted the rsKliPPy:improve-global-arrays branch Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.