Has anyone try using the Trove HashMap implementation(http:// trove4j.sourceforge.net/)?
For some tests it is many times faster than the JDK one.

On Apr 21, 2007, at 9:58 AM, Richard Lowe wrote:

I found that HashMap lookups with this amount of packets can be particularly expensive, as can creating byte arrays (even tiny ones). I find that Mina session attributes are very useful. I know all of that sounds obvious, but you'd be surprised how simple little operations can stack up.

If you have to write a byte array to the IoHandler adapter, use ByteBuffer.wrap(b) - this seems pretty fast.

I hope that might be useful for anybody else trying to do anything similar!

Cheers,
Richard.
--

Trustin Lee wrote:
Additionally, did you try to turn on 'tcp no delay' option? (this
doesn't affect CPU utilization but might improve throughput)

((SocketSessionConfig) cfg.getSessionConfig()).setTcpNoDelay(true);

and... It would be nice to see your IoHandler implementation code.

HTH,
Trustin


Reply via email to