users@jersey.java.net

[Jersey] Slow Resource Method Matching

From: Alden Quimby <aldenquimby_at_gmail.com>
Date: Tue, 16 Sep 2014 09:17:36 -0400

I've been trying to improve the performance of one of my jersey apis, and
when I turn on tracing, I'm seeing slow resource method matching:

     GET /computers/apple/9?refurbished_id=47


   1. X-Jersey-Tracing-002:
   MATCH [1175.91 / 1177.54 ms | 60.83 %] RequestMatching summary


1.175 seconds to match the resource is a little crazy, especially because
the url causing this is really straightforward. My path annotations are as
follows:

@Path("/computers")
class SomeClass
{
    @Path("/apple/{id}")
    void someMethod(@PathParam("id") id, @QueryParam("refurbished_id")
refurbishedId)
    {
        ...
    }
}

Has anyone run into issues with resource method matching? Any suggestions
for improvements I can make here? I am using Jersey 2.11, @ManagedAsync
everywhere, and have roughly 50 requests per second coming in.

Thanks for the help!