Live data from Hacker News

How fast is Go? Simulating particles on a smart TV

dgerrells.com

1–10 of 31 posts

Re: How fast is Go? Simulating particles on a smart TV

#6
My suggestion to the OP talking about compression.

First up, consider just PNG compressing the image for simplicity. It's a mostly black image with color dots. That would generally compress really well with PNG.

But also, knowing the nature of the image, you could pretty easily compress the image by doing offsets to the next pixel. The format could look roughly something like this

[offset byte, color byte, offset byte, color byte].

It will fail in cases where each pixel has a color and will excel when there is a run of black pixels (which there will be a lot of those). It's a dead simple format to implement and read as well.

You can even keep the frame around for writing. You'd just be counting black pixels left to right top to bottom, emitting that number or 255 then 0 resetting and then counting some more.

Re: How fast is Go? Simulating particles on a smart TV

#7
post #6

My suggestion to the OP talking about compression. First up, consider just PNG compressing the image for simplicity. It's a mostly black image with color dots. That would generally compress really well with PNG. But also, knowing the nature of the image, you could pretty easily compress the image by doing offsets to the next pixel. The format could look roughly something like this [offset byte, color byte, offset byt…

It also looks like half of the screen doen't change (the part that is far away fro the cursor), so compressing the xor of the new and old image would improve compression a lot.

Re: How fast is Go? Simulating particles on a smart TV

#8
post #6

My suggestion to the OP talking about compression. First up, consider just PNG compressing the image for simplicity. It's a mostly black image with color dots. That would generally compress really well with PNG. But also, knowing the nature of the image, you could pretty easily compress the image by doing offsets to the next pixel. The format could look roughly something like this [offset byte, color byte, offset byt…

It also looks like half of the screen doen't change (the part that is far away fro the cursor), so compressing the xor of the new and old image would improve compression a lot.

Yeah, that would also help with when the image is static with no interactions.

Re: How fast is Go? Simulating particles on a smart TV

#10
post #9
post #5

Is this on a smart TV or a server feeding the results to a smart TV? Seems like quite an important difference.

you should probably read the article then, it's pretty clearly explained

I did and don’t understand why the title is “simulating particles on a smart TV” if that is not what it is doing.
Post reply on HN