bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] How awk keys are ordered?


From: Peng Yu
Subject: Re: [bug-gawk] How awk keys are ordered?
Date: Wed, 21 Dec 2016 15:22:02 -0600

> PROCINFO["sorted_in"]

With any values other than "@unsorted", it seems that gawk will need
to do some sorting. So this will incur some runtime overhead?

Why my original example which uses just the default seems to have keys
sorted numerically despite the default is "@unsorted"? What is the
hash algorithm used by gawk?

~$ gawk -e 'BEGIN {for(i=1;i<10000000;++i) a[i]=1; for(i in a) print
i}' > /tmp/tmp1.txt
~$ diff <(sort -k 1,1n < /tmp/tmp1.txt ) /tmp/tmp1.txt

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]