mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
First commit
This commit is contained in:
commit
8ffb773f43
2121 changed files with 1118910 additions and 0 deletions
35
vendor/github.com/tdewolff/minify/benchmarks/js_test.go
generated
vendored
Normal file
35
vendor/github.com/tdewolff/minify/benchmarks/js_test.go
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
package benchmarks
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/tdewolff/minify/js"
|
||||
)
|
||||
|
||||
var jsSamples = []string{
|
||||
"sample_ace.js",
|
||||
"sample_dot.js",
|
||||
"sample_jquery.js",
|
||||
"sample_jqueryui.js",
|
||||
"sample_moment.js",
|
||||
}
|
||||
|
||||
func init() {
|
||||
for _, sample := range jsSamples {
|
||||
load(sample)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkJS(b *testing.B) {
|
||||
for _, sample := range jsSamples {
|
||||
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()
|
||||
js.Minify(m, w[sample], r[sample], nil)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue