[Gambas-user] Can JSON.Decode be faster?

Patrik Karlsson patrik at trixon.se
Thu Jan 18 18:33:06 CET 2018


2018-01-18 2:05 GMT+01:00 Benoît Minisini <g4mba5 at gmail.com>:

> Le 18/01/2018 à 01:05, Benoît Minisini a écrit :
>
>> Le 17/01/2018 à 21:27, Patrik Karlsson a écrit :
>>
>>> In this little project: https://github.com/trixon/gambas-idg (contains
>>> a json file, requires Gambas=3.10.90 c1e4b89 (master))
>>>
>>> I'm decoding a json string around 1MB and it takes 30 seconds in Gambas.
>>> CPU:       Quad core Intel Core i7-6700HQ (-MT-MCP-) cache: 6144 KB
>>>             clock speeds: max: 3500 MHz 1: 800 MHz 2: 800 MHz 3: 800 MHz
>>> 4: 800 MHz 5: 800 MHz 6: 800 MHz
>>>             7: 800 MHz 8: 800 MHz
>>>
>>> When doing it in java with Google Gson it takes virtually no time at all.
>>>
>>> I intend to use this in an image viewer that consumes base64 encoded
>>> photos wrapped in a json among its exif data.
>>> Could this be done faster in Gambas?
>>>
>>
>>
> You can test the commit https://gitlab.com/gambas/gamb
> as/commit/4ff9f7ddef726e3957c30bf31b794b894b88d914 to check the speed up
> of the JSON.Decode() routine.
>
> ...and the default null margin for ImageView.ZoomFit() too.
>
> Regards,
>
>
> --
> Benoît Minisini
>
>
Thank you, it's blazing fast now!
About 100 times faster. :)

01/18/2018 19:27:54.043 load json
01/18/2018 19:27:54.044 decode json
01/18/2018 19:27:54.367 getBase64
01/18/2018 19:27:54.367 loadImage
01/18/2018 19:27:54.397 done

The null margin is much appreciated, so is  the sdl2 tweak.

/Patrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180118/0bb16100/attachment-0001.html>


More information about the User mailing list