Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Faster Json parser
Forum Updated to NodeBB v4.3 + New Features

Faster Json parser

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheEnigmist
    wrote on 24 Mar 2019, 22:13 last edited by TheEnigmist
    #1

    Is the builtin Json parser faster than a 3th party library? Is it possible to parse a JSON string into a class like you can do, for example, with GSON Java? (gson.fromJson(json, Foo.class);

    Or manually navigate through JSON is the fastest way to parse it into a class?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 24 Mar 2019, 22:24 last edited by mrjj
      #2

      Hi
      That depends on what library you compare it against.
      It wont likely win over say
      https://github.com/Tencent/rapidjson
      However, if you end up converting to /from QString to use it in the app, it might be costly.
      There is no support for automatic (de)serialization. You have to write that manually.

      T 1 Reply Last reply 24 Mar 2019, 22:39
      2
      • M mrjj
        24 Mar 2019, 22:24

        Hi
        That depends on what library you compare it against.
        It wont likely win over say
        https://github.com/Tencent/rapidjson
        However, if you end up converting to /from QString to use it in the app, it might be costly.
        There is no support for automatic (de)serialization. You have to write that manually.

        T Offline
        T Offline
        TheEnigmist
        wrote on 24 Mar 2019, 22:39 last edited by
        #3

        @mrjj said in Faster Json parser:

        Hi
        That depends on what library you compare it against.
        It wont likely win over say
        https://github.com/Tencent/rapidjson
        However, if you end up converting to /from QString to use it in the app, it might be costly.
        There is no support for automatic (de)serialization. You have to write that manually.

        Well I get a JSON string from a file or from network so yes I think that manually parsing is better!

        J 1 Reply Last reply 25 Mar 2019, 11:23
        0
        • T TheEnigmist
          24 Mar 2019, 22:39

          @mrjj said in Faster Json parser:

          Hi
          That depends on what library you compare it against.
          It wont likely win over say
          https://github.com/Tencent/rapidjson
          However, if you end up converting to /from QString to use it in the app, it might be costly.
          There is no support for automatic (de)serialization. You have to write that manually.

          Well I get a JSON string from a file or from network so yes I think that manually parsing is better!

          J Offline
          J Offline
          JonB
          wrote on 25 Mar 2019, 11:23 last edited by
          #4

          @TheEnigmist
          Do you only ever parse a given piece of JSON once, or do you repeatedly re-parse the same JSON? This may be blindingly obvious depending on your competence, but if you do re-parse then caching the result for re-use will be a big saving....

          T 1 Reply Last reply 25 Mar 2019, 18:51
          3
          • J JonB
            25 Mar 2019, 11:23

            @TheEnigmist
            Do you only ever parse a given piece of JSON once, or do you repeatedly re-parse the same JSON? This may be blindingly obvious depending on your competence, but if you do re-parse then caching the result for re-use will be a big saving....

            T Offline
            T Offline
            TheEnigmist
            wrote on 25 Mar 2019, 18:51 last edited by
            #5

            @JonB said in Faster Json parser:

            @TheEnigmist
            Do you only ever parse a given piece of JSON once, or do you repeatedly re-parse the same JSON? This may be blindingly obvious depending on your competence, but if you do re-parse then caching the result for re-use will be a big saving....

            I parse it totally and it changes over time so when I receive it again it has new values.

            1 Reply Last reply
            1

            1/5

            24 Mar 2019, 22:13

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved