fix: Drop the anonymous namespace from the benchmark URI - #56
Open
chfast wants to merge 1 commit into
Open
Conversation
The namespace was extracted from __PRETTY_FUNCTION__ and rejected only when
spelled '(anonymous namespace)', as clang does, so with GCC, which spells it
'{anonymous}', it ended up in the URI: file.cpp::{anonymous}::bench[…]. Strip the
segment instead of bailing out, for both spellings, so the rest of the namespace
path is kept and no error is reported for a construct that is merely unnameable.
Greptile SummaryThis PR normalizes benchmark namespace extraction across GCC and Clang by removing compiler-specific anonymous-namespace segments instead of rejecting them.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security issues identified. The normalization removes only compiler-generated strings that cannot be valid C++ namespace identifiers, while retaining the source-file and named-namespace portions used to identify benchmarks.
|
| Filename | Overview |
|---|---|
| core/src/uri.cpp | Anonymous namespace markers are consistently removed while preserving source-file and named-namespace components of benchmark URIs. |
Reviews (1): Last reviewed commit: "fix: Drop the anonymous namespace from t..." | Re-trigger Greptile
chfast
added a commit
to ipsilon/evmone
that referenced
this pull request
Aug 16, 2026
Reports the benchmark results for every pull request, measured with CPU simulation so that they are comparable despite running on the shared GitHub runners. `test/CMakeLists.txt` fetches either google/benchmark or, when `CODSPEED_MODE` is set, CodSpeed's compatibility layer providing the same `benchmark::benchmark` target. The layer temporarily comes from a fork with two fixes not yet upstream: without CodSpeedHQ/codspeed-cpp#55 the `KeepRunningBatch()` loops are executed but never measured, silently dropping every precompile benchmark, and without CodSpeedHQ/codspeed-cpp#56 the anonymous namespace ends up in the reported URIs. On the benchmark side only `bench_name()` is added, giving the dynamically registered benchmarks the `file::name` URI the `BENCHMARK()` macro provides on its own. 129 benchmarks are reported: the baseline VM on the mainnet-derived programs (41) and all the precompile cases (88), including the modexp parameter sweep and the GMP and libsecp256k1 implementations. The synthetic benchmarks, the `advanced` and `bnocgoto` VM variants and the internal benchmarks are left out. --------- Co-authored-by: Paweł Bylica <pawel@hepcolgum.band>
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.
Related to #40.
extract_lambda_namespace()rejects a namespace containing(anonymous namespace), which is how clang spells it, but GCC spells it{anonymous}and that spelling passes the check unnoticed. The benchmarks registered inside an anonymous namespace therefore end up reported asfile.cpp::{anonymous}::bench[…]with GCC, and asfile.cpp::bench[…]plus an[ERROR] Anonymous namespace not supportedline per benchmark with clang.Since an anonymous namespace is not part of any identifier a benchmark can be referred to by, this strips the segment instead of bailing out, handling both spellings. The rest of the namespace path is preserved, so
{anonymous}::outer::becomesouter::, and nothing is reported for a construct that is merely unnameable rather than unsupported.