diff options
| author | bors <bors@rust-lang.org> | 2013-10-26 00:06:09 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-26 00:06:09 -0700 |
| commit | d53159a643e1f4a7e1275e9a318b8505526d96ac (patch) | |
| tree | 1467d25f9e8d3483222c968cf52bcf44ac5f6aff /src/rustllvm/RustWrapper.cpp | |
| parent | c5074ae6463876bbb9511e980fe890bebc881e41 (diff) | |
| parent | e4c6523c65c45d0fc4485b9e691043c7b5c61a94 (diff) | |
| download | rust-d53159a643e1f4a7e1275e9a318b8505526d96ac.tar.gz rust-d53159a643e1f4a7e1275e9a318b8505526d96ac.zip | |
auto merge of #10070 : alexcrichton/rust/fewer-missiles, r=brson
This optimizes the `home_for_io` code path by requiring fewer scheduler operations in some situtations. When moving to your home scheduler, this no longer forces a context switch if you're already on the home scheduler. Instead, the homing code now simply pins you to your current scheduler (making it so you can't be stolen away). If you're not on your home scheduler, then we context switch away, sending you to your home scheduler. When the I/O operation is done, then we also no longer forcibly trigger a context switch. Instead, the action is cased on whether the task is homed or not. If a task does not have a home, then the task is re-flagged as not having a home and no context switch is performed. If a task is homed to the current scheduler, then we don't do anything, and if the task is homed to a foreign scheduler, then it's sent along its merry way. I verified that there are about a third as many `write` syscalls done in print operations now. Libuv uses write to implement async handles, and the homing before and after each I/O operation was triggering a write on these async handles. Additionally, using the terrible benchmark of printing 10k times in a loop, this drives the runtime from 0.6s down to 0.3s (yay!).
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
