« Using Dropbox for plu… | Home | MBS Real Studio Plugi… »

JSON


I want to tell you the story I had the last days with JSON classes:
We started with a need to use JSON for talking to a server. We were happy to see JSONItem class in Real Studio, but we soon realized it has problems. First it did not preserve the text encoding. All the strings we got back had no text encoding set. Well we eventually worked around that, but later we discovered that the JSONItem class is very very slow. We really didn't want to wait 10 seconds for a big JSON to be parsed. So we checked for alternatives. As the client uses both Einhugur and MBS plugins, we have also JSONNode from Einhugur and JSONMBS from MBS Plugins available. A little speed test for parsing shows that the plugins do the 10 second job in less than 0.1 seconds. The Einhugur class was a little bit faster then mine, so we tried JSONNode. But it turns out that JSONNode doesn't return strings with text encodings, too.
So finally we came to JSONMBS class. Our class is a little bit lower level as you get nodes for arrays or dictionaries which you don't see that way with the other classes. But well, our JSONMBS class has decent speed and handles encodings better. Still we need to call the unescape function manually to removes escapes.
So finally we have a solution and our parse method implemented with 3 different classes. Good if we have to switch again later :-)
24 04 12 - 09:55
three comments

“our JSONMBS class has decent speed” ... how much faster then? 1 second?
Markus Wnter - 24 04 12 - 11:19

The stuff that toke 10 seconds did parse in Einhugur and MBS plugins in less than 0.1 seconds.
Christian Schmitz (Email) (URL) - 24 04 12 - 11:31

Sorry to be dense here but it isn’t clear from the blog entry: 0.1 sec Including unescape etc? That’s quite something :-)
Markus Wnter (Email) - 24 04 12 - 12:37


  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.