Skip to content

Instantly share code, notes, and snippets.

@feyeleanor
Created August 30, 2012 15:34
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/3531076 to your computer and use it in GitHub Desktop.
Save feyeleanor/3531076 to your computer and use it in GitHub Desktop.
GoSpeed benchmarks on a 13" MBP mid-2012 with 16GB RAM and 2.5 GHz Intel Core i5
BenchmarkBaselineCastInt32ToInt 2000000000 0.33 ns/op
BenchmarkBaselineCastIntToInt32 2000000000 0.33 ns/op
BenchmarkBaselineCastInt64ToUint64 2000000000 0.33 ns/op
BenchmarkBaselineCastUint64ToInt64 2000000000 0.33 ns/op
BenchmarkBaselineVariableGet 2000000000 0.33 ns/op
BenchmarkBaselineVariableSet 2000000000 0.33 ns/op
BenchmarkBaselineVariableGetInterface 2000000000 0.33 ns/op
BenchmarkBaselineVariableSetInterface 100000000 34.6 ns/op
BenchmarkBaselineVariableIncrement 2000000000 1.98 ns/op
BenchmarkBaselineVariableDecrement 2000000000 1.98 ns/op
BenchmarkBaselineFieldGet 2000000000 0.33 ns/op
BenchmarkBaselineFieldSet 2000000000 0.33 ns/op
BenchmarkBaselineSliceGet 2000000000 0.82 ns/op
BenchmarkBaselineSliceSet 2000000000 0.66 ns/op
BenchmarkBaselineMapIntGet 50000000 35.5 ns/op
BenchmarkBaselineMapIntSet 50000000 58.4 ns/op
BenchmarkBaselineMapStringGet 50000000 35.3 ns/op
BenchmarkBaselineMapStringSet 50000000 60.0 ns/op
BenchmarkBaselineIf 2000000000 0.66 ns/op
BenchmarkBaselineIfElse 2000000000 0.66 ns/op
BenchmarkBaselineSwitchDefault 2000000000 0.33 ns/op
BenchmarkBaselineSwitchOneCase 2000000000 0.66 ns/op
BenchmarkBaselineSwitchTwoCases 2000000000 1.33 ns/op
BenchmarkBaselineSwitchTwoCasesFallthrough 2000000000 1.33 ns/op
BenchmarkBaselineForLoopIteration 2000000000 0.99 ns/op
BenchmarkBaselineForReverseLoopIteration 2000000000 0.99 ns/op
BenchmarkBaselineForRange 2000000000 1.33 ns/op
BenchmarkBaselineForSliceLength 2000000000 0.99 ns/op
BenchmarkBaselineForReverseSliceLength 2000000000 0.99 ns/op
BenchmarkBaselineForLoopIteration10 500000000 4.58 ns/op
BenchmarkBaselineForReverseLoopIteration10 500000000 4.49 ns/op
BenchmarkBaselineForRange10 500000000 4.61 ns/op
BenchmarkBaselineForSliceLength10 500000000 5.15 ns/op
BenchmarkBaselineForReverseSliceLength10 500000000 5.36 ns/op
BenchmarkBaselineForLoopIteration100 50000000 53.5 ns/op
BenchmarkBaselineForReverseLoopIteration100 50000000 53.5 ns/op
BenchmarkBaselineForRange100 50000000 57.4 ns/op
BenchmarkBaselineForSliceLength100 50000000 53.9 ns/op
BenchmarkBaselineForReverseSliceLength100 50000000 53.9 ns/op
BenchmarkBaselineForLoopIteration10000 500000 3333 ns/op
BenchmarkBaselineForReverseLoopIteration10000 500000 3345 ns/op
BenchmarkBaselineForRange10000 500000 3602 ns/op
BenchmarkBaselineForSliceLength10000 500000 3348 ns/op
BenchmarkBaselineForReverseSliceLength10000 500000 3333 ns/op
BenchmarkBaselineMakeChannelBoolUnbuffered 20000000 127 ns/op
BenchmarkBaselineMakeChannelBool1 20000000 128 ns/op
BenchmarkBaselineMakeChannelBool10 10000000 137 ns/op
BenchmarkBaselineMakeChannelStringUnbuffered 20000000 128 ns/op
BenchmarkBaselineMakeChannelString1 10000000 136 ns/op
BenchmarkBaselineMakeChannelString10 10000000 211 ns/op
BenchmarkBaselineGo 1000000 2546 ns/op
BenchmarkBaselineFunctionCall 500000000 3.31 ns/op
BenchmarkBaselineFunctionCallArg 100000000 17.0 ns/op
BenchmarkBaselineFunctionCall5VarArgs 5000000 345 ns/op
BenchmarkBaselineFunctionCallInt 500000000 3.33 ns/op
BenchmarkBaselineFunctionCall5VarInts 50000000 99.3 ns/op
BenchmarkBaselineFunctionCallWithDefer 10000000 191 ns/op
BenchmarkBaselineFunctionCallPanicRecover 5000000 318 ns/op
BenchmarkBaselineMethodCallDirect 200000000 8.27 ns/op
BenchmarkBaselineMethodCallDirect1Arg 50000000 43.7 ns/op
BenchmarkBaselineMethodCallDirect1Int 200000000 8.33 ns/op
BenchmarkBaselineMethodCallDirect5Args 10000000 212 ns/op
BenchmarkBaselineMethodCallDirect5Ints 50000000 105 ns/op
BenchmarkBaselineMethodCallIndirect 2000000000 0.33 ns/op
BenchmarkBaselineMethodCallIndirect1Arg 50000000 34.5 ns/op
BenchmarkBaselineMethodCallIndirect1Int 2000000000 0.33 ns/op
BenchmarkBaselineMethodCallIndirect5Args 10000000 206 ns/op
BenchmarkBaselineMethodCallIndirect5Ints 50000000 99.7 ns/op
BenchmarkBaselineTypeAssertion 100000000 12.9 ns/op
BenchmarkBaselineTypeAssertionEmptyInterface 500000000 4.97 ns/op
BenchmarkBaselineTypeAssertionInterface1 100000000 19.0 ns/op
BenchmarkBaselineTypeAssertionInterface2 100000000 18.9 ns/op
BenchmarkBaselineTypeReflectPrimitiveToValue 50000000 31.4 ns/op
BenchmarkBaselineTypeReflectSliceToValue 20000000 124 ns/op
BenchmarkBaselineTypeReflectStructToValue 10000000 168 ns/op
BenchmarkBaselineTypeCheck 100000000 10.2 ns/op
BenchmarkBaselineTypeCheckEmptyInterface 500000000 3.98 ns/op
BenchmarkBaselineTypeCheckInterface1 100000000 17.3 ns/op
BenchmarkBaselineTypeCheckInterface2 100000000 17.6 ns/op
BenchmarkBaselineTypeSwitchOneCase 100000000 12.9 ns/op
BenchmarkBaselineTypeSwitchBasicTypesCase 100000000 17.5 ns/op
BenchmarkBaselineTypeSwitchEmptyInterface 500000000 6.95 ns/op
BenchmarkBaselineTypeSwitchInterface1 100000000 20.0 ns/op
BenchmarkBaselineTypeSwitchInterface2 100000000 20.2 ns/op
BenchmarkBaselineNewStructureLiteral 200000000 8.27 ns/op
BenchmarkBaselineNewStructure 100000000 16.9 ns/op
BenchmarkBaselineNewSliceLiteral 500000000 3.32 ns/op
BenchmarkBaselineNewSlice 50000000 80.8 ns/op
BenchmarkBaselineNewMapLiteralIntToInt 10000000 274 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface 10000000 320 ns/op
BenchmarkBaselineNewMapLiteralStringToInt 10000000 313 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface 10000000 338 ns/op
BenchmarkBaselineNewMapLiteralIntToInt2Item 5000000 358 ns/op
BenchmarkBaselineNewMapLiteralIntToInterface2Item 5000000 532 ns/op
BenchmarkBaselineNewMapLiteralStringToInt2Item 5000000 443 ns/op
BenchmarkBaselineNewMapLiteralStringToInterface2Item 5000000 515 ns/op
BenchmarkBaselineNewMapIntToInt 10000000 275 ns/op
BenchmarkBaselineNewMapIntToInterface 10000000 318 ns/op
BenchmarkBaselineNewMapStringToInt 10000000 314 ns/op
BenchmarkBaselineNewMapStringToInterface 10000000 338 ns/op
BenchmarkBaselineSliceCopy 50000000 38.6 ns/op
BenchmarkBaselineNewSliceAppendElement1 20000000 99.7 ns/op
BenchmarkBaselineNewSliceAppendElement10 10000000 186 ns/op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment