Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is proof of concept PR, which help to analyze expr profile. I notice that expr has profile feature, but
Config
doesn't explode it for user (i.e. user can't setProfile
true).expr/compiler/compiler.go
Lines 212 to 232 in 80f0ea6
I think it's very likely that the reason lies in how you show the profile results. I've noticed that the results are saved to a structure called Span.
expr/vm/utils.go
Lines 27 to 33 in 80f0ea6
My idea is to convert the information stored in the Span result into a pprof file, so that we can use
go tool pprof
command to visualise how the expression is running and find out where it is time-consuming.I create new sub-module



profile
. I write a functionGeneratePprofProfile
to convertSpan
struct to pprof file (Of course, this function is not perfect, and the profile may need to be more refined. Profile construct). Finally I write a example code and got below result.