|
Well, I just use the (Mina) ByteBuffer (see
http://mina.apache.org/report/1.1/apidocs/org/apache/mina/common/ByteBuffer.html)
methods to get each field (e.g. getUnsignedInt, getString, getChar). I
have one class that does the basic unpacking (header, CRC, payload size
etc.), and some more specific classes that worry about the payload. I
didn't find it cumbersome, although a struct would have been easier. But now that it's implemented, I only deal with nice and easy message objects that contain the processed data (using the DemuxingProtocolCodecFactory). Could you give a more detailed specification of one of your packets? It would give us some more insight into the problem. Jeroen Brattinga mat wrote: The reason why I raised this thread is: recently I am really bothered with following issue.My mina component has to connect to a legacy server written in C++. C++ server just simply sends out the struct as a message. I think for a C++ program it is just simple return the struct pointer and use each field. However, to my java program that is a disaster(also really lower the performance). I have to use all the system.arraycopy to make up each field.(Actually it causes OOM). I don't know if you guys ever faced this kind of problem. How to solve it? On 8/11/07, Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:Hi guys, when guessing relative performances of Java/C++ on a network environment, please keep in mind that data processing will be processed orders or magnitude faster than simple network handling by the underlying layer. Thinking that Java is slower than C++ to handle messages on a network based application because it does not have pointers is out of base. FYI, I have tested our LDAP server on my laptop, sending Search requests through MINA (Apache Directory Server is based on MINA, 1.0.3 version), and I got something like 5000 req/s (a request is around 1kb), assuming that almost all the time is spent internally to the server itself, not in the MINA layer. Btw, LDAP messages are binary, but that does not mean it's easier to decode them in C/C++ than in Java (I would say that the complexity is exactly the same for both languages). I don't want to start a flame war, but I encourage anyone who want to compare Java and C++ to compare things that are comparable, and not blind guess what can be slow or fast in both languages. My 2cts Emmanuel On 8/11/07, mat <[EMAIL PROTECTED]> wrote: |
- Mina throughput mat
- Re: Mina throughput Michael Grundvig
- Re: Mina throughput Mark
- Re: Mina throughput mat
- Re: Mina throughput Emmanuel Lecharny
- Re: Mina throughput mat
- Re: Mina throughput Jeroen Brattinga
- Re: Mina throughput Emmanuel Lecharny
- Re: Mina throughput mat
- Re: Mina throughput Jeroen Brattinga
- Re: Mina throughput Mehmet D. AKIN
- Re: Mina throughput mat
- Re: Mina throughput Mehmet D. AKIN
- Re: Mina throughput mat
