Created
July 26, 2009 19:29
-
-
Save methodmissing/155898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_read_multi_non_blocking | |
| cbs = fixtures( *%w(1.txt 2.txt 3.txt 4.txt) ).map{|f| AIO::CB.new(f) } | |
| assert_equal nil, AIO.lio_listio( *([AIO::NOWAIT].concat(cbs)) ) | |
| sleep(1) | |
| assert_equal %w(one two three four), cbs.map{|cb| cb.buf } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macbook-pros-computer:rb_aio_native lourens$ rake bench | |
| (in /Users/lourens/projects/rb_aio_native) | |
| user system total real | |
| AIO.lio_listio(AIO::WAIT) 0.000000 0.000000 0.000000 ( 0.000105) | |
| IO.read 0.000000 0.000000 0.000000 ( 0.000375) | |
| user system total real | |
| AIO.lio_listio(AIO::NOWAIT) 0.000000 0.000000 0.000000 ( 0.000044) | |
| IO.read 0.000000 0.000000 0.000000 ( 0.000361) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment