[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Speed of Lua's immutable strings vs buffers (split from Re: Pooling of strings is good)
- From: Sean Conner <sean@...>
- Date: Mon, 25 Aug 2014 20:53:38 -0400
It was thus said that the Great Coroutines once stated:
>
> Besides that, I think your recv()/recvb() functions could be "faster"
> for both/overall if they avoided allocating for the peer address
> userdata/sockaddr -- you can get the remote peer information with
> getpeername(). As I'm sure you know, recv/recvfrom/recvmsg are
> functions that are expected to be called quite often -- allocating for
> the peer sockaddr is bad (imo) on every call to them. I also think
> it's odd that recv() calls recvfrom(), but there should be no
> difference in the results.
I made the change from using recvfrom() to recv() and thus, avoid
allocating space for the peer address for each packet received, and reran
the test. No difference in the results. I did not check in the changes
(they're easy enough to do if you want to test yourself).
-spc
- References:
- Re: Pooling of strings is good, Philipp Janda
- Re: Pooling of strings is good, Coroutines
- Re: Pooling of strings is good, Philipp Janda
- Re: Pooling of strings is good, Coroutines
- Re: Pooling of strings is good, Axel Kittenberger
- Re: Pooling of strings is good, Coroutines
- Re: Pooling of strings is good, Roberto Ierusalimschy
- Re: Pooling of strings is good, Coroutines
- Speed of Lua's immutable strings vs buffers (split from Re: Pooling of strings is good), Sean Conner
- Re: Speed of Lua's immutable strings vs buffers (split from Re: Pooling of strings is good), Coroutines