On Oct 26, 2006, at 8:47 PM, Mark DeLaFranier wrote:
Hey guys,
I am sorta informally looking at the performance of OpenEJB. Now I
am certainly not trying to open a can of worms here. :-) An idea
that I am currently playing with is to modify the client so that it
can re-use an existing open socket connection to the server rather
then doing open-write-read-close and at the same time, the server
will loop and keep reading requests from the same socket.
This is excellent. I've wanted to fix this for a very long time but
wasn't a can of worms I wanted to open till someone complained.
Well, a couple people have complained, but your the first with
time... so you win!
My first thought was to enhance the OEJP to support "headers" like
HTTP does and then use the "keepalive" idea. I bumped up the OEJP
version to 2.1 so that the client/server would know to check for
the existance of headers in the request/response. The marshalled
headers would be in the format of:
Existing structure: [OEJP/2.0][request-id][request-data]
New structure: [OEJP/2.1][#-of-headers][headers][request-id]
[request-data] where headers is [len][name-data][len][value-data]
This saved, combined with socket pooling, approx. 34%
My second thought was to avoid the NVP headers and use a byte array
of bit flags, the new format is:
[OEJP/2.1][byte-of-flags][request-id][request-data]
This is 27% faster then my first thought.
Can you give more info on the byte approach? Not grokking why it's
slower than bytes of "string" data
What is the nature of your NVP? What would be the data type of the
name and of the value?
-David