Ah, I'm going to have to agree with Emmanuel on this one. The resolution of time measurement (regardless of whether it is timeinMillis() or nanoTime()) is just not accurate enough to do this sort of measurement, particularly when you're sending the packets localhost, since the handling time is miniscule. When set to display the time per packet with a 4 ms sleep, 99 of the packets had a time of 0 ms, and one had a time of 16 ms. All of those packets with a time of 0 ms of course had some time value greater than 0, but is was not taken into account when averaged to yield the individual average lifetime.
The calculated average lifetime is a reasonably fairer value, since the counter keeps running for the whole time packets are send and received...however this also means it will include a lot more overhead...which generally won't matter but in the case of these minimal numbers will. Based on the numbers, it does seem like mina will handle packets spaced out with a sleep better than a ton of packets thrown at it at once, however...that does not seem too astounding of a conclusion to make. As for the note about individual lifetime being greater than the global average; it could have something to do with the fact that the the calculated average will benefit from parallelism of requests. This would be mostly notable when the time it takes to handle requests is greater than the sleep between packets though, since in that case it would be a serial process. I like numbers and statistics though and am interested in the performance of Mina, so it sounds like you have a nice project. It depends what you're particular goal is...but you may want to try things like increasing the size of your message, or sending them between two physical computers instead of localhost, so that the time per packet is greater and weights heavier against the error in the system time keeping. Chris ________________________________ From: Bruno de Carvalho <[email protected]> To: [email protected] Sent: Friday, July 24, 2009 12:21:04 PM Subject: Re: Message processing issue with MINA Chris, Thanks for your attention and time. It is in fact reasonable but if you increase the sleep time - say, like 4ms - you will notice that the individual lifetime average goes lower than that those 5ms. What I'm trying to understand is why that individual lifetime is greater than the global average. It may even be normal, I'm just trying to get a proper and convincing explanation - these results will go in a thesis, so you see why I need that explanation ;) Still, those are pretty good results, I can't get any better than an average of 40ms with a core 2 duo lappy @ 2Ghz, both windows and linux. Best regards, Bruno
