Commit 1eb4be0d authored by Dmitry Mozzherin's avatar Dmitry Mozzherin
Browse files

add benchmark to parse 1 name

parent 45c1bd7b
Pipeline #113398786 passed with stages
in 4 minutes and 5 seconds
......@@ -142,6 +142,21 @@ func BenchmarkParse(b *testing.B) {
test = append(test, scanner.Text())
count--
}
b.Run("ParseToObjectOnce", func(b *testing.B) {
var p *pb.Parsed
for i := 0; i < b.N; i++ {
p = gnp.ParseToObject("Abarema clypearia (Jack) Kosterm., p.p.")
}
_ = fmt.Sprintf("%v", p.Parsed)
})
b.Run("ParseToObjectOnceWithInit", func(b *testing.B) {
var p *pb.Parsed
for i := 0; i < b.N; i++ {
gnp1 := NewGNparser()
p = gnp1.ParseToObject("Abarema clypearia (Jack) Kosterm., p.p.")
}
_ = fmt.Sprintf("%v", p.Parsed)
})
b.Run("ParseToObject", func(b *testing.B) {
var p *pb.Parsed
for i := 0; i < b.N; i++ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment