]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sort(1): Memoize MD5 computation to reduce repeated computation
authorcem <cem@FreeBSD.org>
Sat, 13 Apr 2019 04:42:17 +0000 (04:42 +0000)
committercem <cem@FreeBSD.org>
Sat, 13 Apr 2019 04:42:17 +0000 (04:42 +0000)
commit7474baafb6d06f306b747637efcf4e3e90d013bf
tree574cb1668a31c9c17da36af88efefd6dd0313c42
parent7061ad58c27321bc3a68bd776a871f0b260a4935
sort(1): Memoize MD5 computation to reduce repeated computation

Experimentally, reduces sort -R time of a 148160 line corpus from about
3.15s to about 0.93s on this particular system.

There's probably room for improvement using some digest other than md5, but
I don't want to look at sort(1) anymore.  Some discussion of other possible
improvements in the Test Plan section of the Differential.

PR: 230792
Reviewed by: jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D19885
usr.bin/sort/coll.c
usr.bin/sort/coll.h
usr.bin/sort/sort.c