java - What's the best way to reduce latency on downstream in netty? -


i'm using netty 5.0 , find out when downstream action initiated non-io thread, takes few hundreds microseconds io thread take task. below measurement code. measure time in 2 places, 1 in non-io thread , 1 in io thread (actually, in encoder outbound handler). in non-io thread, latency around 200 ~ 300 microseconds while in io thread, latency 50 ~ 100 nano seconds. there anyway reduce latency of context switching sub microseconds?

channelfuture f = b.bind(); ... channelpromise cp = f.channel().newpromise(); long currentnano = system.nanotime(); cp.addlistener(() -> (system.out.println(system.nanotime() - currentnano)); cp.channel().writeandflush(obj); 

i'm using disruptor pattern in other parts of codes , can object passing between threads below microsecond, want same in netty.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -