Drawing an image in Java, slow as black on a netbook

In addition to my previous questions (especially this one: Java: VolatileImage is slower than BufferedImage ), I noticed that just drawing an image (it doesn’t matter if it is buffered or mutable, because the computer does not have accelerated memory *, and tests show that it doesn’t change anything), tends to be very long.

(*) System.out.println(GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice().getAvailableAcceleratedMemory()); --> 0 

How long? For a 500x400 image, about 0.04 seconds. This is just drawing an image on a memory buffer (obtained using a buffer strategy).

Now, given that the World of Warcraft runs on this netbook (it's pretty laconic), and that online games in Java don't seem to have any problems, this is pretty thought-provoking.

I am quite sure that I did not miss something obvious, I searched a lot on the Internet, but I won’t do anything. So does any of you java whiz have an idea about what an unclear problem might be causing this (or maybe it's normal, hard I doubt it)?

PS: When I write this, I realized that this could be the reason for my Linux installation (archlinux). I have the correct Intel driver. But my computer usually has "Integrated Intel Graphics Media Accelerator 950", which would mean that it should have accelerated video memory. Any ideas on this side of things?

+4
source share
2 answers

I also use Arch Linux and noticed that my games sometimes slow down, especially when using alpha transparent films with my images. It turns out that even Windows not only Linux sometimes disables hardware acceleration by default.

I searched for a solution to the problem and found this: http://web.archive.org/web/20120926022918/http://www.systemparadox.co.uk/node/29

Enabling OpenGL has greatly accelerated my scope, and I assume that if you run your tests again you will get a faster draw.

+2
source

I don’t know much about java graphics, but if I were in your place, I would assume that measurement does not mean anything without a comparison value that sounds like you have one, but it is not used. Add this information to your question along with the specifications of the comparison system (does it have a desktop computer, does it have a special graphics card, does it work windows or linux?).


As for your measurements, which it is 10 times faster on another netbook, does this other Windows laptop, or is it the same Linux? Linux has historically had very mediocre graphics drivers - they just don't work much like Windows equivalents. In fact, for a long time, the only drivers you could get were not written by ATI / nVidia / etc., but rather by amateurs. It would not surprise me if a graphical program was run ten times slower on a Linux machine than on a similar Windows machine.

It was a situation when I realized this about five years ago. I doubt this has changed much.

+1
source

Source: https://habr.com/ru/post/1308485/


All Articles