Heavy request processing time

14 views
Skip to first unread message

rgwe...@gmail.com

unread,
Aug 18, 2020, 6:32:27 AM8/18/20
to Grape Framework Discussion

Hello,

We are trying at Mapotempo to move forward to the most recent version of grape, since the documentation generation has been fixed https://github.com/ruby-grape/grape-swagger/pull/752. Nevertheless we are stuck to an old version (0.18) due to performance issues. As we are managing large data model (1Mo+) with deeply nested objects.

The post model can be consulted here :

With version 0.18, processing one instance of 7.5Mo take 92seconds.
With version 1.4, i've stopped the processing after 900+ seconds.

Please in this gist the associated time profiling: https://gist.github.com/braktar/6d980b6fa93841eead1c8e22a2fb717d

Does anyone have hint to improve the performances in such use case ?

Best regards,

Braktar

Daniel D.

unread,
Aug 18, 2020, 8:17:24 AM8/18/20
to Grape Framework Discussion
Thanks for bringing it up. I think the performance difference is visibly problematic, and we.you should run this one down.

First, please try and contribute a benchmark that reproduces this problem into https://github.com/ruby-grape/grape/tree/master/benchmark. You can generate a large file on the fly so we don't need to check-in something worth megabytes. The problem could be in the size, but also in the way parameters are defined.

From the trace, it looks like we're spending most time in parameter parsing. I would start by swapping HasWithIndifferentAccess param builder for a Hashie::Mash one and seeing if that brings things back to the old numbers - https://github.com/ruby-grape/grape#configuration

Grape.configure do |config|
  config.param_builder = Grape::Extensions::Hashie::Mash::ParamBuilder
end

You should open an issue with what you find, this is at least a regression.
 

--
You received this message because you are subscribed to the Google Groups "Grape Framework Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-grape+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ruby-grape/47ace8cc-18e8-4fd3-9ec3-749f2492c74an%40googlegroups.com.


--

Daniel D.

unread,
Aug 19, 2020, 10:14:08 AM8/19/20
to Grape Framework Discussion
Thanks for writing the benchmark (https://github.com/ruby-grape/grape/pull/2096). Posting this here to link threads.

Daniel D.

unread,
Aug 21, 2020, 9:12:38 AM8/21/20
to Grape Framework Discussion
This PR was merged. Appreciate if people could run their test suites against HEAD if possible before we do a release.
Reply all
Reply to author
Forward
0 new messages