EncodedImage faster with Performance Monitor open

14 views
Skip to first unread message

Matthias Bay

unread,
Mar 16, 2016, 5:53:46 PM3/16/16
to CodenameOne Discussions
Hi,

while benchmarking around with different Image-Types, I've noticed something strange:
Drawing an EncodedImage (which I've loaded from a resource-file) is about 20% faster if the Performance Monitor is open when the Image-data is first used (for example getRGB or drawImage).
It doesn't have to be open during the getImage()-call or the lock()-call and can be closed after the first use, the Image will still perform better.
Also opening the Performance Monitor later won't speed-up the Image.
Drawing an RGBImage is in both cases equally slow.

I don't have a problem with this, I'm just curious: is there a reason for this strange behaviour?

Thanks in advance, Matthias Bay

Shai Almog

unread,
Mar 17, 2016, 12:12:09 AM3/17/16
to CodenameOne Discussions
Hi,
we do some creative things to track the RAM usage of an image. I would expect it to be slower because of that but the JVM is often "odd" in that way.

That does look curious and looking thru JavaSEPort.java I see several suspects but nothing that I'm sure about.
Reply all
Reply to author
Forward
0 new messages