2019
03-30
03-30
slice删除元素的性能对比 NEW
package main
import (
"testing"
)
// 第一种
func BenchmarkMake(t *testing.B) {
t.ResetTimer()
origin := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
for i := 0; i < t.N; i++ {
target := make([]int, len(origin))
for _, ite...
Read More >