Skip to content

Instantly share code, notes, and snippets.

@feyeleanor
Created April 13, 2013 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feyeleanor/5376454 to your computer and use it in GitHub Desktop.
Save feyeleanor/5376454 to your computer and use it in GitHub Desktop.
Run of http://github.com/feyeleanor/gospeed on 2012 Aluminium MacBook 2.5GHz Core i5 with 16GB RAM using Go 1.0.3.
bash-3.2# go test -test.bench="Benchmark" github.com/feyeleanor/gospeed
PASS
BenchmarkBaselineCastInt32ToInt 2000000000 0.34 ns/op
BenchmarkBaselineCastIntToInt32 2000000000 0.35 ns/op
BenchmarkBaselineCastInt64ToUint64 2000000000 0.34 ns/op
BenchmarkBaselineCastUint64ToInt64 2000000000 0.34 ns/op
BenchmarkBaselineVariableGet 2000000000 0.34 ns/op
BenchmarkBaselineVariableSet 2000000000 0.34 ns/op
BenchmarkBaselineVariableGetInterface 2000000000 0.34 ns/op
BenchmarkBaselineVariableSetInterface 100000000 10.4 ns/op
BenchmarkBaselineVariableIncrement 2000000000 2.00 ns/op
BenchmarkBaselineVariableDecrement 2000000000 2.00 ns/op
BenchmarkBaselineVariableIntegerAdd 2000000000 0.34 ns/op
BenchmarkBaselineVariableIntegerSubtract 2000000000 0.34 ns/op
BenchmarkBaselineVariableIntegerMultiply 2000000000 0.34 ns/op
BenchmarkBaselineVariableIntegerDivide 2000000000 0.34 ns/op
BenchmarkBaselineVariableIntegerRemainder 2000000000 0.34 ns/op
BenchmarkBaselineFieldGet 2000000000 0.34 ns/op
BenchmarkBaselineFieldSet 2000000000 0.34 ns/op
BenchmarkBaselineSliceGet 2000000000 0.68 ns/op
BenchmarkBaselineSliceSet 2000000000 0.68 ns/op
BenchmarkBaselineMethodGetSlice 200000000 9.22 ns/op
BenchmarkBaselineMethodSetSlice 200000000 8.69 ns/op
BenchmarkBaselineMethodInterfaceGetSlice 100000000 12.3 ns/op
BenchmarkBaselineMethodInterfaceSetSlice 100000000 12.7 ns/op
BenchmarkBaselineMapIntGet 50000000 34.6 ns/op
BenchmarkBaselineMapIntSet 50000000 59.7 ns/op
BenchmarkBaselineMapStringGet 50000000 32.6 ns/op
BenchmarkBaselineMapStringSet 50000000 60.1 ns/op
BenchmarkBaselineIf 2000000000 0.66 ns/op
BenchmarkBaselineIfElse 2000000000 0.67 ns/op
BenchmarkBaselineSwitchDefault 2000000000 0.34 ns/op
BenchmarkBaselineSwitchOneCase 2000000000 0.67 ns/op
BenchmarkBaselineSwitchTwoCases 2000000000 1.33 ns/op
BenchmarkBaselineSwitchTwoCasesFallthrough 2000000000 1.60 ns/op
BenchmarkBaselineForLoopIteration 2000000000 1.03 ns/op
BenchmarkBaselineForReverseLoopIteration 2000000000 1.00 ns/op
BenchmarkBaselineForRange 2000000000 1.35 ns/op
BenchmarkBaselineForSliceLength 2000000000 1.01 ns/op
BenchmarkBaselineForReverseSliceLength 2000000000 1.01 ns/op
BenchmarkBaselineForLoopIteration10 100000000 10.1 ns/op
BenchmarkBaselineForReverseLoopIteration10 500000000 5.13 ns/op
BenchmarkBaselineForRange10 500000000 6.30 ns/op
BenchmarkBaselineForSliceLength10 500000000 5.36 ns/op
BenchmarkBaselineForReverseSliceLength10 500000000 5.27 ns/op
BenchmarkBaselineForLoopIteration100 50000000 54.1 ns/op
BenchmarkBaselineForReverseLoopIteration100 50000000 55.0 ns/op
BenchmarkBaselineForRange100 50000000 53.7 ns/op
BenchmarkBaselineForSliceLength100 50000000 54.0 ns/op
BenchmarkBaselineForReverseSliceLength100 50000000 50.1 ns/op
BenchmarkBaselineForLoopIteration10000 500000 3437 ns/op
BenchmarkBaselineForReverseLoopIteration10000 500000 3532 ns/op
BenchmarkBaselineForRange10000 500000 3743 ns/op
BenchmarkBaselineForSliceLength10000 500000 3375 ns/op
BenchmarkBaselineForReverseSliceLength10000 500000 3391 ns/op
BenchmarkBaselineMakeChannelBoolUnbuffered 10000000 139 ns/op
BenchmarkBaselineMakeChannelBool1 10000000 129 ns/op
BenchmarkBaselineMakeChannelBool10 20000000 131 ns/op
BenchmarkBaselineMakeChannelStringUnbuffered 20000000 132 ns/op
BenchmarkBaselineMakeChannelString1 20000000 137 ns/op
BenchmarkBaselineMakeChannelString10 10000000 209 ns/op
BenchmarkBaselineGo 1000000 3179 ns/op
BenchmarkBaselineChannelClose 10000000 264 ns/op
BenchmarkBaselineSyncBoolChannelWrite1 2000000 759 ns/op
BenchmarkBaselineSyncBoolChannelWrite10 1000000 2391 ns/op
BenchmarkBaselineASyncBoolChannelWrite1 10000000 302 ns/op
BenchmarkBaselineASyncBoolChannelWrite10 5000000 610 ns/op
BenchmarkBaselineSyncStringChannelWrite1 5000000 746 ns/op
BenchmarkBaselineSyncStringChannelWrite10 1000000 2405 ns/op
BenchmarkBaselineASyncStringChannelWrite1 5000000 308 ns/op
BenchmarkBaselineASyncStringChannelWrite10 5000000 657 ns/op
BenchmarkBaselineFunctionCall 500000000 3.02 ns/op
BenchmarkBaselineFunctionCallArg 100000000 13.4 ns/op
BenchmarkBaselineFunctionCall5VarArgs 20000000 195 ns/op
BenchmarkBaselineFunctionCallInt 1000000000 3.14 ns/op
BenchmarkBaselineFunctionCall5VarInts 50000000 111 ns/op
BenchmarkBaselineFunctionCallWithDefer 10000000 207 ns/op
BenchmarkBaselineFunctionCallPanicRecover 5000000 350 ns/op
BenchmarkBaselineMethodCallDirect 200000000 8.77 ns/op
BenchmarkBaselineMethodCallDirect1Arg 100000000 19.3 ns/op
BenchmarkBaselineMethodCallDirect1Int 200000000 8.45 ns/op
BenchmarkBaselineMethodCallDirect5Args 20000000 200 ns/op
BenchmarkBaselineMethodCallDirect5Ints 50000000 115 ns/op
BenchmarkBaselineMethodCallIndirect 2000000000 0.35 ns/op
BenchmarkBaselineMethodCallIndirect1Arg 100000000 10.3 ns/op
BenchmarkBaselineMethodCallIndirect1Int 2000000000 0.34 ns/op
BenchmarkBaselineMethodCallIndirect5Args 20000000 194 ns/op
BenchmarkBaselineMethodCallIndirect5Ints 50000000 110 ns/op
BenchmarkBaselineTypeAssertion 100000000 14.2 ns/op
BenchmarkBaselineTypeAssertionEmptyInterface 500000000 5.71 ns/op
BenchmarkBaselineTypeAssertionInterface1 100000000 23.2 ns/op
BenchmarkBaselineTypeAssertionInterface2 100000000 20.3 ns/op
BenchmarkBaselineTypeReflectPrimitiveToValue 50000000 32.2 ns/op
BenchmarkBaselineTypeReflectSliceToValue 20000000 122 ns/op
BenchmarkBaselineTypeReflectStructToValue 10000000 167 ns/op
BenchmarkBaselineTypeCheck 100000000 10.4 ns/op
BenchmarkBaselineTypeCheckEmptyInterface 500000000 4.43 ns/op
BenchmarkBaselineTypeCheckInterface1 100000000 18.2 ns/op
BenchmarkBaselineTypeCheckInterface2 100000000 18.6 ns/op
BenchmarkBaselineTypeSwitchOneCase 100000000 13.4 ns/op
BenchmarkBaselineTypeSwitchBasicTypesCase 100000000 16.8 ns/op
BenchmarkBaselineTypeSwitchEmptyInterface 500000000 7.17 ns/op
BenchmarkBaselineTypeSwitchInterface1 100000000 22.8 ns/op
BenchmarkBaselineTypeSwitchInterface2 100000000 21.6 ns/op
BenchmarkBaselineNewStructureLiteral 200000000 9.40 ns/op
BenchmarkBaselineNewStructure 100000000 17.3 ns/op
BenchmarkBaselineNewSliceLiteral 500000000 3.86 ns/op
BenchmarkBaselineNewSlice 50000000 92.5 ns/op
BenchmarkBaselineNewMapLiteralIntToInt 10000000 313 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface 10000000 342 ns/op
BenchmarkBaselineNewMapLiteralStringToInt 10000000 323 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface 10000000 358 ns/op
BenchmarkBaselineNewMapLiteralIntToInt2Item 5000000 495 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface2Item 5000000 561 ns/op
BenchmarkBaselineNewMapLiteralStringToInt2Item 5000000 477 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface2Item 5000000 516 ns/op
BenchmarkBaselineNewMapIntToInt 10000000 313 ns/op
BenchmarkBaselineNewMapIntToInterface 10000000 348 ns/op
BenchmarkBaselineNewMapStringToInt 10000000 329 ns/op
BenchmarkBaselineNewMapStringToInterface 10000000 350 ns/op
BenchmarkBaselineSliceCopy 50000000 38.5 ns/op
BenchmarkBaselineNewSliceAppendElement1 20000000 104 ns/op
BenchmarkBaselineNewSliceAppendElement10 10000000 193 ns/op
ok github.com/feyeleanor/gospeed 349.670s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment