GNU bug report logs - #23848
sed not using unlocked_stdio

Previous Next

Package: sed;

Reported by: Tristan Verniquet <tverniquet <at> gmail.com>

Date: Sat, 25 Jun 2016 17:10:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23848 in the body.
You can then email your comments to 23848 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-sed <at> gnu.org:
bug#23848; Package sed. (Sat, 25 Jun 2016 17:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tristan Verniquet <tverniquet <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Sat, 25 Jun 2016 17:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tristan Verniquet <tverniquet <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: sed not using unlocked_stdio
Date: Sat, 25 Jun 2016 22:10:13 +1000
[Message part 1 (text/plain, inline)]
sed 4.2.2

Most reading and writing is done in utils.c, but this does not include
sed.h or the "unlocked-io.h" header.

ltrace sed '' < <(seq 1 100)

Shows lots of calls to the locked system calls.

Adding include "sed.h" in utils.c and recompling and re-running ltrace
shows the _unlocked() variants being used.

This improves the performance when reading the output of seq 1 1e8 from 9.5
seconds to 6.4 seconds. ie:

time sed '' < seq.1e8 >/dev/null

(on ubuntu 16.04 with skylake processor)
[Message part 2 (text/html, inline)]

Information forwarded to bug-sed <at> gnu.org:
bug#23848; Package sed. (Sun, 26 Jun 2016 02:15:01 GMT) Full text and rfc822 format available.

Message #8 received at 23848 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Tristan Verniquet <tverniquet <at> gmail.com>
Cc: 23848 <at> debbugs.gnu.org
Subject: Re: bug#23848: sed not using unlocked_stdio
Date: Sat, 25 Jun 2016 22:14:30 -0400
[Message part 1 (text/plain, inline)]
Hello Tristan,

> On Jun 25, 2016, at 08:10, Tristan Verniquet <tverniquet <at> gmail.com> wrote:
> Most reading and writing is done in utils.c, but this does not include
> sed.h or the "unlocked-io.h" header.

Thank you for the report.

The attached patch addresses the issue.
I see similar speed-ups on my system.

As sed is in the midst of several code changes, this patch is not yet pushed in to the git repository,
but I'm confident it will included in the upcoming sed-4.3 release.
I'll leave this bug 'open' until the patch is pushed.

regards,
 - assaf

[0001-sed-use-unlocked-io.patch (application/octet-stream, attachment)]

Information forwarded to bug-sed <at> gnu.org:
bug#23848; Package sed. (Sun, 26 Jun 2016 04:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 23848 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Tristan Verniquet <tverniquet <at> gmail.com>
Cc: 23848 <at> debbugs.gnu.org
Subject: Re: bug#23848: sed not using unlocked_stdio
Date: Sat, 25 Jun 2016 22:29:31 -0600
On Sat, Jun 25, 2016 at 6:10 AM, Tristan Verniquet <tverniquet <at> gmail.com> wrote:
> sed 4.2.2
>
> Most reading and writing is done in utils.c, but this does not include
> sed.h or the "unlocked-io.h" header.
>
> ltrace sed '' < <(seq 1 100)
>
> Shows lots of calls to the locked system calls.
>
> Adding include "sed.h" in utils.c and recompling and re-running ltrace
> shows the _unlocked() variants being used.
>
> This improves the performance when reading the output of seq 1 1e8 from 9.5
> seconds to 6.4 seconds. ie:
>
> time sed '' < seq.1e8 >/dev/null

Thanks for the report and the suggested fix. That sounds right, indeed.




Information forwarded to bug-sed <at> gnu.org:
bug#23848; Package sed. (Wed, 29 Jun 2016 04:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 23848 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Tristan Verniquet <tverniquet <at> gmail.com>
Cc: 23848 <at> debbugs.gnu.org
Subject: Re: bug#23848: sed not using unlocked_stdio
Date: Wed, 29 Jun 2016 00:56:40 -0400
close 23848
thanks

Hello Tristan,

The unlocked-io change has been pushed in your name, here:
  http://git.savannah.gnu.org/cgit/sed.git/commit/?id=6ad4acfbd5f1f56e6a93db476f29d299a698150e


I'm thus marking this item as 'closed'.

regards,
 - assaf





Added tag(s) fixed. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 24 Jan 2017 23:33:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 23848 <at> debbugs.gnu.org and Tristan Verniquet <tverniquet <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 24 Jan 2017 23:33:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 22 Feb 2017 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.