Project

General

Profile

Feature #14042

IO#puts: use writev if available

Added by rohitpaulk (Paul Kuruvilla) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:83508]

Description

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:

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.83 KB) ruby-changes.patch Updated patch file rohitpaulk (Paul Kuruvilla), 10/23/2017 12:06 PM

Related issues

Related to Ruby master - Feature #9323: IO#writevClosedGlass_saga (Masaki Matsushita)Actions
Is duplicate of Ruby master - Feature #9420: warn and puts should be atomicOpenGlass_saga (Masaki Matsushita)Actions

Also available in: Atom PDF