Commit e30d638
authored
Slightly reduce allocations in SymbolCompletionItem.AddSymbolInfo (#76418)
* Slightly reduce allocations in SymbolCompletionItem.AddSymbolInfo
This code creates a string from the SymbolKind enum and was showing up as 0.2% of allocations in the typing scenario in the csharp editing speedometer test.
Instead, mimic what the core runtime does in the Number class by keeping a small cache mapping int => string that is lazily populated.1 parent 2eca5b2 commit e30d638
File tree
2 files changed
+25
-1
lines changed- src/Features/Core/Portable/Completion/Providers
2 files changed
+25
-1
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
0 commit comments