Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

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: 2 months ago
JSON representation

Naive performance test of two ways to do type assertion in Go.

Lists

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