mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-28 08:51:01 +02:00
feat(test): add foldl benchmark test
This commit is contained in:
parent
c450a168d4
commit
953327b03c
3
builtin-benchmarks/foldl.jsonnet
Normal file
3
builtin-benchmarks/foldl.jsonnet
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
local input = std.makeArray(10000, function(i) 'xxxxx');
|
||||||
|
|
||||||
|
std.foldl(function(acc, value) acc + value, input, '')
|
@ -67,3 +67,7 @@ func Benchmark_Builtin_comparison(b *testing.B) {
|
|||||||
func Benchmark_Builtin_comparison2(b *testing.B) {
|
func Benchmark_Builtin_comparison2(b *testing.B) {
|
||||||
RunBenchmark(b, "comparison2")
|
RunBenchmark(b, "comparison2")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Benchmark_Builtin_foldl(b *testing.B) {
|
||||||
|
RunBenchmark(b, "foldl")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user