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

Convert switch block to if block #18

Merged
merged 1 commit into from
Nov 23, 2015
Merged

Convert switch block to if block #18

merged 1 commit into from
Nov 23, 2015

Conversation

dsnet
Copy link
Contributor

@dsnet dsnet commented Nov 22, 2015

Switch statements cannot be inlined. If statements can. Reference:
golang/go#7655
golang/go#13071

BenchmarkEncodeDigitsSpeed1e4-4        52.22        53.77        1.03x
BenchmarkEncodeDigitsSpeed1e5-4        55.01        57.05        1.04x
BenchmarkEncodeDigitsSpeed1e6-4        54.36        57.03        1.05x
BenchmarkEncodeDigitsDefault1e4-4      20.33        20.38        1.00x
BenchmarkEncodeDigitsDefault1e5-4      11.65        11.71        1.01x
BenchmarkEncodeDigitsDefault1e6-4      10.68        10.78        1.01x
BenchmarkEncodeDigitsCompress1e4-4     20.38        20.77        1.02x
BenchmarkEncodeDigitsCompress1e5-4     11.65        11.85        1.02x
BenchmarkEncodeDigitsCompress1e6-4     10.76        10.97        1.02x
BenchmarkEncodeTwainSpeed1e4-4         46.40        47.77        1.03x
BenchmarkEncodeTwainSpeed1e5-4         57.42        59.34        1.03x
BenchmarkEncodeTwainSpeed1e6-4         58.72        61.09        1.04x
BenchmarkEncodeTwainDefault1e4-4       18.69        18.91        1.01x
BenchmarkEncodeTwainDefault1e5-4       11.64        11.85        1.02x
BenchmarkEncodeTwainDefault1e6-4       10.87        10.87        1.00x
BenchmarkEncodeTwainCompress1e4-4      18.61        18.81        1.01x
BenchmarkEncodeTwainCompress1e5-4      10.34        10.50        1.02x
BenchmarkEncodeTwainCompress1e6-4      9.58         9.69         1.01x

Switch statements cannot be inlined. If statements can. Reference:
	golang/go#7655
	golang/go#13071

BenchmarkEncodeDigitsSpeed1e4-4        52.22        53.77        1.03x
BenchmarkEncodeDigitsSpeed1e5-4        55.01        57.05        1.04x
BenchmarkEncodeDigitsSpeed1e6-4        54.36        57.03        1.05x
BenchmarkEncodeDigitsDefault1e4-4      20.33        20.38        1.00x
BenchmarkEncodeDigitsDefault1e5-4      11.65        11.71        1.01x
BenchmarkEncodeDigitsDefault1e6-4      10.68        10.78        1.01x
BenchmarkEncodeDigitsCompress1e4-4     20.38        20.77        1.02x
BenchmarkEncodeDigitsCompress1e5-4     11.65        11.85        1.02x
BenchmarkEncodeDigitsCompress1e6-4     10.76        10.97        1.02x
BenchmarkEncodeTwainSpeed1e4-4         46.40        47.77        1.03x
BenchmarkEncodeTwainSpeed1e5-4         57.42        59.34        1.03x
BenchmarkEncodeTwainSpeed1e6-4         58.72        61.09        1.04x
BenchmarkEncodeTwainDefault1e4-4       18.69        18.91        1.01x
BenchmarkEncodeTwainDefault1e5-4       11.64        11.85        1.02x
BenchmarkEncodeTwainDefault1e6-4       10.87        10.87        1.00x
BenchmarkEncodeTwainCompress1e4-4      18.61        18.81        1.01x
BenchmarkEncodeTwainCompress1e5-4      10.34        10.50        1.02x
BenchmarkEncodeTwainCompress1e6-4      9.58         9.69         1.01x
@klauspost
Copy link
Owner

Thanks a lot!

klauspost added a commit that referenced this pull request Nov 23, 2015
Convert switch block to if block
@klauspost klauspost merged commit 1d1e1cb into klauspost:master Nov 23, 2015
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.

None yet

2 participants