performance

package
v0.0.0-...-e2ee79f Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

性能测试

使用

performance.TestPerformance()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestPerformance

func TestPerformance()

Types

type Performance

type Performance struct{}

一段常用操作的性能分析

func (*Performance) V0

func (p *Performance) V0()

func (*Performance) V1

func (p *Performance) V1()

1、map初始化的时候指定容量,去除grow带来的耗时 2、strconv.FormatInt 改为 strconv.AppendInt,减少对象分配

func (*Performance) V2

func (p *Performance) V2()

1、统一申请key的内存 2、直接将[]byte转为string

Jump to

Keyboard shortcuts

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