ScratchData LogoScratchData
Back to johnm's profile

Tree: Vector vs. Bitmap Performance

JOjohnm•Created May 4, 2012
Tree: Vector vs. Bitmap Performance
5
5
340 views
View on Scratch

Description

This project illustrates a performance issue with the new vector costumes discovered by Ursula. The green flag and "b" key draw the tree with the sprite's costume set to a bitmap version of the cat. The "v" key do it with a vector costume. The performance is quite different. There should be ways to make vector costumes faster, especially for this case, when the sprite is not changing size or rotating. I will look into it. (Note: The performance issues are move obvious for this project than for most because the recursive "tree" function is effectively running in turbo mode. But in games or animations with many sprites, the lower performance would become noticeable even in non-turbo mode.) ----Update: I've improved the performance substantially. (The previous version had a flaw that caused vector costumes to run over 600 (yes, six hundred!) times slower than bitmap ones. Vector costumes are still noticeably slower than bitmaps, but now it is only by a factor of about three. (But I don't think it needs to be even that much slower; I'll look into this.) However, cloning sprites with vector costumes is still extremely slow. I will look into that at some point. On the up side, vector costumes have decent performance on rotation and resizing, and they look far better than rotated and/or scaled bitmaps.

Project Details

Project ID10001115
CreatedMay 4, 2012
Last ModifiedMay 4, 2012
SharedMay 4, 2012
Visibilityvisible
CommentsAllowed