Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CachingPostSerializer defining associations twice; add FragmentCaching benchmaking #1698

Merged
merged 2 commits into from
Apr 22, 2016

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Apr 20, 2016

Summary

You can see that with caching on the caching serializer is slightly slower than the non-caching, and the fragment caching serializer is much slower

serializer_type ips objects
caching 190.252 8259
non-caching 211.199 7295
fragment 53.773 22761

with caching off (i.e. disabled in the controller) the serializer behavior is more similar

serializer_type ips objects
caching 163.787 8290
non-caching 163.678 7295
fragment 45.753 22761

(these are run on my mbp while it's mostly idle, so compare the ips rather than look at absolutes, and then with a little fuzziness. I should include sterr in the future)

Also note that the objects being serialized are all in-memory. There are no queries being made.

Related

Source

Running

SUMMARIZE=true bin/bench_regression 7485c84 335869e --repeat-count=5 --env='BENCH_STRESS=true' --pattern='bm_caching'

Details

var this-pr = {
  "commit_hash": "335869e",
  "version": "0.10.0.rc5",
  "rails_version": "4.2.6",
  "benchmark_run[environment]": "2.2.2p95",
  "runs": [
    {
      "benchmark_type[category]": "caching on: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 190.252,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 8259
    },
    {
      "benchmark_type[category]": "caching on: fragment caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 53.773,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 22761
    },
    {
      "benchmark_type[category]": "caching on: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 211.199,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 7295
    },
    {
      "benchmark_type[category]": "caching off: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 163.787,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 8290
    },
    {
      "benchmark_type[category]": "caching off: fragment caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 45.753,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 22761
    },
    {
      "benchmark_type[category]": "caching off: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 163.678,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 7295
    }
  ]
}
var master = {
  "commit_hash": "7485c84",
  "version": "0.10.0.rc5",
  "rails_version": "4.2.6",
  "benchmark_run[environment]": "2.2.2p95",
  "runs": [
    {
      "benchmark_type[category]": "caching on: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 274.5,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 6005
    },
    {
      "benchmark_type[category]": "caching on: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 294.831,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 5357
    },
    {
      "benchmark_type[category]": "caching off: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 233.751,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 6005
    },
    {
      "benchmark_type[category]": "caching off: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 251.077,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 5357
    }
  ]
}

@beauby
Copy link
Contributor

beauby commented Apr 20, 2016

So nothing has changed?

@bf4
Copy link
Member Author

bf4 commented Apr 20, 2016

@beauby no, I accidentally ran it against the same hash twice.. one moment

@bf4
Copy link
Member Author

bf4 commented Apr 20, 2016

@beauby so, the benchmark still shows that, for this test case, caching doesn't help, but at least it doesn't hurt quite as much.

@bf4
Copy link
Member Author

bf4 commented Apr 20, 2016

@beauby updated description

@beauby
Copy link
Contributor

beauby commented Apr 20, 2016

Cool, which adapter is used in the benchmark?

@bf4
Copy link
Member Author

bf4 commented Apr 20, 2016

Json since it's the most historically consistent one (for regression testing)

B mobile phone

On Apr 20, 2016, at 12:03 PM, Lucas Hosseini notifications@github.com wrote:

Cool, which adapter is used in the benchmark?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@beauby beauby added the S: LGTM label Apr 21, 2016
@bf4 bf4 merged commit 17d0759 into rails-api:master Apr 22, 2016
@bf4 bf4 deleted the fix/benchmark branch April 22, 2016 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants