Haha, yeah using TypedArrays to flat pack data structures is so much fun Instead of {a: 6, b: 7, prev: 2, next: 0} we could store it as a quad in a Uint16Array as [6,7,2,0]. Iterating over items is done in jumps of 4. Index at 1, and terminate at 0 and we have minimal GC! :D
-
Show this thread
-
Replying to @yoshuawuyts
We do { a: [6], b: [7], prev: [2], next: [0] } in perf.html to optimize away GC. Adding an entry involves pushing to each array, but then you have a stable index into that table of data.
1 reply 0 retweets 1 like -
Replying to @TatumCreative @yoshuawuyts
We are immutable by default so changing values involved throwing away lots of data, but GC is not a perf issue anymore.
2 replies 0 retweets 1 like -
Replying to @TatumCreative
Ah yeah! — so I'm working on a diff algorithm, so going mutable all the way on this. Also when threading lands for WASM we might be able to share SharedArrayBuffers && then things might become _real fast_ hehe.
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
I struggle to find any use case for workers because of the cost and complexity of structure cloning, but the idea of having data structures packed into a SharedArrayBuffer is exciting.
1 reply 0 retweets 1 like -
Replying to @TatumCreative
hehe, yeah using workers basically means turning your program into a distributed program — suddenly everying becomes a lot harder. Luckily distributed computing is a well-studied field, and there's established patterns. I think my fave for workers would be fan in/out :D
2 replies 0 retweets 0 likes
oh oops, but yeah you probably already know all this haha — got carried away in a thought of how I _really_ want to experiment with Atomics & WebWorkers to create some basic signalling patterns haha. Anywayyyyy… yeah I agree SharedArrayBuffers are exciting! :D
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.