-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
[statspro] Avoid copying histograms, perf improvement #7666
Conversation
#benchmark |
@max-hoffman DOLT
|
@max-hoffman DOLT
|
@max-hoffman DOLT
|
@max-hoffman DOLT
|
@max-hoffman DOLT
|
@coffeegoddd DOLT
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor comment about one interface method
|
||
var _ sql.Statistic = (*DoltStats)(nil) | ||
|
||
func (s *DoltStats) WithColSet(set sql.ColSet) sql.Statistic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not crazy about all this boilerplate code to avoid an embedding but I guess it's slightly preferable to this breaking silently when you add a new With
method to the interface type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the embedded version i started with did have confusing looking errors for missed Withs, so i switched to this one
return &DoltStats{mu: &sync.Mutex{}, Active: make(map[hash.Hash]int), Statistic: &stats.Statistic{}} | ||
} | ||
|
||
func (s *DoltStats) ToInterface() interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be called JsonMap
or similar and potentially have the return type map[string]any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it can return a list of interfaces also, []interface{}
. not for this type specifically, but the json interface this implements
…max/stats-struct-perf
@max-hoffman DOLT
|
companion: dolthub/go-mysql-server#2421