GithubHelp home page GithubHelp logo

Comments (7)

lamtev avatar lamtev commented on July 20, 2024 1

No, project scheme was configured for debug. And this is why ZippyJSON wasn't as fast as expected. Switching to release configuration causes new results:

JSON size             : ~3 kb
ZippyJSON             : 8.7535e-05 s
Apple                 : 0.000255455 s
Boost (or degradation): ~2.9183183869309426x
------------------------------------------
JSON size             : ~34 kb
ZippyJSON             : 0.000346693 s
Apple                 : 0.001307078 s
Boost (or degradation): ~3.7701309227472137x
------------------------------------------
JSON size             : ~349 kb
ZippyJSON             : 0.003042385 s
Apple                 : 0.013147255 s
Boost (or degradation): ~4.321364653060018x
------------------------------------------
JSON size             : ~3497 kb
ZippyJSON             : 0.031167016 s
Apple                 : 0.135234702 s
Boost (or degradation): ~4.339032713301781x
------------------------------------------

from zippyjson.

michaeleisel avatar michaeleisel commented on July 20, 2024

Hi, I'm getting a speedup of at least 3x for all three of those JSON payloads on my iPhone XS. It's iOS 13.1.1, not 13.3.1, but upgrading is a pain and it looks like the last change to Swift's JSONDecoder was in May 2019. Can you send me a zipped Xcode project that does the benchmarking, and the results that it printed to stdout for you? Or at least, a Github gist of the code you used. FYI here is mine: https://gist.github.com/michaeleisel/e2414e93a73601c7e1f99733f8f96a42

from zippyjson.

lamtev avatar lamtev commented on July 20, 2024

Hi! Thanks for the quick response!

I can see a speedup on simulator, but unfortunately not on real device.

There is a zip archive of my xcode project: ZippyJSONPerformanceIssueDemo.zip

Benchmarking code is in AppDelegate.swift
Parsing duration is measured using DispatchTime.now().

On my iPhone XS i usually get results like that:

JSON size             : ~3 kb
ZippyJSON             : 0.000589531 s
Apple                 : 0.000176595 s
Boost (or degradation): ~0.2995516775199269x
------------------------------------------
JSON size             : ~34 kb
ZippyJSON             : 0.001565232 s
Apple                 : 0.001308632 s
Boost (or degradation): ~0.8360626411931266x
------------------------------------------
JSON size             : ~349 kb
ZippyJSON             : 0.015194142 s
Apple                 : 0.013064061 s
Boost (or degradation): ~0.8598090632560891x
------------------------------------------
JSON size             : ~3497 kb
ZippyJSON             : 0.152393242 s
Apple                 : 0.131946975 s
Boost (or degradation): ~0.8658321935299466x
------------------------------------------

from zippyjson.

michaeleisel avatar michaeleisel commented on July 20, 2024

Are you compiling for release? Are you adding any build settings that can slow things down, eg address sanitizer?

from zippyjson.

ACFancy avatar ACFancy commented on July 20, 2024

@lamtev why you close this issue? That problem was solved?

from zippyjson.

ACFancy avatar ACFancy commented on July 20, 2024

@michaeleisel why should use release build configuration?

from zippyjson.

michaeleisel avatar michaeleisel commented on July 20, 2024

The release configuration applies optimizations that make it much faster. When your users are using the app, it should be built for release, so that configuration is what matters most

from zippyjson.

Related Issues (20)

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.