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

Add benchmark for ctags conversion #679

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Add benchmark for ctags conversion #679

merged 3 commits into from
Nov 6, 2023

Conversation

jtibshirani
Copy link
Member

This change adds a benchmark for the conversion from ctags output to Zoekt
document data, plus a tiny optimization to presize the symbol slices.

@jtibshirani
Copy link
Member Author

I was poking around in this code in case I spotted obvious memory inefficiencies or leaks. I didn't, but figured it would be helpful to commit this.

Benchmark output before vs. after the optimization:

BenchmarkTagsToSections-10    	    7364	    156615 ns/op	   87472 B/op	     461 allocs/op
BenchmarkTagsToSections-10    	    7494	    155150 ns/op	   79296 B/op	     443 allocs/op

@jtibshirani jtibshirani marked this pull request as ready for review November 4, 2023 03:57
Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

Nice! I took a quick look at the implementation and perf and spotted these improvements :) #680

@keegancsmith
Copy link
Member

Benchmark output before vs. after the optimization:

FYI benchstat is a great tool for this. My workflow for it something like this (note the importance of the count flag):

$ go test -run ^$ -bench BenchmarkTagsToSections -count 10 > before.txt
$ # hack away at improvements
$ go test -run ^$ -bench BenchmarkTagsToSections -count 10 > after.txt
$ benchstat before.txt after.txt

@jtibshirani jtibshirani merged commit dc41c6e into main Nov 6, 2023
8 checks passed
@jtibshirani jtibshirani deleted the jtibs/ctags branch November 6, 2023 15:18
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