[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83508] [Ruby trunk Feature#14042] IO#puts: use writev if available

From: rohitpaulk@...
Date: 2017-10-22 15:41:04 UTC
List: ruby-core #83508
Issue #14042 has been reported by rohitpaulk (Rohit Kuruvilla).

----------------------------------------
Feature #14042: IO#puts: use writev if available
https://bugs.ruby-lang.org/issues/14042

* Author: rohitpaulk (Rohit Kuruvilla)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Hi, 

I've attached a patch to make IO#puts use writev if available. Currently, IO#puts calls `write` twice: Once to write the string, and the second to write a newline (if the string doesn't end with one already). With this patch, those two calls are replaced with a single `writev` call.


A test has been added that demonstrates the problem. 

For a bit of background: 

* A related issue: https://bugs.ruby-lang.org/issues/9420. (I couldn't figure out a way to 'attach' my patch to that issue, so I'm creating a new one)
* A blog post I wrote a while back about this: https://hackernoon.com/rubys-puts-is-not-atomic-889c57fc9a28

Command I used to run the test I added: `make test-all TESTS='ruby/test_io.rb -n test_puts_parallel'`


I'm a first time contributor, a bit confused as to where a changelog entry should be added. Is the `NEWS` file the right place?

Regards,
Paul

---Files--------------------------------
ruby-changes.patch (2.39 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next