mirror of
https://github.com/samber/lo.git
synced 2025-09-26 20:11:13 +08:00
Revert "chore: comment benchmarks, in order to remove go-funk dependency"
This reverts commit 28eaf62488
.
This commit is contained in:
@@ -10,7 +10,6 @@ Adding:
|
||||
|
||||
Improvement:
|
||||
- lo.Associate / lo.SliceToMap: faster memory allocation
|
||||
- Comment benchmarks, in order to remove go-funk dependency
|
||||
|
||||
## 1.36.0 (2022-11-28)
|
||||
|
||||
|
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
lop "github.com/samber/lo/parallel"
|
||||
"github.com/thoas/go-funk"
|
||||
)
|
||||
|
||||
func sliceGenerator(size uint) []int64 {
|
||||
@@ -40,14 +41,13 @@ func BenchmarkMap(b *testing.B) {
|
||||
}
|
||||
})
|
||||
|
||||
// Commented in order to remove the dependency from samber/lo.
|
||||
// b.Run("reflect", func(b *testing.B) {
|
||||
// for n := 0; n < b.N; n++ {
|
||||
// _ = funk.Map(arr, func(x int64) string {
|
||||
// return strconv.FormatInt(x, 10)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
b.Run("reflect", func(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
_ = funk.Map(arr, func(x int64) string {
|
||||
return strconv.FormatInt(x, 10)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
b.Run("for", func(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
|
1
go.mod
1
go.mod
@@ -4,6 +4,7 @@ go 1.18
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.8.0
|
||||
github.com/thoas/go-funk v0.9.1
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17
|
||||
)
|
||||
|
||||
|
4
go.sum
4
go.sum
@@ -12,14 +12,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M=
|
||||
github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM=
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
Reference in New Issue
Block a user