[Haskell-cafe] ANN: network-2.2.3, merger with network-bytestring
chrisdone at googlemail.com
Sun Oct 31 13:56:27 EDT 2010
On 31 October 2010 16:14, Johan Tibell <johan.tibell at gmail.com> wrote:
> This version marks the end of the network-bytestring package, which
> has now been merged into the network package. This means that
> efficient and correct networking using ByteStrings is available as
> part of the standard network package.
> As part of the merger, two new modules have been added:
> Network.Socket.ByteString and Network.Socket.ByteString.lAzy
Huzzah! I updated my little throttler program to use ByteString.
One thing I'm curious about, that maybe you probably know off the top
of your head, is that when I'm limiting the speed, I was merely
recv'ing and send'ing at 1024 bytes a pop, however, when I did this
at, say, ~500KB/s, Firefox is really slow at receiving it, whereas
when I set it 4096 it's much faster/more accurate to the speed I
intend. Chrome doesn't seem to care.
I think the difference is that Firefox is single threaded
(select/poll-based?) and has to switch between various jobs while
receiving every tiny block that I'm sending. Chrome probably has the
receiver in a separate process.
So it seems like, short of balancing the package size (at powers of 2)
and the delay to get some ideal throughput, it's easiest and probably
realistically equivalent to set it to 4096 and just rely on an
accurate delay? What do you think? Just curious. This is something I
think I'll look into in the future, I really don't have a good feel
for typical network latency and throughput. It's not a big deal right
now as "56k slow" is all I need to test my web app.
More information about the Haskell-Cafe