Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up ParseSymbol by avoiding allocations #258

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

varungandhi-src
Copy link
Contributor

TODO cleanups - remove stale benchmarks/update them

Test plan

TODO

return ParsePartialSymbolUTF8(symbol, true)
}

func ParsePartialSymbolUTF8(symbol string, includeDescriptors bool) (*Symbol, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should take UTF8String as input

@kritzcreek
Copy link
Contributor

I tried running the benchmarks against chromium-1.scip (to compare parsing the same symbols), but it looks like the parser is failing to parse the symbols:

@@ -175,7 +175,11 @@ func TestUtf8Validation(t *testing.T) {
 		var sym Symbol
 		for i := 0; i < b.N; i++ {
 			occ := allOccurrences[i]
-			_ = parsePartialSymbolV2(occ.Symbol, true, &sym)
+			err = parsePartialSymbolV2(occ.Symbol, true, &sym)
+			if err != nil {
+				panic(fmt.Sprintf("Failed to parse '%s' with %s", occ.Symbol, err))
+				// fmt.Printf("Failed to parse '%s' with %s", occ.Symbol, err)
+			}
 		}
 	}
 	stdUtf8ValidationOnly := func(b *simpleBenchmark) {
=== RUN   TestUtf8Validation
--- FAIL: TestUtf8Validation (17.96s)
panic: Failed to parse 'cxx . todo-pkg todo-version `apps/switches.h:6:9`!' with unrecognized descriptor "do-pkg " [recovered]
	panic: Failed to parse 'cxx . todo-pkg todo-version `apps/switches.h:6:9`!' with unrecognized descriptor "do-pkg "

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