Comparing the speed of JSONItem, JSONItem_MTC, and Xojo.Data...

  1. 5 weeks ago

    Thom M

    Mar 21 Pre-Release Testers Greater Hartford Area, CT

    https://thezaz.com/blog/the_json_situation_in_xojo

    TL;DR: They all leave you wanting more. Xojo.Data is massively faster, but you're stuck with new framework data types and a very expensive manual operation if you need pretty printing. JSONItem and JSONItem_MTC trade blows with JSONItem_MTC being significantly faster for generation, but not always faster for parsing.

    This is an area of Xojo that could use some attention.

  2. Kem T

    Mar 21 Pre-Release Testers, Xojo Pro, XDC Speakers New York
    Edited 5 weeks ago

    You tested 64-bit compiled? Never mind, I see you did.

  3. Kem T

    Mar 21 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Or if we got a replacement for Xojo.Data that returned classic objects and could pretty-print.

    That's available in my project too, but I think the speeds are more inline with JSONItem_MTC.

  4. Thom M

    Mar 21 Pre-Release Testers Greater Hartford Area, CT

    @Kem T You tested 64-bit compiled? Never mind, I see you did.

    None of these tests were with compiled code, all in the debugger. And unfortunately, the first draft had to be adjusted because I forgot that Windows still defaults to 32-bit, and times were actually better that way. But I had to use the 64-bit Times to be fair.

  5. Thom M

    Mar 21 Pre-Release Testers Greater Hartford Area, CT

    @Kem T That's available in my project too, but I think the speeds are more inline with JSONItem_MTC.

    Yes, I tried that after the first draft and it performed slightly better than JSONItem_MTC, it wasn’t different enough to warrant including.

  6. Kem T

    Mar 21 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Oh. If you post your test code, I'd be happy to post the results of the compiled version.

  7. scott b

    Mar 21 Pre-Release Testers, Xojo Pro local coffee shop

    not to mess with your tests but have you looked at Einhugur & MonkekBread's plugins. each has a JSON class for parsing json. Supposedly they are both much faster that the built in ones. I have not bench marked them myself.

    --sb

  8. Kem T

    Mar 21 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    He mentioned in his blog that he didn't want to go with a plugin since it's for an open-source project.

  9. Kem T

    Mar 21 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Thom, if you test compile with 64-bit Aggressive, you should find that JSONItem_MTC is significantly faster than what you posted in your blog. Parsing in my tests runs at about 0.5X the speed of the new framework. To be clear, the new framework stuff is still the fastest, but my code is significantly faster than JSONItem and much closer to the new framework.

  10. Christian S

    Mar 22 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Still I would appreciate if you compare with our classes, too.
    Just to know for me where I stand with them.

  11. Beatrix W

    Mar 22 Pre-Release Testers Europe (Germany)

    10 MB JSON? Is this really a good idea? And a test project would really help.

  12. Thom M

    Mar 22 Pre-Release Testers Greater Hartford Area, CT

    @Beatrix W 10 MB JSON? Is this really a good idea? And a test project would really help.

    Yes. There are lots of objects to serialize. I don’t expect I could write a custom markup that I could parse faster, is version control friendly, and human readable. Plus, I can (and do) parse the documents in my PHP-based API, as well as having some PostgreSQL triggers able to act on the document data with relatively little code.

    @ChristianSchmitz Still I would appreciate if you compare with our classes, too.
    Just to know for me where I stand with them.

    Yeah, as mentioned I was originally testing for my own project, but this experiment has grown a little bit, so I’ll include MBS in round 2.

    @Kem T Thom, if you test compile with 64-bit Aggressive, you should find that JSONItem_MTC is significantly faster than what you posted in your blog. Parsing in my tests runs at about 0.5X the speed of the new framework. To be clear, the new framework stuff is still the fastest, but my code is significantly faster than JSONItem and much closer to the new framework.

    I will run the next round in compiled mode, but my original logic is that any performance gained in JSONItem_MTC would also be gained by JSONItem since they’re both Xojo-based. So the overall outcome wouldn’t change. But yes, compiling will get us closer to an apples-to-apples comparison so I’ll do that.

  13. scott b

    Mar 22 Pre-Release Testers, Xojo Pro local coffee shop

    @Kem T He mentioned in his blog that he didn't want to go with a plugin since it's for an open-source project.

    I missed that in the article. oops. my bad.

    @ChristianSchmitz Still I would appreciate if you compare with our classes, too.
    Just to know for me where I stand with them.

    I am curious too. As I use the "classic" framework and the new new new framework. Not any of the xojo.*.* framework.

  14. Thom M

    Mar 22 Pre-Release Testers Greater Hartford Area, CT

    @scott b I am curious too. As I use the "classic" framework and the new new new framework. Not any of the xojo.*.* framework.

    Well you didn't have to wait long!

    https://thezaz.com/blog/json_performance_tests_round_2

    The summary is as Kem expected. Performance is way better for JSONItem_MTC, but still can't keep pace with the plugin-based solutions of Xojo.Data and MBS. Speaking of MBS, it absolutely annihilates the competition in every one of these tests.

  15. Christian S

    Mar 22 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Great. Classes made for speed.

    By the way, we have a class to wrap JSONMBS for making it compatible to JSONItem.

    see example project: JSONItem clone
    https://monkeybreadsoftware.net/example-util-json-jsonitemclone.shtml

  16. Thom M

    Mar 22 Pre-Release Testers Greater Hartford Area, CT

    @ChristianSchmitz By the way, we have a class to wrap JSONMBS for making it compatible to JSONItem.

    Hey that's not bad.

  17. Kem T

    Mar 22 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    Fair test, Thom. Thanks for reporting those results.

  18. scott b

    Mar 22 Pre-Release Testers, Xojo Pro local coffee shop

    @Thom M Well you didn't have to wait long!

    faster/sooner than I expected. thanks!!
    --sb

  19. 4 weeks ago

    Thom M

    Mar 25 Pre-Release Testers Greater Hartford Area, CT

    Well, one more followup than I expected to be doing: https://thezaz.com/blog/the_json_saga_continues

  20. Kem T

    Mar 25 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I thought I remembered that from when I tested MBS, but that was a while ago and thought things had changed.

  21. Newer ›

or Sign Up to reply!