Skip to content

Commit

Permalink
Start winding down cxx1.DeclByName in favor of per-kind name tables
Browse files Browse the repository at this point in the history
Summary:
Refactor the name tables in cxx1.angle while I'm here.

In pp.angle, add DefineLowerCase.

Instead of storing one table (DeclByName) with a kind column and the normal name form,
We can either:

- store the lower case name and the decl
or
- the lower case name and its normal form, then do regular name search

For macros its a bit moot. Try both.

lower case to decl table;
```
pp1.DefineLowerCase.1
  count: 7261521
  size:  797445483 (760.50 MiB) 0.2993%
```
vs bare name table plus define fact:
```
pp1.Macro.1
  count: 3156232
  size:  355522618 (339.05 MiB) 0.1334%

pp1.Define.1
  count: 7261521
  size:  403166509 (384.49 MiB) 0.1513%
```

once we've done all kinds we can remove
```
cxx1.DeclByName.5
  count: 22936096
  size:  2345771072 (2.18 GiB) 0.8804%
```

To save space we could do lower -> normal strings, like we usually do, then look up the decl

Reviewed By: simonmar

Differential Revision: D65985964

fbshipit-source-id: b509933018220a2bc1fc0d5b4d51923b8fe2e9b0
  • Loading branch information
donsbot authored and facebook-github-bot committed Nov 18, 2024
1 parent 573c4d4 commit 39fab25
Show file tree
Hide file tree
Showing 4 changed files with 2,320 additions and 2,306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ codemarkupDerivePasses =
,DeriveGeneric "cxx1.DeclarationToUSR"
,DeriveGeneric "cxx1.RecordDerived"
,DeriveGeneric "cxx1.ThriftToCxx"
-- name search
,DeriveGeneric "cxx1.NamespaceDeclarationByName"
,DeriveGeneric "cxx1.RecordDeclarationClass"
,DeriveGeneric "cxx1.RecordDeclarationStruct"
Expand All @@ -40,4 +41,6 @@ codemarkupDerivePasses =
,DeriveGeneric "cxx1.VariableDeclarationNonLocalByName"
,DeriveGeneric "cxx1.TypeAliasDeclarationByName"
,DeriveGeneric "cxx1.ObjcContainerDeclarationInterface"
-- lowercase name search
,DeriveGeneric "pp1.DefineLowerCase"
]
Loading

0 comments on commit 39fab25

Please sign in to comment.