A new sort utility

2003-09-15 Thread Tim Robbins
The recent thread about BSD-licensed replacements for GNU utilities in OpenBSD
has prompted me to share my reimplementation of the sort(1) utility.
Most of the code is new. sort.1 and obsolete.c came from 4.4BSD via NetBSD.
I've been using it instead of GNU sort on my systems for the past few months,
I've run a few test suites on it, and I think most of the bugs have been
ironed out now.  If anyone's interested, it's available here:
http://people.freebsd.org/~tjr/sort1.tar.gz

It's not quite as fast as the GNU or 4.4BSD sort implementations, but it's
BSD-licensed, follows the normal BSD coding conventions, has better locale
support than 4.4BSD's (and perhaps GNU's, too), and I believe it's much less
buggy than the 4.4BSD sort (sort -n is horribly broken in 4.4BSD's, see the
NetBSD PR database for an example). It attempts to conform to the POSIX
standards; by default it follows 1003.2-1992, removing the CFLAGS+=-DOBSOLETE
line in the Makefile will make it follow 1003.1-2001.

Comments/patches are welcome. As the History suggestion of the manual page
suggests, my plan is to get this in to FreeBSD 6, along with replacements for
some other GNU tools. I have a diff(1) replacement (with sdiff support) in
the works, among other things.


Tim
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Soren Schmidt
It seems Tim Robbins wrote:
 Comments/patches are welcome. As the History suggestion of the manual page
 suggests, my plan is to get this in to FreeBSD 6, along with replacements for
 some other GNU tools. I have a diff(1) replacement (with sdiff support) in
 the works, among other things.

Go for it!! the more GPL'd stuff we can remove the better!!

-Søren
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Kris Kennaway
On Mon, Sep 15, 2003 at 08:53:56PM +1000, Tim Robbins wrote:

 It's not quite as fast as the GNU or 4.4BSD sort implementations

Why is this?

I often need to sort huge files, so I'd be reluctant to use an
implementation with a significant performance penalty.

Kris


pgp0.pgp
Description: PGP signature


Re: A new sort utility

2003-09-15 Thread Tim Robbins
On Mon, Sep 15, 2003 at 11:43:07AM -0700, Kris Kennaway wrote:

 On Mon, Sep 15, 2003 at 08:53:56PM +1000, Tim Robbins wrote:
 
  It's not quite as fast as the GNU or 4.4BSD sort implementations
 
 Why is this?

Because it spends too much time comparing lines. In particular, it seems to be
spending a lot of time extracting the specified fields from lines, even when
no -k options are specified.

It's also more general than the 4.4BSD implementation, which can't sort
according to the locale's LC_COLLATE settings, and has a lot of difficulty
sorting numbers (with the -n option) properly. If speed was everything, we'd
already be using that one -- it's significantly faster than GNU.

 I often need to sort huge files, so I'd be reluctant to use an
 implementation with a significant performance penalty.

It would be great if you could compare my sort against GNU on some real world
data and let me know how it goes.


Tim
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Garance A Drosihn
At 8:53 PM +1000 9/15/03, Tim Robbins wrote:
Comments/patches are welcome. As the History suggestion
of the manual page suggests, my plan is to get this in to
FreeBSD 6, along with replacements for some other GNU tools.
Might we put this in freebsd-current (5.x), but under some
other name?  sortbsd, or something?
--
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Edwin Groothuis
On Mon, Sep 15, 2003 at 08:24:00PM -0400, Garance A Drosihn wrote:
 At 8:53 PM +1000 9/15/03, Tim Robbins wrote:
 Comments/patches are welcome. As the History suggestion
 of the manual page suggests, my plan is to get this in to
 FreeBSD 6, along with replacements for some other GNU tools.
 
 Might we put this in freebsd-current (5.x), but under some
 other name?  sortbsd, or something?

ports/sysutils/bsdutils-tjr

And of course with the option to overwrite the base installed stuff :-)

Edwin

-- 
Edwin Groothuis  |Personal website: http://www.mavetju.org
[EMAIL PROTECTED]|Weblog: http://www.mavetju.org/weblog/weblog.php 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Richard Coleman
Garance A Drosihn wrote:
At 8:53 PM +1000 9/15/03, Tim Robbins wrote:

Comments/patches are welcome. As the History suggestion
of the manual page suggests, my plan is to get this in to
FreeBSD 6, along with replacements for some other GNU tools.
Might we put this in freebsd-current (5.x), but under some
other name?  sortbsd, or something?
Why would you want to do that?  Unless the performance difference is 
huge, I don't see the problem.

Since the number of people that really that extra 10% (or whatever) of 
speed (for sort) is small, I would suggest the reverse.  Replace the 
current sort with the BSD licensed version, and move the current one to 
a port gnu-sort, or whatever.

I suddenly feel the need to go build a bikeshed.

Richard Coleman
[EMAIL PROTECTED]


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Doug Barton
On Mon, 15 Sep 2003, Richard Coleman wrote:

 Garance A Drosihn wrote:
  At 8:53 PM +1000 9/15/03, Tim Robbins wrote:
 
  Comments/patches are welcome. As the History suggestion
  of the manual page suggests, my plan is to get this in to
  FreeBSD 6, along with replacements for some other GNU tools.
 
  Might we put this in freebsd-current (5.x), but under some
  other name?  sortbsd, or something?

 Why would you want to do that?  Unless the performance difference is
 huge, I don't see the problem.

 Since the number of people that really that extra 10% (or whatever) of
 speed (for sort) is small, I would suggest the reverse.  Replace the
 current sort with the BSD licensed version, and move the current one to
 a port gnu-sort, or whatever.

This was exactly what I was thinking. Tim, can you mail -arch with this
proposal?

Doug

-- 

This .signature sanitized for your protection

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A new sort utility

2003-09-15 Thread Garance A Drosihn
At 9:47 PM -0400 9/15/03, Richard Coleman wrote:
Garance A Drosihn wrote:
At 8:53 PM +1000 9/15/03, Tim Robbins wrote:

Comments/patches are welcome. As the History suggestion
of the manual page suggests, my plan is to get this in to
FreeBSD 6, along with replacements for some other GNU tools.
Might we put this in freebsd-current (5.x), but under some
other name?  sortbsd, or something?
Why would you want to do that?
Just so we could have it in 5.x, instead of the stated plan
of waiting until 6.x.  I do not feel strongly about it, other
than to say that it'd be nice if this was part of 5.x, and I
don't know if we want to switch to rewrite of 'sort' at this
point in 5.x.  *Someday* we've got to stop dropping in major
changes to 5.x, and get serious about releasing it as -stable
so we can start on 6.x-current.
Just my 2 cents.  I don't feel strongly about it.

--
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]