Project

General

Profile

Actions

Feature #14042

closed

IO#puts: use writev if available

Added by rohitpaulk (Paul Kuruvilla) over 6 years ago. Updated over 6 years ago.

Status:
Closed
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 2 (0 open2 closed)

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0