fix Benchmarks

master
Oliver Tonnhofer 2015-11-20 15:03:08 +01:00
parent f82ada188d
commit 838123acc2
4 changed files with 9 additions and 9 deletions

3
cache/diff_test.go vendored
View File

@ -90,9 +90,10 @@ func BenchmarkWriteDiff(b *testing.B) {
for i := 0; i < b.N; i++ {
for w := 0; w < 5; w++ {
for n := 0; n < 200; n++ {
cache.addc <- idRef{id: int64(n), ref: int64(w)}
cache.Add(int64(n), int64(w))
}
}
cache.Flush()
}
}

View File

@ -1,9 +1,10 @@
package geom
import (
"testing"
"github.com/omniscale/imposm3/element"
"github.com/omniscale/imposm3/geom/geos"
"testing"
)
func TestLineString(t *testing.T) {

View File

@ -7,7 +7,7 @@ import (
)
func BenchmarkTagMatch(b *testing.B) {
m, err := NewMapping("matcher_test_mapping.yml")
m, err := NewMapping("test_mapping.yml")
if err != nil {
b.Fatal(err)
}

View File

@ -3,7 +3,6 @@ package pbf
import (
"bytes"
"compress/zlib"
"fmt"
"io"
"log"
"os"
@ -15,13 +14,12 @@ import (
func BenchmarkHello(b *testing.B) {
b.StopTimer()
pbf, err := Open("../azores.osm.pbf")
pbf, err := Open("./monaco-20150428.osm.pbf")
if err != nil {
panic(err)
}
for pos := range pbf.BlockPositions() {
fmt.Println(pos.size, pos.offset)
b.StartTimer()
for i := 0; i < b.N; i++ {
readPrimitiveBlock(pos)
@ -43,7 +41,7 @@ func BenchmarkHello(b *testing.B) {
func BenchmarkPrimitiveBlock(b *testing.B) {
b.StopTimer()
file, err := os.Open("../azores.osm.pbf")
file, err := os.Open("./monaco-20150428.osm.pbf")
if err != nil {
log.Panic(err)
}
@ -52,8 +50,8 @@ func BenchmarkPrimitiveBlock(b *testing.B) {
var block = &osmpbf.PrimitiveBlock{}
var blob = &osmpbf.Blob{}
var size = 56092
var offset int64 = 197
var size = 79566
var offset int64 = 155
blobData := make([]byte, size)
file.Seek(offset, 0)