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

Patrik Karlsson patrik at trixon.se
Wed Jan 17 21:27:51 CET 2018


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?

I guess I could split the base64 from the json but it would be nice to have
it atomic.

Sidenote 1:
Should not Now() for 01/17/2018 21:47:57.73 be 01/17/2018 21:47:57.730 with
a zero at the end?
01/17/2018 21:47:28.687 load json
01/17/2018 21:47:28.687 decode json
01/17/2018 21:47:57.699 getBase64
01/17/2018 21:47:57.699 loadImage
01/17/2018 21:47:57.73 done

Sidenote 2:
How do I get rid of that margin around the ImageView?
It's very visible in fullscreen mode but it's there in normal mode too.
When I shrink the window size so that the scroll bars are about to appear,
the margin gets away, but then the image is too small to watch.

/Patrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180117/43bc117c/attachment.html>


More information about the User mailing list