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

Fabien Bodard gambas.fr at gmail.com
Sat Jan 20 09:51:26 CET 2018


Hi, Benoit... I don't really understand why using std function call is
so slower than Gosub calls :-/

2018-01-18 18:33 GMT+01:00 Patrik Karlsson <patrik at trixon.se>:
> 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/gambas/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
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>



-- 
Fabien Bodard


More information about the User mailing list