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

[WIP] Make Serializers serializable, Step 2 #1684

Closed

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Apr 15, 2016

Purpose

As part of fixing the caching issues, this PR continues to moving the responsibility
of serializing attributes and associations from the adapter to the serializer.

This change allows the adapter to focus on its job: adapting the resource serialization
to the (output) API format.

Changes

TBD

Caveats

TBD

Related GitHub issues

Continues from #1638

Additional helpful information

.merge(cached_relationships(adapter_options, adapter_instance, include_tree))
end

def cached_relationships(adapter_options, adapter_instance, include_tree)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be broken up in to more methods? / with comments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, hence 'wip' :)

@beauby beauby changed the title [WIP] Make Serializers serializalbe, Step 2 [WIP] Make Serializers serializable, Step 2 Apr 18, 2016
bf4 added 9 commits May 17, 2016 10:43
… was

caching on: caching serializers: gc off 597.9825413721817/ips; 1745 objects
caching off: caching serializers: gc off 576.9306068627038/ips; 1745 objects
caching on: non-caching serializers: gc off 840.493020494064/ips; 1234 objects
caching off: non-caching serializers: gc off 832.0417547059424/ips; 1234 objects
caching on: caching serializers: gc off 676.494074362274/ips; 1745 objects
caching off: caching serializers: gc off 644.3862313182249/ips; 1745 objects
caching on: non-caching serializers: gc off 878.2599353175016/ips; 1234 objects
caching off: non-caching serializers: gc off 847.1395402647764/ips; 1234 objects
caching on: caching serializers: gc off 666.8441794123615/ips; 1745 objects
caching off: caching serializers: gc off 640.9680661037794/ips; 1745 objects
caching on: non-caching serializers: gc off 929.1861177725112/ips; 1234 objects
caching off: non-caching serializers: gc off 858.6922209833513/ips; 1234 objects
caching on: caching serializers: gc off 683.4188849478967/ips; 1745 objects
caching off: caching serializers: gc off 650.3484452934335/ips; 1745 objects
caching on: non-caching serializers: gc off 942.3903022345789/ips; 1234 objects
caching off: non-caching serializers: gc off 880.6233058416065/ips; 1234 objects
caching on: caching serializers: gc off 676.163805262553/ips; 1745 objects
caching off: caching serializers: gc off 645.2491434607599/ips; 1745 objects
caching on: non-caching serializers: gc off 924.4019986994008/ips; 1234 objects
caching off: non-caching serializers: gc off 892.1286990682768/ips; 1234 objects
Benchmark results:
{
  "commit_hash": "52442e0",
  "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]": 683.419,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1745
    },
    {
      "benchmark_type[category]": "caching off: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 650.348,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1745
    },
    {
      "benchmark_type[category]": "caching on: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 942.39,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1234
    },
    {
      "benchmark_type[category]": "caching off: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 892.129,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1234
    }
  ]
}
Benchmark results:
{
  "commit_hash": "33ae947",
  "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]": 677.638,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1795
    },
    {
      "benchmark_type[category]": "caching off: caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 647.854,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1795
    },
    {
      "benchmark_type[category]": "caching on: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 936.023,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1252
    },
    {
      "benchmark_type[category]": "caching off: non-caching serializers: gc off",
      "benchmark_run[result][iterations_per_second]": 882.823,
      "benchmark_run[result][total_allocated_objects_per_iteration]": 1252
    }
}
@bf4
Copy link
Member Author

bf4 commented Jun 9, 2016

Resolve by linked issues, yay!

@bf4 bf4 closed this Jun 9, 2016
@bf4 bf4 deleted the serializer_can_fully_serialize_itself branch June 9, 2016 05:08
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