Which one do you expect to perform the best for small amounts of Bytes?
Which one do you expect to perform the best for large amounts of Bytes?
I was surprised how well a HTTP approach via patching the XMLHttpRequest prototype
performed. I expected it to do well, but only for large sizes. Apparently the overhead of creating a request/response object is lower than I thought.
What do you think about the method used for benchmarking? Are there any potential ways that I missed?
Thanks for reading and lets hope that in the Future there is a standard way for passing Bytes between the languages without overhead.
Patching XMLHttpRequest to get bytes over ports is such a hack though… and how do we recieve bytes through a port? Love Elm, but hate that this has been broken for soooo loooong…
The JS → Elm side for Http uses a normal port with null/unit type to tell Elm: hey please make a Http Request and then patches the request to return bytes from JS. So just like Elm → JS bit with an extra step. Still apparently faster than using File.decoder in all benchmarked cases.
For my comprehension, if all you care about is sending bytes in an http message (think web-grpc style protobuf encoded data) then does one need to care about this? I.e. is the focus here in getting bytes over ports specifically?