|author||Eric Wong <firstname.lastname@example.org>||2013-12-27 08:08:50 +0000|
|committer||Eric Wong <email@example.com>||2013-12-27 08:08:50 +0000|
Avoid an additional select syscall in the splice path by injecting the target checks into the main loop. We can do this because we always process writers before readers. This adds additional userspace processing, but it avoids one potentially expensive (and potentially task-switching) syscall in many cases; so it should be worth it to avoid skipping with small buffer. This should avoid buffer underuns with mixed-sized buffers when using multiple sinks. This could work for the read_write path, too, but I don't use that enough and this change may still be buggy even for splice users.
Diffstat (limited to 'test')
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_buffer.rb b/test/test_buffer.rb
index 13f4352..d41d07c 100644
@@ -15,6 +15,11 @@ class TestBuffer < Testcase
ret = IO.pipe
+ ret.each do |x|
+ def x.ready_write_optimized?