GNU bug report logs - #25427
strip-trailing-cr makes -q not be quick

Previous Next

Package: diffutils;

Reported by: Tom Vajzovic <t.gnutools <at> purposeful.co.uk>

Date: Thu, 12 Jan 2017 16:12:01 UTC

Severity: normal

To reply to this bug, email your comments to 25427 AT debbugs.gnu.org.

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-diffutils <at> gnu.org:
bug#25427; Package diffutils. (Thu, 12 Jan 2017 16:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Vajzovic <t.gnutools <at> purposeful.co.uk>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 12 Jan 2017 16:12:02 GMT) Full text and rfc822 format available.

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

From: Tom Vajzovic <t.gnutools <at> purposeful.co.uk>
To: bug-diffutils <at> gnu.org
Subject: strip-trailing-cr makes -q not be quick
Date: Thu, 12 Jan 2017 14:37:45 +0000
Hi,

I have diff aliased to 'diff -d --strip-trailing-cr'.

When I run 'diff -qs file1 file2' it takes a very long time to return
(minutes).

If I run without the -d it still takes a noticeable amount of time (a
second or two).

If I run without --strip-trailing-cr it takes next-to-no-time, whether
or not I specify -d.

These are two very large text files, but they differ within the first
few lines.

I suspect that it is calculating the whole diff internally and
discarding it when --strip-trailing-cr is given at the same time as -q.

Obviously I understand that by putting --strip-trailing-cr in an alias
I am requiring the whole file to be read and modified in memory, this
is fine.  The fact that -d has any effect though suggests that
once the line endings are processed the wrong algorithm is being
applied.  It doesn't need to run the diff algorithm, something almost
as simple as a strcmp could be used if -q is given, in which case -d
would have no effect.

Are there active developers working on diff that want to look at and
fix this?  I am a C programmer so would be happy to do it myself, but I
have never contributed to GNU tools so I might not do it the way you
would like.  I'd rather not spend time on it if you are likely to reject
it and have to re-write it yourselves anyway.

I'm using version 3.3 from Ubuntu.  Let me know if you want me to
reproduce from master.

Many thanks/best regards,

Tom Vajzovic




Information forwarded to bug-diffutils <at> gnu.org:
bug#25427; Package diffutils. (Thu, 12 Jan 2017 23:39:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Tom Vajzovic <t.gnutools <at> purposeful.co.uk>, 25427 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#25427: strip-trailing-cr makes -q not be quick
Date: Thu, 12 Jan 2017 15:38:27 -0800
On 01/12/2017 06:37 AM, Tom Vajzovic wrote:
> Are there active developers working on diff that want to look at and
> fix this?  I am a C programmer so would be happy to do it myself, but I
> have never contributed to GNU tools so I might not do it the way you
> would like.  I'd rather not spend time on it if you are likely to reject
> it and have to re-write it yourselves anyway.

That option is low on my priority list so it'd be nice if you could fix
it. Please use the style the code is already using; you can see the GNU
Coding Standards for more details. Most likely your change would be
significant enough that we'd need copyright assignment from you and your
employer; I can send you details about how to do that, privately, if you
like.





Information forwarded to bug-diffutils <at> gnu.org:
bug#25427; Package diffutils. (Sun, 22 Jan 2017 20:38:01 GMT) Full text and rfc822 format available.

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

From: Tom Vajzovic <t.gnutools <at> purposeful.co.uk>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 25427 <at> debbugs.gnu.org, Tom Vajzovic <t.gnutools <at> purposeful.co.uk>
Subject: Re: [bug-diffutils] bug#25427: strip-trailing-cr makes -q not be quick
Date: Sun, 22 Jan 2017 20:37:34 +0000
Hi,

On Thu, 12 Jan 2017 15:38:27 -0800
Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> On 01/12/2017 06:37 AM, Tom Vajzovic wrote:
> > Are there active developers working on diff that want to look at and
> > fix this?  I am a C programmer so would be happy to do it myself,
> > but I have never contributed to GNU tools so I might not do it the
> > way you would like.  I'd rather not spend time on it if you are
> > likely to reject it and have to re-write it yourselves anyway.  
> 
> That option is low on my priority list so it'd be nice if you could
> fix it. Please use the style the code is already using; you can see
> the GNU Coding Standards for more details. Most likely your change
> would be significant enough that we'd need copyright assignment from
> you and your employer; I can send you details about how to do that,
> privately, if you like.

I'll take this one then.  I'll have time to start looking at it in
about a month from now.

Tom




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

Previous Next


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