Since the net IO is abstracted away from you, the answer is ’not usually’.
The usual solution is dedicated threads that constantly poll the sockets, or hardware support + real-time threads, etc. BUT, typically this is not what you are experiencing. More likely, the cpu cache gets cold - so the operations can take 10x longer - especially on a multi-use/user system - so it is actually your processing code that is taking longer. You can probably use ‘perf’ on the process to monitor the cache misses. > On Jul 29, 2022, at 7:08 PM, TH <tinsk...@gmail.com> wrote: > > Hey, > > Bit confused on how stdlib net is implemented, but I'm noticing round trip > >150µs latencies on idle connections (loopback). Round trip latency will drop > to <20µs if sent packets constantly. > > I assume that this latency is caused by kernel / syscall wakeup to indicate > that new data has arrived. Are there any methods to minimize this wakeup > latency? > > Thanks > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/87deab65-b441-42ce-b51b-663651ecfccbn%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/87deab65-b441-42ce-b51b-663651ecfccbn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/F1950223-1934-47F4-885C-3F3079F821E4%40ix.netcom.com.