Improved benchmarks
This commit is contained in:
parent
8ae5246807
commit
98f5f021f0
@ -4,13 +4,15 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.akyoto.dev/cli/q/src/build"
|
"git.akyoto.dev/cli/q/src/build"
|
||||||
|
"git.akyoto.dev/go/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkEmpty(b *testing.B) {
|
func BenchmarkEmpty(b *testing.B) {
|
||||||
compiler := build.New("tests/benchmarks/empty.q")
|
compiler := build.New("tests/benchmarks/empty.q")
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
compiler.Run()
|
_, err := compiler.Run()
|
||||||
|
assert.Nil(b, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +20,8 @@ func BenchmarkExpressions(b *testing.B) {
|
|||||||
compiler := build.New("tests/benchmarks/expressions.q")
|
compiler := build.New("tests/benchmarks/expressions.q")
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
compiler.Run()
|
_, err := compiler.Run()
|
||||||
|
assert.Nil(b, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,6 +29,7 @@ func BenchmarkHello(b *testing.B) {
|
|||||||
compiler := build.New("examples/hello")
|
compiler := build.New("examples/hello")
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
compiler.Run()
|
_, err := compiler.Run()
|
||||||
|
assert.Nil(b, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,3 @@ print(address, length) {
|
|||||||
write(fd, address, length) {
|
write(fd, address, length) {
|
||||||
syscall(1, fd, address, length)
|
syscall(1, fd, address, length)
|
||||||
}
|
}
|
||||||
|
|
||||||
empty() {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user