Fixing slow JSON parsing on Windows

This report <https://xojo.com/issue/45229> has become a real problem for us. (ParseJSON takes significantly longer on Windows than on the Mac.) I’m wondering if it’s a complicated fix? Would a “pretty please” help? :slight_smile:

I second that “with sugar on top”

Remember, the official way to second with sugar on top a feedback case is to assign points to it! :slight_smile:

you can always switch to new framework.

or use MBS Plugin:
http://www.monkeybreadsoftware.net/class-jsonmbs.shtml

I belive the issue is with the new framework.

ParseJSON is new framework. I just had to do an app using the new framework when dealing with JSON. I know I am the odd ball here but I miss JSONItem in the new framework.

Switching to a plugin, while doable, would be a tremendous amount of work that I’d rather not take on. It would also mean losing portability of our classes.

Talking to Joe at XDC, he admitted performances of Xojo.Net.Dictionary are not optimum. Maybe that is part of the issue.

I do use Xojo.Net.Dictionary to save and read Json in iOS because I have no alternative, but on Desktop, looks like classic framework is still the valid choice.

Yes and no. On the Mac, the new framework JSON handling flies. I actually switched our classes from my JSONItem_MTC class to it because it was so much faster, not realizing that was only true on the Mac.

If you’re going to stick with the classic framework, my class is the better choice, btw. It’s faster and resolves some bugs that appear in the native JSONItem (but not in the new framework).

Does that apply to writing out?

Yes.

Well someone else needs to add some more points, after adding mine it stands at 666.

The devil made me do it.

I’m a little surprised to have not gotten a response or acknowledgement from any Xojo engineers yet…

Being that we use JSON as our middleware transportation format this really causing serious issues. Is there anyway to get a bug expedited? We’ve already thrown all of our Xojo Pro top priority points towards this bug. I know that with Xojo Pro we have priority support, I wonder what that means?

Well, I originally wrote the json plugin to provide some performance issues in Real Studio.

In a few projects we use wrappers there to provide the same interface as Xojo’s classes. This way we can switch Easily between them.

Thanks @Travis Hill for the response in the Feedback report. For those that missed it:

Update: with no timeframe available, I refactored RESTMessage and other parts of our code away from the new framework. This meant replacing Dictionary and Introspection with the classic equivalents, changing some declarations to String, and introducing JSONItem_MTC.ParseJSON(s) As Dictionary. It also meant breaking iOS compatibility.

The end result: the Mac side saw an increase in processing time from 3s to 4s, while the Windows side dropped from about 14s to 5.5s.

Because I remain optimistic that a fix will be here eventually, I made these changes, for the most part, in submodule branches that I can later discard.

can’t you overload your functions to either use the one or other?

I did a lot of that and used pragmas, but you can’t overload a constant or a property.

read only methods :stuck_out_tongue: