I keep seeing people say that #SignalR is not designed for video streaming, but I can’t help but try it. Seems like with the #HLS set up that I’m looking at, the individual file size should be minimal enough that it should be doable.
Is it naive to think that using the built in streaming mechanisms with #MessagePack wouldn’t be enough to get decent perf?
I wouldn’t l even think about doing it this way, except that it would avoid having to stand up custom tunneling infrastructure.
@webfussel What size and shape is the data? Must be pretty big, probably a huge array with lots of big objects? I've tackled this by writing a little streaming stringifier (caveat: #ReadableStreams as fetch request bodies were still Chrome-only by the time) or using something like #MessagePack instead of #JSON.
#readablestreams #messagepack #json
Another View<->ViewModel idea I have is using a good serializer instead of boxing/unboxing. Perhaps Cysharp’s #MessagePack, which serializes to byte arrays. Unfortunately, it’s a real beast of a library to try to use in #Unity.
@data0 Another idea: what if there was a serialization format that was identical to #JSON from an API perspective, but better compressed?
For example, MessagePack doesn't store numbers the same way. It's similar but might create subtle incompatibilities for someone trying to migrate.
It might not be as efficient as #MessagePack (or other things), but it'd be a drop-in replacement.
When transfering big amounts of data, #JSON can be a pita. Duplicating data into a string is kind of inefficient and stringifiers like `JSON.stringify` in the #browser have their limits too.
#MessagePack looks like a nice alternative. Beeing binary, it's faster and more efficient. Language support looks great. In #JavaScript / #TypeScript you can even have it produce a #ReadableStream to feed directly into fetch. Now pipe it into a #CompressionStream and you're flying!
#json #browser #messagepack #javascript #readablestream #compressionstream #typescript