-
Notifications
You must be signed in to change notification settings - Fork 153
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
Improve performance for serialization of entities #76
Conversation
This is great! The build is still failing, if you could please take a look. Also please do update CHANGELOG. |
- be_true/ be_false are no longer equivalent to "== true"/"== false" within rspec 3.0.
- Prevent constant rebuilding of Entity's @exposures class instance variable, improving serialization performance by 25%.
- Was being rebuilt over and over again. Performance improvement of about 25%.
- Buys another ~10% of performance gain
- Avoid using the to_s, split, last, to_sym chain. Improves performance another ~10%.
I've updated the changelog and rebased against #77 . |
Improve performance for serialization of entities
Yay! Glad I could help! |
Out of curiosity, when would the next release occur? I'm eager to leverage this code without having to do goofy Gemfile tricks. Thanks again! |
I plan to make a release soon, maybe next week? I usually integrate it into our very large API project first, that just takes me a while to wait on builds/tests to finish... |
Oh wait, this is grape-entity, not Grape. I can cut a small release now. |
Et voila, 0.4.4 is out. Performance is a good argument :) |
👍 |
Hi there,
I spent a little bit of time profiling grape-entity using ruby-prof, and found a couple of ways to improve performance during the serialization process. This changeset sees Grape::Entity serializing ~2.5 times faster, by my benchmark.
Before:
After: