acrazing / cheapjson Goto Github PK
View Code? Open in Web Editor NEWA fast arbitrary JSON parser for golang
Home Page: http://godoc.org/github.com/acrazing/cheapjson
License: MIT License
A fast arbitrary JSON parser for golang
Home Page: http://godoc.org/github.com/acrazing/cheapjson
License: MIT License
I get this error:
Solving failure: No versions of github.com/acrazing/cheapjson met constraints:
master: unexpected error while defensively cleaning up after possible derelict nested submodule directories: fatal: No url found for submodule path 'json-test-suite' in .gitmodules
: command failed: [git submodule foreach --recursive git clean -x -d -f -f]: exit status 128
when trying to run dep ensure on a project with this as dependency.
golang version is 1.12.10
dep version is 0.5.4
installing via go get works, but it would be nice not to have to run manual commands besides dep ensure.
The reversion: 2d5d520
Before execute benchmark, remove the data
directory by rm -rf data
, and then run the test command: go test -v -bench . -run NONE ./parser_test.go
, the result just like this:
2017/07/23 11:01:09 big input size: 117265882, normal input size: 763, deep input size: 2134832
BenchmarkUnmarshalBigInput-4 2 627896151 ns/op
BenchmarkSimpleJsonBigInput-4 1 2085563467 ns/op
BenchmarkUnmarshalNormalInput-4 200000 5553 ns/op
BenchmarkSimpleJsonNormalInput-4 200000 8177 ns/op
BenchmarkUnmarshalDeepInput-4 1000 1290896 ns/op
BenchmarkSimpleJsonDeepInput-4 100 10318724 ns/op
PASS
ok command-line-arguments 13.083s
And, then execute the command again, the result as follow:
2017/07/23 11:01:24 big input size: 117265882, normal input size: 763, deep input size: 2134832
BenchmarkUnmarshalBigInput-4 1 1062142281 ns/op
BenchmarkSimpleJsonBigInput-4 1 2243078831 ns/op
BenchmarkUnmarshalNormalInput-4 200000 5368 ns/op
BenchmarkSimpleJsonNormalInput-4 200000 8148 ns/op
BenchmarkUnmarshalDeepInput-4 1000 1291403 ns/op
BenchmarkSimpleJsonDeepInput-4 100 10598095 ns/op
PASS
ok command-line-arguments 8.868s
There is no different else just cached the input data to file, the second time to run just read it from file, but the first one need to build it in memory. And the result is confusing: only the function BenchmarkUnmarshalBigInput
is affected, cost about double time.
What's wrong? CPU cache, or any else?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.