Graphics.drawImage() in Java is EXTREMELY slow on some computers yet much faster on others

后端 未结 7 1592
情话喂你
情话喂你 2020-12-08 08:22

I\'m having a strange problem, basically in Java Graphics.drawImage() is extremely slow on some computers and faster on others. This isn\'t related to the computers power ei

7条回答
  •  生来不讨喜
    2020-12-08 08:51

    How are you judging the computers' power? A 50x25 K 32-bit image takes more than 4.5 GB RAM to hold in memory (50000 * 25000 * 4 bytes). If one computer has more RAM than another, that can make a huge difference in speed, because it won't have to swap to disk as often. You should consider grabbing subsections of the image and working with those, instead of the whole thing.

    Edit: Are you using the latest Java & graphics drivers? If your image is only 5Kx2.5K, the only thing I can think of is that it's doing it without any hardware acceleration.

提交回复
热议问题