forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I noticed the unnecessary usage of strings to track index usage in some CPU/heap profiles. I attempted to eliminate this entirely, but unfortunately these strings are persisted, making modification of the type difficult, and I had difficulty following the thread from their creation all the way to their consumption - I think someone with more expertise in the observability part of the code base would be required to untangle this. So for now I've settled for refactoring the creation of "used indexes" to avoid using strings until later on during instrumentation. This has the minor benefit possible de-duplicating the indexes before generating the strings, if an index is used multiple times in a query. I've also replaced the expensive usage of `fmt.Sprintf` for generating the strings to the faster `+` concatenation (benchmarks for this are at: https://gist.github.com/mgartner/28a9d52e54e91691d0a7617164aa3157). Release note: None
- Loading branch information
Showing
6 changed files
with
101 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters