-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
profile: new column for time of the function without the time of its children functions #24056
profile: new column for time of the function without the time of its children functions #24056
Conversation
Connected to Huly®: V_0.6-22447 |
The failure seems to be caused by the chacha20 and crypto PRs |
I've tried to add a case for the new column in |
My test program, follows here (it works when run manually, and shows that the new column values are very useful): import time
fn delay1() {
time.sleep(10 * time.millisecond)
}
fn delay2() {
time.sleep(20 * time.millisecond)
}
fn delay3() {
time.sleep(30 * time.millisecond)
}
fn c() {
delay1()
}
fn b() {
c()
delay2()
c()
mut s := 0
for i := 0; i <= 100_000; i++ {
s += i * 2
}
_ := s
}
fn a() {
b()
b()
delay3()
}
fn main() {
println('start')
a()
// mut s := 0; for i:=0;i<=100_000;i++ { s += i*2 }; _ := s
println('done')
} with the following results on my machine:
|
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.
Excellent work, it is a very useful improvement for the -profile reports 🥳.
Adds a new column to the profiler output: time spent in the current function without the time spent in its children
Known problem: for multithreaded programs the time calculations are wrong and might show negative times.
Sample profiling output:
The effect is clearly seen on functions like
main__main
where no time is spent as it calls other functions.It is useful when sorting on the 3rd column as functions that do not need to be optimized directly do not show: