Norswap
Norswap

Reputation: 12222

Java 2D graphics performance questions

1) Is their any performance loss when making a new image with bitmask transparency, drawing just a few things on it then drawing it on top of another; versus drawing the same image in the same conditions, but with the background cleared to an opaque color ?

2) What is the importance of the performance loss when drawing multiple images versus drawing one big image that includes them all ?

3) Is it better to draw small bit of images from a big image (a sprite sheet) or from their individual image ? Note I'm speaking about memory images, their representation on disk doesn't matter.

Upvotes: 2

Views: 365

Answers (1)

Guillaume
Guillaume

Reputation: 14671

There are a lot of unknown parameters here:

  • What is the underlying OS
  • What is the JVM vendor/version
  • How much memory is available on the video card
  • How big is the image
  • Is the image hardware accelerated

The only practical way to answer your questions is to run benchmarks.

Upvotes: 1

Related Questions