Skip to content
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

feat: stop sigprof while calling native #342

Merged
merged 2 commits into from Jan 3, 2023
Merged

feat: stop sigprof while calling native #342

merged 2 commits into from Jan 3, 2023

Conversation

AsterDY
Copy link
Collaborator

@AsterDY AsterDY commented Dec 28, 2022

Backgroud

  • When go received a SIGPROF signal while it is running on sonic's native functions, it will crash duet to missing stack information. At present, sonic doesn't support add stack map for native functions (on plan), thus a work-around way is to set runtime.prof.hz = 0, thus sigprof() handler won't call gentraceback() which cause crash. After we support make stackmap in future, this behavior will be removed

Benchmark

  • Get
name                      old time/op    new time/op    delta
GetOne_Parallel_Sonic-16    3.54µs ±39%    4.85µs ±27%  +36.92%  (p=0.004 n=10+9)
GetOne_Sonic-16             14.9µs ±20%    12.7µs ±14%  -14.79%  (p=0.001 n=10+9)

name                      old speed      new speed      delta
GetOne_Parallel_Sonic-16  3.84GB/s ±43%  2.76GB/s ±34%  -28.22%  (p=0.004 n=10+9)
GetOne_Sonic-16            879MB/s ±18%  1009MB/s ±16%  +14.71%  (p=0.004 n=10+10)

name                      old alloc/op   new alloc/op   delta
GetOne_Sonic-16              24.0B ± 0%     24.0B ± 0%     ~     (all equal)
GetOne_Parallel_Sonic-16     24.6B ± 2%     24.6B ± 2%     ~     (p=1.000 n=10+10)

name                      old allocs/op  new allocs/op  delta
GetOne_Sonic-16               1.00 ± 0%      1.00 ± 0%     ~     (all equal)
GetOne_Parallel_Sonic-16      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
  • flame graph before this PR
    image

  • flame graph after this PR
    image

@AsterDY AsterDY marked this pull request as draft December 28, 2022 13:52
@AsterDY AsterDY force-pushed the feat/stop_prof branch 4 times, most recently from 782121b to cf5ebd5 Compare December 29, 2022 09:32
@AsterDY AsterDY marked this pull request as ready for review December 29, 2022 09:42
@AsterDY AsterDY merged commit 134fba2 into main Jan 3, 2023
@AsterDY AsterDY deleted the feat/stop_prof branch January 3, 2023 07:15
@AsterDY
Copy link
Collaborator Author

AsterDY commented Jan 3, 2023

fix #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants