Added HXCPP configuration options #883
Open
+6
−0
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.
Added HXCPP configuration options for performance optimization.
I'm not sure which ones are enabled by default, so I simply added them all together.
Here's a brief description of the potential optimizations each new addition may bring:
HXCPP_GC_GENERATIONAL: Makes garbage collection scan mostly only recent, new memory in most cases.HXCPP_GC_DYNAMIC_SIZE: Automatically adjusts the GC memory strategy based on runtime conditions.HXCPP_CPP17: Uses the C++17 compiler, which may bring more modern and intelligent optimizations. (Some of these settings also depend on it)HXCPP_GC_BIG_BLOCKS: Increases memory capacity to near-unlimited, reduces memory fragmentation, and improves large resource loading capability. This also means the number of arrows is no longer limited (Before enabling this, I experienced crashes when the note count reached around 70k during casual play).HXCPP_FAST_LINK: Improves compilation speed (though I didn't really notice a difference).You can also download the build from https://github.com/HEIHUAa/CodenameEngine-HEIHUA/actions/runs/21208146062 for testing.
I tested this under modcharts, which have a significant impact on memory usage. With the frame rate capped at a maximum of 200, the test results showed that the 1% low FPS increased from around 75 to 150.