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

Requests with big payloads are extremely slow due to bug in Hashie::Mash #494

Closed
zuk opened this issue Oct 24, 2013 · 4 comments
Closed

Comments

@zuk
Copy link

zuk commented Oct 24, 2013

Requests with big payloads (in our case a large JSON object) are extremely slow. This is due to a bug in Hashie::Mash. See here: hashie/hashie#107

Once that pull request is pulled in, I'd recommend switching Grape's minimum requirement for hashie to >= 2.0.6 (assuming this gets released as 2.0.6).

In the meantime adding the git requirement to our Gemfile seems to have fixed the problem in grape:

gem 'hashie', :git => 'https://github.com/connectedbits/hashie.git'

@dblock
Copy link
Member

dblock commented Oct 25, 2013

What's the stack for where one hits this in Grape? Basically, how does one know whether this affects them badly or not?

@zuk
Copy link
Author

zuk commented Oct 25, 2013

I'll post some cases later, but I found that swapping in the patched
version of Hashie improved Grape performance across the board. It
becomes really noticeable when you're dealing with big JSON payloads. I had
one request that handled a very large JSON object (couple hundred kb), and
it took about 5 minutes to process. With the patched Hashie it now takes about 10 seconds.

@dblock
Copy link
Member

dblock commented Oct 29, 2013

Fyi, I have a branch with the fix and tests, https://github.com/dblock/hashie/tree/convert-value-performance-fix.

dblock added a commit that referenced this issue Apr 6, 2014
@dblock
Copy link
Member

dblock commented Apr 6, 2014

Closed via a77ac5b.

@dblock dblock closed this as completed Apr 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants