Expression Parser Rewrite - #1144
Open
RuffledPlume wants to merge 1 commit into
Open
Conversation
RuffledPlume
marked this pull request as draft
July 20, 2026 04:30
RuffledPlume
force-pushed
the
ExpressionParserAllocations
branch
4 times, most recently
from
July 21, 2026 23:24
06cec6f to
9397034
Compare
RuffledPlume
marked this pull request as ready for review
July 22, 2026 20:35
Contributor
Author
|
No longer draft since it passed a test pitting the new expression parser vs the old: RuffledPlume@765c490 |
RuffledPlume
force-pushed
the
ExpressionParserAllocations
branch
from
July 23, 2026 19:44
939f16a to
0b77da1
Compare
Sync TODO: A good Commit Message :) I'm tired haha Combine Individual Operations in batch operations Fixes to test cases since now we support int types Fix compileBoolean issues Update TileOverrideVariables to implement `getInt` to avoid boxing Optimise combined predicates by building a list instead of recursion Sort conditions based on complexity Static Imports Added ShortCircuit path for BooleanComparisons Minor Improvements Optimise TileOverrideVariables Move AHSLSupplier into its own class
RuffledPlume
force-pushed
the
ExpressionParserAllocations
branch
from
July 27, 2026 01:08
0b77da1 to
7d30280
Compare
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.
Aims of this rewrite is to eliminate all garbage generation caused by testing the predicate generated by the ExpressionParser, to achieve this tried to remove all Lambdas from within the ExpressionParser, leaving only the
VariableSupplieras the last potential lambda.All Operator Lambdas have been replaced with explicit objects which achieve the same, this reduces scope capture ambiguity and instead its now clear where allocations are occurring and should now be a upfront cost to parsing instead of when testing.
VariableSuppliernow supports:getFloatgetIntgetBooleanand the original
getwhich will cause boxing and ideally should be removed, its only being left for backwards compatibility.Profile Capture Before:

After:

A Garbage reduction of 24 GB down to 27 MB over a 30 second profile capture (On master its view dependent, more dynamic models with color overrides will allocate significantly more, these captures we're taking in port sarim)
NOTE
Currently a draft since it needs allot of validating to ensure it matches up with the previous version, ideally we'd dump allot of data to test & verify