Optimize compilation for large global arrays#184
Merged
dvander merged 2 commits intoalliedmodders:masterfrom Mar 6, 2018
Merged
Optimize compilation for large global arrays#184dvander merged 2 commits intoalliedmodders:masterfrom
dvander merged 2 commits intoalliedmodders:masterfrom
Conversation
dvander
requested changes
Mar 6, 2018
compiler/sc1.cpp
Outdated
| defstorage(); | ||
| } /* while */ | ||
|
|
||
| stgwrite("dumpdup "); |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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?
Member
There was a problem hiding this comment.
Up to you - I'll squash it in the end.
Contributor
Author
There was a problem hiding this comment.
Done.
Out of curiosity - what's the usual meaning of "dup" in VMs?
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces
dumpdupopcode (compiler only). It helps with huge arrays with default values by creating only 1dumpdupopcode instead of manydumpopcodes together with a lot of vaues. Array indirection tables still usedumpthough, but they are small in size compared to the array data itself.The following array:
compiles in ~1.7s with this patch instead of ~9.5s on my machine.