Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2869

Cache the hasDecorator result in Jackson2Provider

XMLWordPrintable

    • Undefined

       In Jackson2Provider there is line to check if there is @Decorator and @Decorators before write response.

      This can be cached as what it does for JsonEndpointConfig to improve performance.   The benchmark test result shows the cache helps : 

      ----------------------Without cache ------------------------------------

      wrk -c 30 -d 1m -t 30 -s  postLua http://localhost:8081/products/add

      Running 1m test @ http://localhost:8081/products/add
      30 threads and 30 connections
      Thread Stats Avg Stdev Max +/- Stdev
      Latency 657.36us 3.58ms 159.03ms 99.13%
      Req/Sec 2.54k 519.46 11.11k 78.26%
      4545572 requests in 1.00m, 498.52MB read
      Requests/sec: 75627.27
      Transfer/sec: 8.29MB

      wrk -c 30 -d 1m -t 30 -s  postLua http://localhost:8081/products/add

      Running 1m test @ http://localhost:8081/products/add
      30 threads and 30 connections
      Thread Stats Avg Stdev Max +/- Stdev
      Latency 471.51us 1.00ms 75.33ms 97.08%
      Req/Sec 2.62k 473.19 9.61k 78.33%
      4688278 requests in 1.00m, 514.18MB read
      Requests/sec: 78003.95
      Transfer/sec: 8.55MB

      ---------------------With cache  ---------------------------------------

      wrk -c 30 -d 1m -t 30 -s  postLua http://localhost:8081/products/add
      Running 1m test @ http://localhost:8081/products/add
      30 threads and 30 connections
      Thread Stats Avg Stdev Max +/- Stdev
      Latency 482.20us 1.93ms 130.01ms 98.88%
      Req/Sec 2.68k 461.63 6.98k 79.64%
      4810479 requests in 1.00m, 527.58MB read
      Requests/sec: 80033.90
      Transfer/sec: 8.78MB

       

      wrk -c 30 -d 1m -t 30 -s  postLua http://localhost:8081/products/add
      Running 1m test @ http://localhost:8081/products/add
      30 threads and 30 connections
      Thread Stats Avg Stdev Max +/- Stdev
      Latency 441.03us 1.01ms 82.80ms 97.81%
      Req/Sec 2.69k 421.98 5.65k 79.66%
      4822241 requests in 1.00m, 528.87MB read
      Requests/sec: 80229.33
      Transfer/sec: 8.80MB

       

       

       

              rhn-engineering-ema Jim Ma
              rhn-engineering-ema Jim Ma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: