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

More ConfigNode perf #90

Merged
merged 14 commits into from
Sep 8, 2022
Merged

More ConfigNode perf #90

merged 14 commits into from
Sep 8, 2022

Conversation

NathanKell
Copy link
Contributor

@NathanKell NathanKell commented Sep 1, 2022

  • 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).

@NathanKell NathanKell marked this pull request as draft September 1, 2022 07:42
…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.
…less objects to prevent recreating them when Persistent is applied wrongly
@NathanKell NathanKell marked this pull request as ready for review September 8, 2022 03:50
… Force sanitize off in the UpgradePipeline patch.
@NathanKell NathanKell merged commit a0c3b74 into dev Sep 8, 2022
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
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant