Skip to content

Commit

Permalink
恢复case
Browse files Browse the repository at this point in the history
  • Loading branch information
520MianXiangDuiXiang520 committed Aug 21, 2021
1 parent c21c0be commit 6492551
Showing 1 changed file with 56 additions and 54 deletions.
110 changes: 56 additions & 54 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package json_diff
import (
"fmt"
"github.com/520MianXiangDuiXiang520/json-diff/decode"
// "io/ioutil"
`io/ioutil`

// "io/ioutil"
"testing"
)

Expand All @@ -15,56 +17,56 @@ func TestUnmarshal(t *testing.T) {
fmt.Println(node, err)
}

// func BenchmarkMarshal(b *testing.B) {
// fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// // fileName := "./test_data/hash_test.json"
// input, err := ioutil.ReadFile(fileName)
// if err != nil {
// b.Error("fail to open the ", fileName)
// }
// node, _ := decode.Unmarshal(input)
// b.ResetTimer()
// for i := 0; i < b.N; i++ {
// _, _ = decode.Marshal(node)
// }
// }
//
// func BenchmarkMarshalOld(b *testing.B) {
// fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// // fileName := "./test_data/hash_test.json"
// input, err := ioutil.ReadFile(fileName)
// if err != nil {
// b.Error("fail to open the ", fileName)
// }
// node, _ := Unmarshal(input)
// b.ResetTimer()
// for i := 0; i < b.N; i++ {
// _, _ = Marshal(node)
// }
// }
//
// func BenchmarkUnmarshal(b *testing.B) {
// fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// // fileName := "./test_data/hash_test.json"
// input, err := ioutil.ReadFile(fileName)
// if err != nil {
// b.Error("fail to open the ", fileName)
// }
// b.ResetTimer()
// for i := 0; i < b.N; i++ {
// _, _ = decode.Unmarshal(input)
// }
// }
//
// func BenchmarkUnmarshalOld(b *testing.B) {
// fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// // fileName := "./test_data/hash_test.json"
// input, err := ioutil.ReadFile(fileName)
// if err != nil {
// b.Error("fail to open the ", fileName)
// }
// b.ResetTimer()
// for i := 0; i < b.N; i++ {
// _, _ = Unmarshal(input)
// }
// }
func BenchmarkMarshal(b *testing.B) {
fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// fileName := "./test_data/hash_test.json"
input, err := ioutil.ReadFile(fileName)
if err != nil {
b.Error("fail to open the ", fileName)
}
node, _ := decode.Unmarshal(input)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = decode.Marshal(node)
}
}

func BenchmarkMarshalOld(b *testing.B) {
fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// fileName := "./test_data/hash_test.json"
input, err := ioutil.ReadFile(fileName)
if err != nil {
b.Error("fail to open the ", fileName)
}
node, _ := Unmarshal(input)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = Marshal(node)
}
}

func BenchmarkUnmarshal(b *testing.B) {
fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// fileName := "./test_data/hash_test.json"
input, err := ioutil.ReadFile(fileName)
if err != nil {
b.Error("fail to open the ", fileName)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = decode.Unmarshal(input)
}
}

func BenchmarkUnmarshalOld(b *testing.B) {
fileName := "./test_data/deepcopy_test/deepcopy_speed_test.json"
// fileName := "./test_data/hash_test.json"
input, err := ioutil.ReadFile(fileName)
if err != nil {
b.Error("fail to open the ", fileName)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = Unmarshal(input)
}
}

0 comments on commit 6492551

Please sign in to comment.