Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use quickSort from sort.Sort #207

Merged
merged 6 commits into from
Jan 16, 2020

Conversation

luyu6056
Copy link
Contributor

It's simple copy from sort.Sort

@klauspost
Copy link
Owner

klauspost commented Jan 15, 2020

It seems like the code isn't formatted.

Do you have any numbers?

Copy link
Owner

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Could you remove the old fields?

flate/huffman_code.go Outdated Show resolved Hide resolved
@klauspost
Copy link
Owner

Very nice. Tested on my laptop, so numbers are not super accurate, but the trend is clear:

name                        old speed      new speed       delta
EncodeDigitsConstant1e4-12   308MB/s ± 2%    349MB/s ± 1%  +13.33%  (p=0.001 n=3+3)
EncodeDigitsConstant1e5-12   280MB/s ± 1%    326MB/s ± 0%  +16.46%  (p=0.001 n=3+3)
EncodeDigitsConstant1e6-12   335MB/s ± 3%    368MB/s ± 1%   +9.69%  (p=0.012 n=3+3)
EncodeDigitsSpeed1e4-12      105MB/s ±11%    132MB/s ± 1%  +26.09%  (p=0.044 n=3+3)
EncodeDigitsSpeed1e5-12     89.8MB/s ± 5%  102.8MB/s ± 0%  +14.39%  (p=0.037 n=3+3)
EncodeDigitsSpeed1e6-12     97.6MB/s ± 2%  102.9MB/s ± 0%   +5.49%  (p=0.045 n=3+3)
EncodeDigitsDefault1e4-12   63.6MB/s ± 0%   65.6MB/s ± 0%   +3.16%  (p=0.001 n=3+3)
EncodeDigitsDefault1e5-12   58.3MB/s ± 1%   60.4MB/s ± 1%   +3.71%  (p=0.002 n=3+3)
EncodeDigitsDefault1e6-12   55.6MB/s ± 3%   59.2MB/s ± 0%     ~     (p=0.059 n=3+3)
EncodeDigitsCompress1e4-12  42.1MB/s ± 6%   45.8MB/s ± 0%     ~     (p=0.093 n=3+3)
EncodeDigitsCompress1e5-12  25.6MB/s ± 2%   26.5MB/s ± 1%     ~     (p=0.069 n=3+3)
EncodeDigitsCompress1e6-12  23.4MB/s ± 2%   24.6MB/s ± 1%   +5.14%  (p=0.015 n=3+3)
EncodeDigitsSL1e4-12        65.5MB/s ± 1%   76.4MB/s ± 0%  +16.70%  (p=0.000 n=3+3)
EncodeDigitsSL1e5-12         108MB/s ± 1%    112MB/s ± 0%   +3.36%  (p=0.015 n=3+3)
EncodeDigitsSL1e6-12         117MB/s ± 3%    120MB/s ± 0%     ~     (p=0.178 n=3+3)
EncodeTwainConstant1e4-12    228MB/s ± 0%    255MB/s ± 1%  +11.61%  (p=0.002 n=3+3)
EncodeTwainConstant1e5-12    275MB/s ± 0%    289MB/s ± 1%   +5.00%  (p=0.005 n=3+3)
EncodeTwainConstant1e6-12    330MB/s ± 1%    339MB/s ± 1%   +2.87%  (p=0.029 n=3+3)
EncodeTwainSpeed1e4-12      90.6MB/s ± 1%   98.5MB/s ± 0%   +8.73%  (p=0.003 n=3+3)
EncodeTwainSpeed1e5-12       100MB/s ± 1%    104MB/s ± 1%   +4.98%  (p=0.000 n=3+3)
EncodeTwainSpeed1e6-12       107MB/s ± 1%    112MB/s ± 0%   +4.55%  (p=0.010 n=3+3)
EncodeTwainDefault1e4-12    61.6MB/s ± 0%   65.9MB/s ± 1%   +7.12%  (p=0.001 n=3+3)
EncodeTwainDefault1e5-12    63.4MB/s ± 2%   68.5MB/s ± 0%   +8.11%  (p=0.008 n=3+3)
EncodeTwainDefault1e6-12    63.1MB/s ± 2%   67.1MB/s ± 2%   +6.41%  (p=0.013 n=3+3)
EncodeTwainCompress1e4-12   35.5MB/s ± 0%   37.3MB/s ± 0%   +5.00%  (p=0.000 n=3+3)
EncodeTwainCompress1e5-12   19.9MB/s ± 2%   20.9MB/s ± 1%   +4.84%  (p=0.014 n=3+3)
EncodeTwainCompress1e6-12   18.2MB/s ± 2%   19.0MB/s ± 0%   +4.44%  (p=0.049 n=3+3)
EncodeTwainSL1e4-12         61.7MB/s ± 1%   70.8MB/s ± 0%  +14.76%  (p=0.002 n=3+3)
EncodeTwainSL1e5-12          107MB/s ± 0%    111MB/s ± 0%   +3.32%  (p=0.004 n=3+3)
EncodeTwainSL1e6-12          119MB/s ± 0%    120MB/s ± 1%   +1.36%  (p=0.047 n=3+3)

@klauspost klauspost merged commit 1901a5f into klauspost:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants