Skip to content

zlx/ams-demo

Repository files navigation

Design for The Benchmark

Models:

  • Question belongs_to User
  • Answer belongs_to User
  • Answer belongs_to Question

Note:

  • use seed to mock mass of data
  • provide API to get questions/answers/users
  • use sleep to simulate calculate in real situation
  • request 10 API to zoom in the request time
  • change data between request to simulate data change in real situation
  • Change/Request as an indicator for application data change frequency

How to Benchmark ams cache

  1. comment cached: true in every Serializer file
  2. run bin/rake benchmark:ams:static to get the uncache data for reference group
  3. uncomment cached: true
  4. change Request Count(r) and Change Count(c), and run bin/rake "benchmark:ams:dynamic[r, c]"
  5. rm tmp/cache directory and run Step 4

How to Benchmark jbuilder cache

  1. comment json.cache! in every .jbuilder file
  2. run bin/rake benchmark:jbuilder:static to get the uncache data for reference group
  3. uncomment json.cache!
  4. change Request Count(r) and Change Count(c), and run bin/rake "benchmark:jbuilder:dynamic[r, c]"
  5. rm tmp/cache directory and run Step 4

Benchmark Result

benchmark result

ams cache result

ams Benchmark Result

jbuilder cache result

jbuilder Benchmark Result

notes:

  • x is Change/Request, Request total is 10
  • y is No Cache Request Time / Cached Request Time

About

Demo App for New AMS Cache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published