Date: Sat, 30 Jun 2012 16:53:33 -0700 From: Oleg Moskalenko <oleg.moskalenko@citrix.com> To: FreeBSD Current <freebsd-current@freebsd.org> Subject: RE: [HEADS-UP] BSD sort is the default sort in -CURRENT Message-ID: <031222CBCF33214AB2EB4ABA279428A3012CA28AEB94@SJCPMAILBOX01.citrite.net> In-Reply-To: <031222CBCF33214AB2EB4ABA279428A3012CA28AEB84@SJCPMAILBOX01.citrite.net> References: <4FEAA280.2070705@FreeBSD.org> <4FEAA599.9070107@FreeBSD.org> <031222CBCF33214AB2EB4ABA279428A3012CA28AEB6D@SJCPMAILBOX01.citrite.net> <4FEAC5B1.30104@FreeBSD.org> <4FEB6D2B.4090508@FreeBSD.org> <031222CBCF33214AB2EB4ABA279428A3012CA28AEB84@SJCPMAILBOX01.citrite.net>
next in thread | previous in thread | raw e-mail | index | archive | help
I am going to post the ministat results of my tests:
1) Text sort of 167-Mb file (1,000,000 random lines, each contains several =
fields,=20
each field is either a floating point number or a binary string with ran=
dom=20
symbols between 0 and 255).=20
Sorted on second field (-k 2,2 option):
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
x OGNU
+ NGNU
* NBSD (multi-threaded)
+--------------------------------------------------+
| x * + |
| x x * +++ |
|xxxxx x * ** * +++* * * *|
| |_A_| |_______M_|AA___________| |
+--------------------------------------------------+
N Min Max Median Avg Stddev
x 10 5.758 5.937 5.848 5.8508 0.057276716
+ 10 6.29 6.366 6.332 6.3302 0.02123833
Difference at 95.0% confidence
0.4794 +/- 0.0405862
8.19375% +/- 0.693687%
(Student's t, pooled s =3D 0.0431954)
* 10 6.067 7.228 6.225 6.3449 0.35979422
Difference at 95.0% confidence
0.4941 +/- 0.242055
8.445% +/- 4.13713%
(Student's t, pooled s =3D 0.257616)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
2) Same file, numeric sort on the same field (-k 2,2 -n option):
x OGNU.n
+ NGNU.n
* NBSD.n (multi-threaded)
+--------------------------------------------------+
|**** * x x x +++|
|**** * xx x x ++++|
| |MA_| |__A_| |A |
+--------------------------------------------------+
N Min Max Median Avg Stddev
x 10 7.142 7.338 7.216 7.2179 0.066727389
+ 10 8.231 8.307 8.271 8.2677 0.022701199
Difference at 95.0% confidence
1.0498 +/- 0.0468287
14.5444% +/- 0.648785%
(Student's t, pooled s =3D 0.0498392)
* 10 6.91 7.094 6.98 6.9864 0.061449528
Difference at 95.0% confidence
-0.2315 +/- 0.0602683
-3.2073% +/- 0.834983%
(Student's t, pooled s =3D 0.0641428)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
On these two tests, all three program produced the same output.
So, on text sort, NBSD is slightly slower than GNU; on simple numeric
sort, NBSD is slightly faster.
I did not use ministat for complex numeric sort (-g) because the performanc=
e=20
difference is huge (in favor of NBSD) and it would make no sense.
Thanks
Oleg
> -----Original Message-----
> From: owner-freebsd-current@freebsd.org [mailto:owner-freebsd-
> current@freebsd.org] On Behalf Of Oleg Moskalenko
> Sent: Wednesday, June 27, 2012 6:45 PM
> To: FreeBSD Current
> Subject: RE: [HEADS-UP] BSD sort is the default sort in -CURRENT
>=20
> Hi
>=20
> As promised, I am supplying an example of comparison between several
> sort programs.
>=20
> The test file is a randomly generated 1,000,000 lines, each line
> contain a single floating point number.
>=20
> We are going to sort it three ways - as text, as -n numeric sort, and
> as -g numeric sort, with 4 programs:
> 1) Old BSD/GNU sort 5.3.0
> 2) New GNU sort 8.15
> 3) New BSD sort, single threaded
> 4) New BSD sort, multi-threaded
>=20
> The system is a 3-CPUs system, 1.5Gb of RAM, FreeBSD version 8.2. All
> times are in seconds. Locale C.
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> TEXT SORT
>=20
> sys user real
> Old BSD/GNU sort: 0.0 1.692 2.008
> New GNU sort: 0.0 2.279 1.605
> New BSD sort, st: 0.0 1.964 2.300
> New BSD sort, mt: 0.0 2.385 1.897
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> NUMERIC SORT -n
>=20
> sys user real
> Old BSD/GNU sort: 0.0 4.357 4.674
> New GNU sort: 0.0 8.839 5.134
> New BSD sort, st: 0.0 5.308 5.592
> New BSD sort, mt: 0.0 4.581 2.489
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> NUMERIC SORT -g
>=20
> sys user real
> Old BSD/GNU sort: 0.0 45.378 45.630
> New GNU sort: ~450 ~121 ~300
> New BSD sort, st: 0.33 4.334 5.992
> New BSD sort, mt: 11.140 4.624 8.983
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Thanks
> Oleg
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-
> unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?031222CBCF33214AB2EB4ABA279428A3012CA28AEB94>
