Giter VIP home page Giter VIP logo

cheapjson's People

Contributors

acrazing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zanjs zhusl sakishen

cheapjson's Issues

Error on dep ensure

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 reason why the performance loss when read input from file rather than build it in memory?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.