-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Profiling] Map stack frames more efficiently #94327
[Profiling] Map stack frames more efficiently #94327
Conversation
The mapping code for stack frames uses the utility method `ObjectPath#eval` to read nested properties. Callers need to pass a dot-separated path which is then split internally via a regex. This is quite slow: in a typical deployment we saw overheads of 50ms just for mapping stack frames (total response time is ~ 1 second). With this commit we pass the property path as an array to avoid this overhead. In a microbenchmark the new implementation was 23 times faster than the current one.
Hi @danielmitterdorfer, I've created a changelog YAML for you. |
Pinging @elastic/es-search (Team:Search) |
Below are the results of a microbenchmark with JMH's
|
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.
Makes sense to me! Creating a string only to split it again is a ton of useless work.
Thanks for the quick review! |
The mapping code for stack frames uses the utility method `ObjectPath#eval` to read nested properties. Callers need to pass a dot-separated path which is then split internally via a regex. This is quite slow: in a typical deployment we saw overheads of 50ms just for mapping stack frames (total response time is ~ 1 second). With this commit we pass the property path as an array to avoid this overhead. In a microbenchmark the new implementation was 23 times faster than the current one.
The mapping code for stack frames uses the utility method
ObjectPath#eval
to read nested properties. Callers need to pass a dot-separated path which is then split internally via a regex. This is quite slow: in a typical deployment we saw overheads of 50ms just for mapping stack frames (total response time is ~ 1 second).With this commit we pass the property path as an array to avoid this overhead. In a microbenchmark the new implementation was 23 times faster than the current one.