-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from goccy/feature/json-path
Support JSON Path for decoding
- Loading branch information
Showing
30 changed files
with
1,818 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package benchmark | ||
|
||
import ( | ||
"testing" | ||
|
||
gojson "github.com/goccy/go-json" | ||
) | ||
|
||
func Benchmark_Decode_SmallStruct_UnmarshalPath_GoJson(b *testing.B) { | ||
path, err := gojson.CreatePath("$.st") | ||
if err != nil { | ||
b.Fatal(err) | ||
} | ||
b.ReportAllocs() | ||
for i := 0; i < b.N; i++ { | ||
var v int | ||
if err := path.Unmarshal(SmallFixture, &v); err != nil { | ||
b.Fatal(err) | ||
} | ||
if v != 1 { | ||
b.Fatal("failed to unmarshal path") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.