labs24

package
v0.0.0-...-6c2044b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

测试binary.Write和硬编码的效率差异。

测试结果:

dada-imac:labs24 dada$ go test -v -bench='.*'
testing: warning: no tests to run
PASS
Benchmark_UseBinaryWrite1	50000000	        68.5 ns/op
Benchmark_UseBinaryWrite2	10000000	       279 ns/op
Benchmark_UseHardcode	100000000	        21.5 ns/op
ok  	github.com/idada/go-labs/labs24	8.771s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseBinaryWrite1

func UseBinaryWrite1(w io.Writer, i int32)

func UseBinaryWrite2

func UseBinaryWrite2(w io.Writer, i int)

func UseHardcode

func UseHardcode(w io.Writer, i int32)

Types

type DummyWriter

type DummyWriter struct {
}

func (*DummyWriter) Write

func (w *DummyWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL