From df634904b60f0aa17a99afd225c58a7605c9ee37 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Dec 2013 08:08:50 +0000 Subject: merge some select calls for splice users 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. --- test/test_buffer.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_buffer.rb b/test/test_buffer.rb index 13f4352..d41d07c 100644 --- a/test/test_buffer.rb +++ b/test/test_buffer.rb @@ -15,6 +15,11 @@ class TestBuffer < Testcase def pipe ret = IO.pipe + ret.each do |x| + def x.ready_write_optimized? + false + end + end @to_close.concat(ret) ret end -- cgit v1.2.3-24-ge0c7