Bill Barker wrote:
So, where is it already? Some of use want to see how you can beat Costin ;-).

Right now, I'm not planning on beating anyone, it's just my crap work code (which doesn't actually work yet). I haven't benched anything, and my experience with AJP is very limited.

I used the package org.apache.coyote.ajp for it, and it reuses most of the message code, parsing and composition from regular AJP. One of the issues I'm facing, however, is that the usage of JNI will make the current code subpar, where it would be a lot better to do message reading and writing (this means composition of the messages to avoid useless bytes copying) using direct buffers. So there's a lot of work left, and it will remain experimental for a little while.

If I understand you correctly, you want MsgAjp to use ByteBuffer instead of byte []. At the cost of never supporting JDK 1.3 ever again, this would probably actually improve the performance of ChannelSocket (after changing it to use a blocking SocketChannel).

Well, yes, I'll have to use a direct ByteBuffer like I do for HTTP. Otherwise, byte array copy over JNI will be slower. It's quite annoying, but using JNI imposes a certain design for buffering :(

One of the possibilities is to have AjpMessage (I renamed it, sorry) backed by a direct BB, or - as I am investigating at the moment - just write directly to a large BB. Reading, which faces the same problem, will likely have to use a large direct BB to avoid useless copying. For example, the current AJP code does two reads to read a message. Since in JNI, the best optimization is to lower the amount of JNI calls, this will have to be changed (which has fairly large consequences).

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to