-
Notifications
You must be signed in to change notification settings - Fork 19
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
More ConfigNode perf #90
Merged
Merged
Conversation
This file contains 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
Contributor
NathanKell
commented
Sep 1, 2022
•
edited
Loading
edited
- Complete parser rewrite (again) entirely eliminating recursion. This makes the previous 'skip' methodology unnecessary since the speedup is sufficient.
- Also overrides other string-based methods in ConfigNode like the sanitize/clean methods and ToString.
- sfs and craft files skip some sanity checking on node and value strings.
- Rewrite reading and writing objects via Persistent attributes
- Allow skipping writing indents when saving ConfigNodes
- Add KSPAssembly attribute so other mods can bind (and use the rewritten ConfigNode read/write stuff, i.e. TypeCache).
…k. Add further optimization around specific use cases (craft, sfs, cache loading). Add blacklist support (assumes all values are sane unless otherwise informed).
This is better than it was, but in some cases the old version outperforms it. Fix some further parser issues, switch to new method of reading files Remove unused code from parser
…se method so it can be used for either file or string case.
…t but crashes my live game...
…less objects to prevent recreating them when Persistent is applied wrongly
NathanKell
force-pushed
the
ConfigNodePerf
branch
from
September 6, 2022 07:47
0a10528
to
97996a1
Compare
…reflect to clear previous chunks.
… Force sanitize off in the UpgradePipeline patch.
gotmachine
pushed a commit
that referenced
this pull request
Dec 7, 2022
* Rewrite more of ConfigNode. Avoid all recursion when reading from disk. Add further optimization around specific use cases (craft, sfs, cache loading). Add blacklist support (assumes all values are sane unless otherwise informed). * Try with MemoryMappedFile * Read to a char array, more inlining and optimizing This is better than it was, but in some cases the old version outperforms it. Fix some further parser issues, switch to new method of reading files Remove unused code from parser * Remove confignodeperf settings blocks, upodate readme * ConfigNodePerf: Patch copy, tostring, and parse as well. Refactor parse method so it can be used for either file or string case. * Allow not writing indents when saving nodes. * Found another copypasta issue with Santiize... * Rewrite ReadObject/WriteObject and associated code. Works fine in test but crashes my live game... * Add KSPAssembly attribute * Fixed exception when single field is specified more than once due to cfg error * Fix not saving nodes for objects/components when writing, cache fieldless objects to prevent recreating them when Persistent is applied wrongly * Fix fallback decoding for ReadFile * Don't double translate on load fail. Use a static stringbuilder, and reflect to clear previous chunks. * Further expand on notes in readme, clean up last bits prior to merge. Force sanitize off in the UpgradePipeline patch.
gotmachine
pushed a commit
that referenced
this pull request
Jan 30, 2023
* Rewrite more of ConfigNode. Avoid all recursion when reading from disk. Add further optimization around specific use cases (craft, sfs, cache loading). Add blacklist support (assumes all values are sane unless otherwise informed). * Try with MemoryMappedFile * Read to a char array, more inlining and optimizing This is better than it was, but in some cases the old version outperforms it. Fix some further parser issues, switch to new method of reading files Remove unused code from parser * Remove confignodeperf settings blocks, upodate readme * ConfigNodePerf: Patch copy, tostring, and parse as well. Refactor parse method so it can be used for either file or string case. * Allow not writing indents when saving nodes. * Found another copypasta issue with Santiize... * Rewrite ReadObject/WriteObject and associated code. Works fine in test but crashes my live game... * Add KSPAssembly attribute * Fixed exception when single field is specified more than once due to cfg error * Fix not saving nodes for objects/components when writing, cache fieldless objects to prevent recreating them when Persistent is applied wrongly * Fix fallback decoding for ReadFile * Don't double translate on load fail. Use a static stringbuilder, and reflect to clear previous chunks. * Further expand on notes in readme, clean up last bits prior to merge. Force sanitize off in the UpgradePipeline patch.
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.