https://github.com/hgfischer/go-type-assertion-benchmark
Naive performance test of two ways to do type assertion in Go.
https://github.com/hgfischer/go-type-assertion-benchmark
Last synced: 14 days ago
JSON representation
Naive performance test of two ways to do type assertion in Go.
- Host: GitHub
- URL: https://github.com/hgfischer/go-type-assertion-benchmark
- Owner: hgfischer
- Created: 2014-06-21T14:51:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T07:14:16.000Z (over 7 years ago)
- Last Synced: 2025-03-12T20:36:07.640Z (2 months ago)
- Language: Go
- Size: 145 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-go - go-type-assertion-benchmark - Naive performance test of two ways to do type assertion in Go. - ★ 5 (Benchmarks)
README
# Introduction
Naive performance test of doing type assertion using:
* The static way
or...
* Using reflection to avoid code repetition
# Results
```
BenchmarkAppendNativeTypeAssertion 5000000 666 ns/op
BenchmarkAppendReflectionTypeAssertion 5000000 529 ns/op
```# Thanks to
* Dan Kortschak
* Dmitry Vyukov
* Xingtao Zhao
* Egon
* Chris Dollin