-
Notifications
You must be signed in to change notification settings - Fork 420
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
Better benchmarks using existing method #97
Better benchmarks using existing method #97
Conversation
The 25x speed improvement was something we observed in our current master branch. if we change the key_transform to
As you can see these are still showing more than 25x improvement. Let's ignore the JSON String serialization comparison as both fast_jsonapi and AMS really just produce the ruby hash. This ruby hash is serialized to a string later with a JSON engine like (OJ, YAJL, etc). I have said this before in #51 . This effectively would rule out any effects of Oj.optimize_rails or oj_mimic_json on the benchmark numbers The dev branch currently shows 15x to 35x improvement depending on features used and number of records being serialized. Here are the benchmark numbers when AMS key_transform is set to
@NullVoxPopuli I think we have covered extensively about the benchmark numbers in several issues, pull request comments, and the performance write up that we have added to the repo. We have said repeatedly the goal of these tests is only to make developers aware of the performance implications of the features they are helping us build. I would be happy to accept the pull request if it changes the AMS key_transform to |
* add hash benchmarking to performance tests * Add missing attribute in README example * Disable GC before doing performance test * Enable oj to AM for fair benchmark test * add information on performance methodology * add oss metadata * Make an error that demonstrates [Issue * Simple RSpec test that fails with a non-empty string but passes with a non-empty symbol * To run the test, rspec spec/lib/object_serializer_spec.rb * Map includes to symbols if they are provided as strings * Includes would fail with an ArgumentError unless they were explicitly provided as symbols (see #97) * This is solved by mapping the strings to symbols in the ObjectSerializer initializer * No real impact on performance here
Closing this as there is no response |
* add hash benchmarking to performance tests * Add missing attribute in README example * Disable GC before doing performance test * Enable oj to AM for fair benchmark test * add information on performance methodology * add oss metadata * Make an error that demonstrates [Issue * Simple RSpec test that fails with a non-empty string but passes with a non-empty symbol * To run the test, rspec spec/lib/object_serializer_spec.rb * Map includes to symbols if they are provided as strings * Includes would fail with an ArgumentError unless they were explicitly provided as symbols (see Netflix#97) * This is solved by mapping the strings to symbols in the ObjectSerializer initializer * No real impact on performance here
* add hash benchmarking to performance tests * Add missing attribute in README example * Disable GC before doing performance test * Enable oj to AM for fair benchmark test * add information on performance methodology * add oss metadata * Make an error that demonstrates [Issue * Simple RSpec test that fails with a non-empty string but passes with a non-empty symbol * To run the test, rspec spec/lib/object_serializer_spec.rb * Map includes to symbols if they are provided as strings * Includes would fail with an ArgumentError unless they were explicitly provided as symbols (see Netflix#97) * This is solved by mapping the strings to symbols in the ObjectSerializer initializer * No real impact on performance here
I'm not a huge fan of AMS, but it's a diservice to claim 25x when AMS, by default is underscored (because ruby / ActiveRecord is underscored, so telling to to perform additional transformations is cheating a bit).
Additionally, here are results with and without oj_mimic_json:
with
without