Skip to content

Skip AST dumps when verbose logging is disabled - #667

Merged
nunoplopes merged 1 commit into
masterfrom
perfloop-pr-open-fhsyy3fzjq
Nov 19, 2026
Merged

nunoplopes merged 1 commit into
masterfrom
perfloop-pr-open-fhsyy3fzjq

Conversation

@perfloop

@perfloop perfloop Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

With verbose logging disabled, translation still walks and formats syntax-tree dumps before sending them to a null stream. Skip that work before calling Clang's dumper, while retaining enabled verbose dumps and unconditional error reporting.

A local DumpVerbose helper covers free functions, C records, C++ records and C++ methods in the shared converter, so both translation models use the same gate. Each call stays at its existing position relative to conversion eligibility checks. The logging default is unchanged.

Translating tests/std/basic/basic.def.odr.cpp through TranspileSrc with default-disabled logging reduced median requested C++ new bytes from 2,333,148 to 2,131,980 in refcount mode across 12 paired runs, and from 2,200,076 to 1,998,908 in unsafe mode across 13 paired runs. The measurement includes parsing, rule loading and conversion, but excludes input loading, rustfmt, direct malloc calls and aligned allocations.

Whole-command timing remains inconclusive; no elapsed-time, CPU or peak-memory improvement is claimed.

Focused lit coverage for declarations, constructors, templates and cross-translation-unit methods passed all 10 tests, with no failures or skips.

Case and evidence


Made by Perfloop.

@nunoplopes

Copy link
Copy Markdown
Contributor

@perfloop-agent remove the benchmark dir from this PR

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-fhsyy3fzjq branch from dcb753a to dd21dbf Compare November 19, 2026 18:25
@perfloop

perfloop Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

The benchmark directory and its CMake target are removed from this update; the logging guard is unchanged.

@nunoplopes
nunoplopes merged commit 966f43e into master Nov 19, 2026
9 checks passed
@nunoplopes
nunoplopes deleted the perfloop-pr-open-fhsyy3fzjq branch November 19, 2026 21:35
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.

2 participants