-
Notifications
You must be signed in to change notification settings - Fork 587
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
Investigate why recording many Sunspider and V8 tests results in ~2x slowdown #10
Comments
Would like to see if this is still the case, and if so understand why, for 1.0. But not necessarily fix the underlying issues, if any. |
Still an issue Without rr: ============================================ RESULTS (means and 95% confidence intervals) -------------------------------------------- Total: 202.6ms +/- 4.9% -------------------------------------------- With rr: ============================================ RESULTS (means and 95% confidence intervals) -------------------------------------------- Total: 443.9ms +/- 2.5% -------------------------------------------- So a 2.2x slowdown. Will see if anything obviously bad jumps out. |
Looks like too deep of an issue for 1.0, though I'd really love to have the time to stick a profiler on it.
I'm not sure if the old numbers were doing in-browser runs or js shell runs. Since they're a bit worse overall, and rr should have only gotten faster, I'm going to guess they were shell runs. But I only care about browser runs, so here we are :). Guessing this is related to FF timer crap. |
I think this is worth spending time on, because the overhead is quite high, intuitively the overhead should be quite low for workloads like this, and "known benchmarks" like these are quite likely targets for people to report rr overhead on. |
Okie doke. |
Just to be clear, did you want this for 1.0? |
I'm flexible on that :-) |
I'm happy to settle for profiling, and then making a decision based on that. |
tl;dr ion parallel compilation is killing perf. Disabling that, and fiddling with sched knobs, gets us under 1.2x overhead. Much improved over old perf.
Nope: the same results reproduce in jsshell. Since that's easier to work with, I used it for testing. Here's the data "baseline" == TI, ion, ion-parallel-compile=on. baseline: 1.0x taskset 0x1 baseline: 1.16x rr: 1.90x rr -c10000000: 2.29x rr -c10000000 -e1000: 2.30x rr -c100000 -e5: 2.07x "no-par" == TI, ion, ion-parallel-compile=off. no-par: 1.06x (1.0x) rr no-par: 1.44x (1.35x) rr -c10000000 no-par: 1.28x (1.20x) rr -c10000000 -e1000 no-par: 1.25x (1.17x) Observations
Unfortunately, I think the takeaway is most likely that forced serialization of programs that actually take advantage of true parallelism, is a loss. The follow-ups I see are
It's worth thinking about whether it's fair to start comparing FF perf with ion-parallel-compilation turned off. I lean towards "no", but will ponder. |
Also, ftr, I noticed that jsshell makes a fair number of |
My inclination for 1.0 is to make it widely known to disable ion parallel compilation when running under rr, if you want max perf. (Or add the "rr mode" hack to FF.) I'm afraid that trying to meliorize rr's recording of forced-serial executions of intrinsically parallel workloads is going to be tilting at windmills. @rocallahan what do you think? |
Also ftr, before starting on #279 I measured layout/base with ion par-comp disabled, and it didn't make a difference. |
js::GetCPUCount looks like this: In our performance comparisons, we should always compare Firefox-under-rr to unrestricted Firefox. It may be instructive to provide a number for single-core Firefox as well to show how much of the rr overhead is due to eliminating paralellism. |
On first skim of libc, it looks like that info is derived from a CPUID insn, which we can't trap. I'll take another look to be sure though.
I think I agree with that. But to be clear, you mean that we should pass the same args to bare FF as for FF-under-rr? |
Yes, I think so. We can use a preload hook to override sysconf if we want to. |
Yeah, that's probably worth doing. I'm glad FF is doing the right thing here, and rr should help it. |
#814 gets us down to 1.2x overhead with default record args (!), and with an inflated timeslice, we get down to 1.04x (!!!). I think we can call this done for 1.0 :). |
Also a win on layout/base; first overhead seen under 1.4x (unscientific). |
I rebased my bare-metal x64 perf numbers for sunspider in-browser runs. (It's more convenient and those numbers are more interesting). rr overhead is ~1.44x, so not great but in the ballpark. |
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
Related: 7ffb7d6 See issue 3504. $ bin/rr record -n bin/pid_ns_kill_child Error message: [FATAL src/Task.cc:2167:did_waitpid() errno: EDOM] (task 285229 (rec:285229) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7fffb7babb70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056012f0b167d in rr::Task::did_waitpid (this=this@entry=0x56012f9d4640, status=...) at rr/src/Task.cc:2167 rr-debugger#8 0x000056012f086ac7 in rr::Scheduler::reschedule (this=this@entry=0x56012f9c4188, switchable=<optimized out>) at rr/src/Scheduler.cc:882 rr-debugger#9 0x000056012eff4607 in rr::RecordSession::record_step (this=0x56012f9c3f40) at rr/src/RecordSession.cc:2497 rr-debugger#10 0x000056012efe8664 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56012f207a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056012ef4800f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278 With change in Task.cc: Error message: [FATAL src/Task.cc:3894:did_handle_ptrace_exit_event()] (task 308641 (rec:308641) at time 269) -> Assertion `!handled_ptrace_exit_event' failed to hold. rr-debugger#6 rr::EmergencyDebugOstream::~EmergencyDebugOstream (this=this@entry=0x7ffe5e4cdf70, __in_chrg=<optimized out>) at rr/src/log.cc:484 rr-debugger#7 0x000056265d0981b7 in rr::Task::did_handle_ptrace_exit_event (this=this@entry=0x56265dde3640) at rr/src/Task.cc:3894 rr-debugger#8 0x000056265cfdb110 in rr::handle_ptrace_exit_event (t=t@entry=0x56265dde3640) at rr/src/RecordSession.cc:279 rr-debugger#9 0x000056265cfe272b in rr::RecordSession::record_step (this=0x56265ddd2f40) at rr/src/RecordSession.cc:2535 rr-debugger#10 0x000056265cfd6674 in rr::record (flags=..., args=...) at rr/src/RecordCommand.cc:697 rr-debugger#11 rr::RecordCommand::run (this=0x56265d1f5a40 <rr::RecordCommand::singleton>, args=...) at rr/src/RecordCommand.cc:860 rr-debugger#12 0x000056265cf3601f in main (argc=<optimized out>, argv=<optimized out>) at rr/src/main.cc:278
This data is from rr.pdf.
These tests should be doing almost no I/O and should be relatively straight-line code without too many syscalls. A 2x slowdown is surprising. The data is old and AFAIK predates syscall wrapping, so the first step (obviously) is to reproduce the results on tip.
The text was updated successfully, but these errors were encountered: