2018-10-28 15:49:45 -07:00
|
|
|
package server
|
2016-03-04 16:08:16 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func BenchmarkJSONString(t *testing.B) {
|
|
|
|
var s = "the need for mead"
|
|
|
|
for i := 0; i < t.N; i++ {
|
|
|
|
jsonString(s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkJSONMarshal(t *testing.B) {
|
|
|
|
var s = "the need for mead"
|
|
|
|
for i := 0; i < t.N; i++ {
|
|
|
|
json.Marshal(s)
|
|
|
|
}
|
|
|
|
}
|