Skip to content

Instantly share code, notes, and snippets.

@feyeleanor
Created May 17, 2013 19:08
Show Gist options
  • Save feyeleanor/5601249 to your computer and use it in GitHub Desktop.
Save feyeleanor/5601249 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.1
eleanor$ 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.37 ns/op
BenchmarkBaselineCastUint64ToInt64 2000000000 0.34 ns/op
BenchmarkBaselineVariableGet 2000000000 0.34 ns/op
BenchmarkBaselineVariableSet 2000000000 0.35 ns/op
BenchmarkBaselineVariableGetInterface 2000000000 0.34 ns/op
BenchmarkBaselineVariableSetInterface 2000000000 0.69 ns/op
BenchmarkBaselineVariableIncrement 1000000000 1.99 ns/op
BenchmarkBaselineVariableDecrement 1000000000 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.10 ns/op
BenchmarkBaselineMethodSetSlice 200000000 9.53 ns/op
BenchmarkBaselineMethodInterfaceGetSlice 100000000 13.8 ns/op
BenchmarkBaselineMethodInterfaceSetSlice 100000000 11.9 ns/op
BenchmarkBaselineMapIntGet 100000000 18.2 ns/op
BenchmarkBaselineMapIntSet 50000000 39.5 ns/op
BenchmarkBaselineMapStringGet 100000000 24.1 ns/op
BenchmarkBaselineMapStringSet 50000000 45.6 ns/op
BenchmarkBaselineIf 2000000000 0.67 ns/op
BenchmarkBaselineIfElse 2000000000 0.67 ns/op
BenchmarkBaselineSwitchDefault 2000000000 0.34 ns/op
BenchmarkBaselineSwitchOneCase 2000000000 0.70 ns/op
BenchmarkBaselineSwitchTwoCases 2000000000 1.48 ns/op
BenchmarkBaselineSwitchTwoCasesFallthrough 2000000000 1.36 ns/op
BenchmarkBaselineForLoopIteration 2000000000 1.01 ns/op
BenchmarkBaselineForReverseLoopIteration 2000000000 1.01 ns/op
BenchmarkBaselineForRange 2000000000 1.01 ns/op
BenchmarkBaselineForSliceLength 2000000000 1.03 ns/op
BenchmarkBaselineForReverseSliceLength 2000000000 1.01 ns/op
BenchmarkBaselineForLoopIteration10 100000000 10.0 ns/op
BenchmarkBaselineForReverseLoopIteration10 500000000 5.34 ns/op
BenchmarkBaselineForRange10 500000000 4.86 ns/op
BenchmarkBaselineForSliceLength10 500000000 4.97 ns/op
BenchmarkBaselineForReverseSliceLength10 500000000 4.96 ns/op
BenchmarkBaselineForLoopIteration100 50000000 54.8 ns/op
BenchmarkBaselineForReverseLoopIteration100 50000000 63.9 ns/op
BenchmarkBaselineForRange100 50000000 54.2 ns/op
BenchmarkBaselineForSliceLength100 50000000 54.1 ns/op
BenchmarkBaselineForReverseSliceLength100 50000000 54.3 ns/op
BenchmarkBaselineForLoopIteration10000 500000 4247 ns/op
BenchmarkBaselineForReverseLoopIteration10000 500000 3408 ns/op
BenchmarkBaselineForRange10000 500000 3380 ns/op
BenchmarkBaselineForSliceLength10000 500000 3512 ns/op
BenchmarkBaselineForReverseSliceLength10000 500000 3397 ns/op
BenchmarkBaselineMakeChannelBoolUnbuffered 20000000 120 ns/op
BenchmarkBaselineMakeChannelBool1 20000000 118 ns/op
BenchmarkBaselineMakeChannelBool10 10000000 139 ns/op
BenchmarkBaselineMakeChannelStringUnbuffered 20000000 127 ns/op
BenchmarkBaselineMakeChannelString1 10000000 141 ns/op
BenchmarkBaselineMakeChannelString10 10000000 177 ns/op
BenchmarkBaselineGo 1000000 23467 ns/op
BenchmarkBaselineChannelClose 50000000 55.1 ns/op
BenchmarkBaselineSyncBoolChannelWrite1 5000000 487 ns/op
BenchmarkBaselineSyncBoolChannelWrite10 1000000 1917 ns/op
BenchmarkBaselineASyncBoolChannelWrite1 20000000 94.8 ns/op
BenchmarkBaselineASyncBoolChannelWrite10 5000000 464 ns/op
BenchmarkBaselineSyncStringChannelWrite1 5000000 477 ns/op
BenchmarkBaselineSyncStringChannelWrite10 1000000 1921 ns/op
BenchmarkBaselineASyncStringChannelWrite1 20000000 95.1 ns/op
BenchmarkBaselineASyncStringChannelWrite10 5000000 479 ns/op
BenchmarkBaselineFunctionCall 1000000000 2.68 ns/op
BenchmarkBaselineFunctionCallArg 1000000000 2.68 ns/op
BenchmarkBaselineFunctionCall5VarArgs 20000000 137 ns/op
BenchmarkBaselineFunctionCallInt 1000000000 2.40 ns/op
BenchmarkBaselineFunctionCall5VarInts 50000000 100.0 ns/op
BenchmarkBaselineFunctionCallWithDefer 20000000 138 ns/op
BenchmarkBaselineFunctionCallPanicRecover 10000000 268 ns/op
BenchmarkBaselineMethodCallDirect 200000000 8.44 ns/op
BenchmarkBaselineMethodCallDirect1Arg 200000000 8.82 ns/op
BenchmarkBaselineMethodCallDirect1Int 200000000 8.46 ns/op
BenchmarkBaselineMethodCallDirect5Args 100000000 22.7 ns/op
BenchmarkBaselineMethodCallDirect5Ints 100000000 27.9 ns/op
BenchmarkBaselineMethodCallIndirect 2000000000 0.37 ns/op
BenchmarkBaselineMethodCallIndirect1Arg 2000000000 0.68 ns/op
BenchmarkBaselineMethodCallIndirect1Int 2000000000 0.46 ns/op
BenchmarkBaselineMethodCallIndirect5Args 100000000 14.1 ns/op
BenchmarkBaselineMethodCallIndirect5Ints 100000000 22.0 ns/op
BenchmarkBaselineTypeAssertion 100000000 13.5 ns/op
BenchmarkBaselineTypeAssertionEmptyInterface 500000000 4.59 ns/op
BenchmarkBaselineTypeAssertionInterface1 100000000 19.0 ns/op
BenchmarkBaselineTypeAssertionInterface2 100000000 19.1 ns/op
BenchmarkBaselineTypeReflectPrimitiveToValue 500000000 5.58 ns/op
BenchmarkBaselineTypeReflectSliceToValue 50000000 84.7 ns/op
BenchmarkBaselineTypeReflectStructToValue 20000000 150 ns/op
BenchmarkBaselineTypeCheck 500000000 3.05 ns/op
BenchmarkBaselineTypeCheckEmptyInterface 500000000 3.43 ns/op
BenchmarkBaselineTypeCheckInterface1 100000000 17.2 ns/op
BenchmarkBaselineTypeCheckInterface2 100000000 17.9 ns/op
BenchmarkBaselineTypeSwitchOneCase 500000000 5.44 ns/op
BenchmarkBaselineTypeSwitchBasicTypesCase 200000000 8.77 ns/op
BenchmarkBaselineTypeSwitchEmptyInterface 500000000 5.71 ns/op
BenchmarkBaselineTypeSwitchInterface1 100000000 20.0 ns/op
BenchmarkBaselineTypeSwitchInterface2 100000000 20.1 ns/op
BenchmarkBaselineNewStructureLiteral 200000000 8.45 ns/op
BenchmarkBaselineNewStructure 100000000 17.5 ns/op
BenchmarkBaselineNewSliceLiteral 1000000000 2.90 ns/op
BenchmarkBaselineNewSlice 50000000 79.9 ns/op
BenchmarkBaselineNewMapLiteralIntToInt 20000000 157 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface 20000000 159 ns/op
BenchmarkBaselineNewMapLiteralStringToInt 20000000 157 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface 20000000 162 ns/op
BenchmarkBaselineNewMapLiteralIntToInt2Item 10000000 403 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface2Item 5000000 482 ns/op
BenchmarkBaselineNewMapLiteralStringToInt2Item 5000000 580 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface2Item 5000000 552 ns/op
BenchmarkBaselineNewMapIntToInt 20000000 162 ns/op
BenchmarkBaselineNewMapIntToInterface 20000000 161 ns/op
BenchmarkBaselineNewMapStringToInt 20000000 162 ns/op
BenchmarkBaselineNewMapStringToInterface 20000000 158 ns/op
BenchmarkBaselineSliceCopy 50000000 35.8 ns/op
BenchmarkBaselineNewSliceAppendElement1 20000000 116 ns/op
BenchmarkBaselineNewSliceAppendElement10 20000000 211 ns/op
ok github.com/feyeleanor/gospeed 499.845s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment