coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] wc: Add AVX2 optimization when counting only lines


From: Pádraig Brady
Subject: Re: [PATCH] wc: Add AVX2 optimization when counting only lines
Date: Sun, 2 May 2021 01:46:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0

On 21/04/2021 19:13, Assaf Gordon wrote:
Hello,

On 2021-03-29 7:21 a.m., Pádraig Brady wrote:

On 28/03/2021 18:29, Kristoffer Brånemyr via GNU coreutils General
I wanted to practice some more using vector intrinsics, so I made a
small AVX2 optimization for wc -l. Depending on line length it is
about 2-5x faster than previous version. (Well, only looking at user
time it is much faster than that even.)

Excellent results.
I'll review this very soon.


I'm attaching the patch (copied from the Github's pull-request),
hopefully we can continue the discussion here on the mailing list.

I plan to push the attached 2 commits tomorrow.
The first adjusts the original patch to pass `make syntax-check`.
Also I noticed an inconsistency in the new wc_lines() function,
between BUFFER_SIZE and BUFSIZ, and changed uses to the former.
The second commit, adds a --debug option to indicate
the now runtime variable behavior or which implementation is used.

cheers,
Pádraig

Attachment: wc-avx.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]