Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not sure I can agree with you. I think vector drawing can be better in both size and drawing speed.

It depends a lot on the representation. Bitmap will not get a lot better than what we've got at the moment with JPeg or Gif. Vector representations can vary wildly in compactness and rendering speed. Eg. SVG bad, CSS gradients good. SVG bad, EPS/PDF good.

Obviously drawing from CPU can be much quicker than reading from disk. And if you draw into the GPU buffer first you get all of the advantages of GPU acceleration later.

And it can be much more bandwidth efficient.

Take streaming a bitmap over http. You have to take the penalty of the PNG header, the penalty of assembling a data:url and a 33% fixed penalty for Base64 encoding the binary bits.

So to stream a 1x256px gradient sprite there is a shedload of wasted bits.

If you're in vector land you can just send the gradient endpoints.

If you're not in WebKit land or with pre-sent vector algorithms (rare) you also have to stream the vector drawing code. In that case you can ammortize the cost of the drawing code with a simpler/smaller wire representation.



I'm not talking about Webkit or streaming over HTTP. I'm talking within the context of true native apps.

Blitting a cached PNG will always be faster than CPU based drawing code and I think the app size tradeoff is worth it.


But you just draw the image first from vector and blit that. Vector gets all the normal bitmap speedup tricks that way.

Reading your PNG from the disk in the first place will be slower than reading a compact vector, rendering it and caching.

Re-rendering from CPU can often be faster than GPU bus access times on PCs.

Anyways, it depends on what you're optimising for. I was just illustrating how vector can be much better than bitmap in many situations.


Reading your PNG from the disk in the first place will be slower than reading a compact vector, rendering it and caching.

Got benchmarks for that?




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: