Skip to content

perf(ccc): do not build the CongoCC tree - #52

Merged
stbischof merged 1 commit into
eclipse-daanse:mainfrom
stbischof:perf/ccc-no-tree
Oct 22, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
stbischof:perf/ccc-no-tree

Conversation

@stbischof

@stbischof stbischof commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The ccc grammar builds the record model in its actions and never reads the CongoCC parse tree, which was built and discarded on every parse (about a sixth of the CPU and a third of the allocations). TREE_BUILDING_ENABLED = false leaves it out. The wrapper drops its trace-level tree dump and reads error positions from Token directly.

Measured on the FoodMart corpus (257 statements), JDK 25, old and new in both orders:

old new
warm, µs per statement 63–72 36–41
first statement, fresh JVM 125–127 ms 103–110 ms
first pass, µs per statement 1249–1303 905–957

The ccc grammar builds the record model in its actions and never reads the
CongoCC parse tree, which was built and discarded on every parse (about a
sixth of the CPU, a third of the allocations). TREE_BUILDING_ENABLED = false
leaves it out; the wrapper drops its trace-level tree dump and reads error
positions from Token directly.

FoodMart corpus, 257 statements, JDK 25, old and new in both orders:
warm 63-72 -> 36-41 us per statement, first statement in a fresh JVM
125-127 -> 103-110 ms, first pass 1249-1303 -> 905-957 us per statement.
TCK green (213 tests), the model of every corpus statement is unchanged.

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@sonarqubecloud

Copy link
Copy Markdown

@stbischof
stbischof merged commit 0385cf5 into eclipse-daanse:main Oct 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant