File: bench_test.go

package info (click to toggle)
golang-github-aws-aws-sdk-go-v2 1.17.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 384,244 kB
  • sloc: java: 13,538; makefile: 400; sh: 137
file content (33 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ini

import (
	"testing"
)

const (
	section = `[default]
region = us-west-2
credential_source = Ec2InstanceMetadata
s3 =
	foo=bar
	bar=baz
output = json

[assumerole]
output = json
region = us-west-2
`
)

func BenchmarkINIParser(b *testing.B) {
	for i := 0; i < b.N; i++ {
		ParseBytes([]byte(section))
	}
}

func BenchmarkTokenize(b *testing.B) {
	lexer := iniLexer{}
	for i := 0; i < b.N; i++ {
		lexer.tokenize([]byte(section))
	}
}