Live data from Hacker News

JS1024 Results – 1k JavaScript Demos

js1024.fun

41–45 of 45 posts

Re: JS1024 Results – 1k JavaScript Demos

#41

Earlier quoted context omitted.

I haven’t written a post-mortem but I’ll take a quick stab here, and post a more polished post-mortem on my website later. My demo is Star Traveler, which placed #1 in the 2D Canvas category. The GitHub repository is here: https://github.com/depp/demo-traveler Source code: https://github.com/depp/demo-traveler/blob/trunk/src.js What I like about 1K demos is that you can make them in a relatively short amount of time—…

> Path2D turns out to be a very efficient way to specify a path for a Canvas. It uses an SVG path string to specify the path, which is more compact than using .moveTo() and .lineTo(). Path2D w/ SVG strings is byte-efficient, but is less computationally efficient vs the same Path2D w/ lineTo(), etc.

Some context—in JS1024, the code has to fit in 1024 bytes, so you can safely assume that “efficiency” refers to size and not runtime performance.

This particular demo only creates the Path2D objects once, at startup, and then hammers the canvas with a ridiculous amount of overdraw.

Re: JS1024 Results – 1k JavaScript Demos

#42
post #11

Earlier quoted context omitted.

Question for people that run websites that have been “hug of death”ed: would your website be able to be statically hosted on something like github pages, if no why not — if yes why do you choose not to, given it is free and would make all scaling troubles go away (or so I’ve heard).

There are two reasons why sites fall over in cases like this: CPU saturation, where the solution is better caching (which includes going fully static), and network saturation, where the solution is either to get fatter pipes or to reduce the data transferred. Hugs of death are normally due to CPU saturation. But in this case, I suspect that the server is just saturating its network connection because of poor treatmen…

Hi! I'm the host of js1024. Thank you for your advice, I'll try to fix these errors

Re: JS1024 Results – 1k JavaScript Demos

#44
post #28

That 'Wetlands' demo (winner in shader class) is completely borked in my browser (FF 79, Linux).

Same here, Firefox 80.0b2, MacOS 10.15.

But it's not Firefox: I see exactly the same artifacts with Safari 13.1.2. (Safari is also much slower with this demo than Firefox.)

Surprisingly, it depends which GPU it starts with, not the one it's running on. Some Macbooks have two GPUs, only one active at a time.

If Wetlands is started with the Intel GPU active, it looks fine, and continues to look fine if the GPU is switched to nVidia. But if started with the nVidia GPU active, it looks a mess, lots of colour noise, and continues to look that way if the GPU is switched to Intel.

I've checked all combinations and found the same on both Firefox and Safari. So I guess it's probably the underlying OpenGL driver. I'm relieved, this means it's not a faulty GPU :-)

Re: JS1024 Results – 1k JavaScript Demos

#45

If you enjoy this kind of thing, check out the wizardry/madness over at https://www.dwitter.net/ - javascript animations in 140 bytes (the size of a tweet, hence the name, "dwitter").

Thanks. In 10 minutes I have seen more art than one can see in the average museum of modern art.
Post reply on HN