-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Pass concrete types to promql functions #16797
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
Conversation
9013b6f
to
da0e01a
Compare
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.
Thanks! A lot of strong typing!
Great to see several performance improvements between 15% and 38%.
A few suggestions below.
Signed-off-by: darshanime <deathbullet@gmail.com>
Signed-off-by: darshanime <deathbullet@gmail.com>
Signed-off-by: darshanime <deathbullet@gmail.com>
Signed-off-by: darshanime <deathbullet@gmail.com>
eec8bdc
to
7157606
Compare
Signed-off-by: darshanime <deathbullet@gmail.com>
7157606
to
2d4e6c7
Compare
@bboreham could you ptal again? |
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.
Great! LGTM.
) Currently, the promql functions take the interface slice []parser.Value as an argument, which is being implemented by the conrete types Vector, Matrix etc. This PR replaces the interface with the concrete types, resulting in improved performance. The inspiration for this PR came from prometheus#16698 which does this for binops. I extended the idea to all promql functions Signed-off-by: darshanime <deathbullet@gmail.com> * pass single Matrix Signed-off-by: darshanime <deathbullet@gmail.com> --------- Signed-off-by: darshanime <deathbullet@gmail.com> Signed-off-by: Andrew Hall <andrew.hall@grafana.com>
Currently, the promql functions take the interface slice
[]parser.Value
as an argument, which is being implemented by the conrete typesVector
,Matrix
etc. This PR replaces the interface with the concrete types, resulting in improved performance (see benchmark below). The inspiration for this PR came from #16698 which does this for binops. I extended the idea to all promql functionsbenchmarking results