1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

First commit

This commit is contained in:
Frédéric Guillot 2017-11-19 21:10:04 -08:00
commit 8ffb773f43
2121 changed files with 1118910 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package benchmarks
import (
"testing"
"github.com/tdewolff/minify/json"
)
var jsonSamples = []string{
"sample_large.json",
"sample_testsuite.json",
"sample_twitter.json",
}
func init() {
for _, sample := range jsonSamples {
load(sample)
}
}
func BenchmarkJSON(b *testing.B) {
for _, sample := range jsonSamples {
b.Run(sample, func(b *testing.B) {
b.SetBytes(int64(r[sample].Len()))
for i := 0; i < b.N; i++ {
r[sample].Reset()
w[sample].Reset()
json.Minify(m, w[sample], r[sample], nil)
}
})
}
}