If I'm understanding your benchmark correctly, the measureSumArrayHttp test is measuring average latency of:
- send a HTTP request via a client
- jetty receives the HTTP request
- the summation code runs in a servlet
- jetty produces a response
- the client receives the response
So firstly, this is a really bad way to benchmark a server:
- you will include time in client
- you don't know the client and/or server connection reuse policy, so your latencies may also include connection establishment times
- If you are concerned by throughput, then the rate requests are offered is a function of latency, which is not real world.
- If the client is using a single connection, then you are likely to only be using a single CPU core on the server, so throughput will look less.... but then it won't be contending with other server threads for shared resources, so latency may be better
Given all that, you need to find out where the extra latency is coming from, with my two suspects being either the client itself or connection establishment time due to different reuse policies.
Enable the jetty stats handler and connection statistics and that will tell you latencies within the servlet and how many requests per connection etc. That will help you narrow down where the issue is.
cheers