GNU bug report logs -
#20745
sort: add options to sort by IPv4/IPv6
Previous Next
Full log
Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):
2015-06-08 08:14:20 -0600, Eric Blake:
> On 06/08/2015 05:14 AM, Stephane Chazelas wrote:
>
> > Maybe there's a way to allow that without having to implement
> > the specifics in sort.
> >
> > Like sort key flags to invoke commands:
> >
> > sort '-k1,1|ip2hex' '-k2,2n|roman2int' '-k3,3|iconv -t us//TRANSLIT'
>
> That would result in a LOT of process overhead (one command spawned per
> sort key per line). True, it would be more generic, but the performance
> would suffer compared to having a direct way to do the sorting within
> the current process. It's going to be more efficient to do a single
> pre-process pass, then sort, then post-process, with a complicated
> script language doing the right processing per field in a single pass,
> than to do one conversion per key per row.
[...]
I'm not suggesting one process per line. Those are meant to be
filters processing the whole input, so one ip2hex process, one
roman2int... That would have to be done carefully to avoid
deadlocks, but should be efficient if done properly (with proper
buffering).
The idea being to implement the cumbersome plumbing in my
previous yash approach inside sort.
--
Stephane
This bug report was last modified 6 years and 243 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.