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

  1. ‹ Older
  2. 8 weeks ago

    Thom M

    Mar 25 Pre-Release Testers Greater Hartford Area, CT

    @ChristianSchmitz I could make functions to convert to dictionary/variant/array if needed.
    But not sure what speed would come out of that.

    I'm not sure either. But I imagine if it were done inside the plugin, you could get closer to Xojo.Data than any Xojo-based code could.

  3. 6 weeks ago

    Christian S

    Apr 11 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Next MBS Plugin will have Convert method to provide quick replacement for JSON parsing:

    Dim MBSJSON As New JSONMBS(Contents)
    Dim t As Variant = MBSJSON.Convert

    This will give dictionary, array and variants as needed and I hope you can benchmark again with next prerelease.

  4. Thom M

    Apr 11 Pre-Release Testers Greater Hartford Area, CT

    @ChristianSchmitz Next MBS Plugin will have Convert method to provide quick replacement for JSON parsing:

    Dim MBSJSON As New JSONMBS(Contents)
    Dim t As Variant = MBSJSON.Convert

    This will give dictionary, array and variants as needed and I hope you can benchmark again with next prerelease.

    Cool, I’ll keep an eye out.

  5. Tobias B

    Apr 11 Pre-Release Testers, Xojo Pro Bern, Switzerland

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

    just as a heads-up: this code is not 64-bit ready:

    Select case [b]v.Type[/b]
    case Variant.TypeString
    	Return JSONMBS.NewStringNode(v.StringValue)
    case Variant.TypeBoolean
    	Return JSONMBS.NewBoolNode(v.BooleanValue)
    case Variant.TypeDouble, Variant.TypeSingle, [b]Variant.TypeInteger[/b]
    	Return JSONMBS.NewNumberNode(v.DoubleValue)
    else
    	Break
    end Select

    You'll have to test against Variant.TypeInt32 and Variant.TypeInt64 because of Feedback Case #41173

  6. Christian S

    Apr 11 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Thanks. I'll update it.

  7. Thom M

    Apr 11 Pre-Release Testers Greater Hartford Area, CT

    So the results are good with the upcoming MBS methods. For a recap, we're testing parsing json, generating compact json, and generating pretty json. The new MBS code "competes" with Xojo.Data and the M_JSON module, so I'm only going to include those results here for comparison. All the test variables are the same: same hardware, same Xojo version, same JSON file.

    Xojo.Data parsed in 227ms on Mac and 1,884ms on Windows. M_JSON parsed in 965ms on Mac and 647ms on Windows. And JSONMBS.Convert parsed in 238ms on Mac and 216ms on Windows.

    For compact JSON, Xojo.Data generated in 174ms on Mac and 432ms on Windows. M_JSON generated in 1,164ms on Mac and 913ms on Windows. JSONMBS.Convert generated in 402ms on Mac and 459ms on Windows.

    And for pretty JSON, Xojo.Data generated in 1,262ms on Mac and 1,031ms on Windows. M_JSON generated in 1,219ms on Mac and 952ms on Windows. JSONMBS.Convert generated in 412ms on Mac and 474ms on Windows.

    So these new methods offer some clear advantages. While slower in some tests, if you need to generate pretty JSON, they have a very significant advantage over all other options. For those already using MBS plugins, they're worth switching to. I'm personally going to hold out for API 2.0 before making any changes to my code though.

  8. Christian S

    Apr 11 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Thanks for testing.
    If you get some example for me to fine tune, please email me the project.

  9. Thom M

    Apr 11 Pre-Release Testers Greater Hartford Area, CT

    @ChristianSchmitz Thanks for testing.
    If you get some example for me to fine tune, please email me the project.

    If I do that, my test would not longer be fair.

  10. Bob K

    Apr 11 Pre-Release Testers, Xojo Pro Kansas City

    Thanks for doing all this testing Thom.

  11. 5 weeks ago

    Christian S

    Apr 11 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    No problem. I'll still check if I can improve something, e.g. avoid extra copies of data.

  12. Kem T

    Apr 11 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    I'll update my classes too to put Thom's test parameters and the results in constants. 0 ms!

    :P

  13. brian f

    Apr 11 Pre-Release Testers, Xojo Pro Chilly California

    @Kem T I'll update my classes too to put Thom's test parameters and the results in constants. 0 ms!

    :P

    AHHEEEM! Faster please! :P

  14. last week

    Karen A

    May 10 Pre-Release Testers

    @Thom M https://thezaz.com/blog/json_performance_tests_round_2

    Thom,

    If you have an Einhugur license, could you please add the new (April 2019) JSON plugin II 1.0 from Einhugur to your test?

    I want the fastest I can get, but preferably without spending more money. I have a current Einhugur license, but IIRC the last MBS license I have is from 2014 (Einhugur has met most of my needs and is a lot cheaper to renew)..

    I am looking to speed up processing in an AloeExpress Xojo server app as much as possible, for an in-house client server application (not one I will earn money for) that I have in mind, and I don't want to have to deal with the new framework TEXT type.

    Thanks,
    - karen

  15. Thom M

    May 10 Pre-Release Testers Greater Hartford Area, CT

    @Karen A If you have an Einhugur license, could you please add the new (April 2019) JSON plugin II 1.0 from Einhugur to your test?

    Sorry, I don't have an Einhugur license. Is there a demo?

  16. Thom M

    May 10 Pre-Release Testers Greater Hartford Area, CT

    @Thom M Sorry, I don't have an Einhugur license. Is there a demo?

    I found it. I'll add it to my tests, but I'm pretty confident already that it's not the route you want to take. Like the MBS plugin, raw performance may be fast, but converting to and from the plugin-specific classes tends to blow away any performance gains.

  17. Christian S

    May 10 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    I hoped my Convert methods could help...
    But dictionary and array access is speed limited.

  18. Thom M

    May 10 Pre-Release Testers Greater Hartford Area, CT

    @ChristianSchmitz I hoped my Convert methods could help...
    But dictionary and array access is speed limited.

    Oh it absolutely does. I’m comparing Einhugur’s JSON classes to your JSONItemMBS classes. The new Convert method is probably the best overall choice for performance right now.

  19. Karen A

    May 11 Pre-Release Testers

    @Thom M Oh it absolutely does. I’m comparing Einhugur’s JSON classes to your JSONItemMBS classes. The new Convert method is probably the best overall choice for performance right now.

    Hi Thom,

    If you have run the tests already, can you share the details of how the new Einhugur JSON plugin compares to all the other options?

    Sometimes second best is good enough if you already have it! ;)

    Thanks,
    - karen

  20. Björn E

    May 12 Pre-Release Testers, Xojo Pro Iceland

    @Thom M Oh it absolutely does. I’m comparing Einhugur’s JSON classes to your JSONItemMBS classes. The new Convert method is probably the best overall choice for performance right now.

    The Einhugur one also can do the Auto variant convert thing.

    Note though I personally don't think thats the right thing to focus on, I know at least for me I would never use it like that in real world application. The automatic variant structure is nice to do tests and other such but practical in use I would say no at least I would never design my own applications like that.

or Sign Up to reply!