Skip to content

Commit 8906321

Browse files
committed
nvim/plugin: add BenchmarkEval
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 691a736 commit 8906321

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nvim/plugin/plugin_bench_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package plugin
2+
3+
import (
4+
"testing"
5+
)
6+
7+
var evalString string
8+
9+
func BenchmarkEval(b *testing.B) {
10+
fn := func(x *struct {
11+
X int `eval:"1"`
12+
YY string `eval:"'hello'" msgpack:"Y"`
13+
Z int
14+
}) {
15+
}
16+
17+
b.ReportAllocs()
18+
b.ResetTimer()
19+
for i := 0; i < b.N; i++ {
20+
evalString = eval("*", fn)
21+
}
22+
}

0 commit comments

Comments
 (0)