Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
gogna
gnparser
Commits
1eb4be0d
Commit
1eb4be0d
authored
Jan 29, 2020
by
Dmitry Mozzherin
Browse files
add benchmark to parse 1 name
parent
45c1bd7b
Pipeline
#113398786
passed with stages
in 4 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
gnparser_test.go
gnparser_test.go
+15
-0
No files found.
gnparser_test.go
View file @
1eb4be0d
...
...
@@ -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
++
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment