microsoft / microsoft/SizeBench

Ignore lambda numbers/hashes when diffing binaries

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
175
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I am analyzing a binary that is moving from C++17 to C++20 mode to see why and where it changed size. This binary has a lot of lambdas in it. Unfortunately the MSVC naming pattern for lambdas changes based on the mode so the diff is almost impossible because every lambda is showing up as only-in-base or only-in-comparison. That leaves me unable to see the true diff.

The lambda names have a hash (cpp17) or incrementing number (cpp20) in the name. These can hopefully be ignored by the comparison while still giving accurate results.

Here is an anonymized example of what I'm observing (where HASH is a long pseudo-random string)

cpp17:

winrt::Contoso::implementation::MyClass::MyFunction::_l2::<lambda_HASH>::<lambda_HASH>::operator()()const

cpp20:

winrt::Contoso::implementation::MyClass::MyFunction::_l2::<lambda_1>::<lambda_1>::operator()()const

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files, tests, or entry points are named in the issue. Start by locating the binary comparison and symbol-name normalization code, then reproduce the anonymized MSVC C++17/C++20 lambda names; done means hash- and number-based lambda names no longer create false only-in-base or only-in-comparison results.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.