Aleksandar Stefanović
Aleksandar Stefanović

Reputation: 1593

Are vector graphics slower than bitmaps in Android?

I'm considering implementing vector graphics into my application, but I'm worried about the performance, since it seems natural that the vector graphics take more time to render themselves than (by contrast) static bitmaps.

Should I be worried about this factor, or does Android behave in a way that it shows no real difference?

Upvotes: 5

Views: 2251

Answers (2)

Cristan
Cristan

Reputation: 14135

If you look at this page, you'll see that VectorDrawables will take a bit of time to render the first time and it is cached and very fast afterwards.

The time the initial rendering takes is directly proportionate to the size, so it is recommended to only use vector images up to 200 x 200.

Upvotes: 5

esilver
esilver

Reputation: 28473

I just debugged an issue with my application where a single complex vector logo image was adding 1-2 seconds of Activity load time on Android 4.4 Kitkat, Samsung Galaxy SIII. I switch that particular vector graphic back to raster and restored the performance of my app.

Thus, I would say empirically that there is a potential performance penalty for using vector graphics on Android.

Upvotes: 3

Related Questions