I'm happy to announce that version 1.1.0 of the fastJSON library is now available. This version cleans up some of the commenting that I had in the code, plus adds in some nice improvements from "madpink" and "mwieder". You will also see the library is now LC8 friendly as a script only stack. I have also updated my silly little test stack to include the LC8 lib as part of it's testing.
My non-scientific tests show that fastJson is significantly faster encoding/decoding JSON data compared to the LC8 LCB library.
fastJson is completely open source and on github at https://github.com/bhall2001/fastjson. If you're working with REST APIs or JSON data give it a try.
Bob
Benchmarks
in milliseconds on 3.5GHz iMac late 2014
Test 1: basicArray.json (136KB), basic JSON array file with 26,001 tokens
LC 7.1.4 fastJson Lib (as a reference)
JSON To Array - 441
Array To JSON - 64
LC 8.0.0 fastJson
JSON To Array - 457
Array To JSON - 64
LC 8.0.0 built in library
JSON To Array - 780
Array To JSON - 237
------------------------
Test 2: lcdict.json (4.9MB), a complex JSON file with the Livecode Dictionary circa 2015 with 405,707 tokens
LC 7.1.4 fastJson Lib (as a reference)
JSON To Array - 7860
Array To JSON - 4240
LC 8.0.0 fastJson
JSON To Array - 7913
Array To JSON - 2658
LC 8.0.0 built in library
JSON To Array - 23731
Array To JSON - 3110
fastJson Lib 1.1.0 Released
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: fastJson Lib 1.1.0 Released
Hi Bob!
Are you able to attribute the significant speed boost in the LC 8 Array To JSON with the complex JSON file to any changes that have been made to fastJson? Or is it a result of engine improvements in LC 8?
Cheers,
Ali
Are you able to attribute the significant speed boost in the LC 8 Array To JSON with the complex JSON file to any changes that have been made to fastJson? Or is it a result of engine improvements in LC 8?
Cheers,
Ali