- Notifications
You must be signed in to change notification settings - Fork302
-
Hi folks, in my case i implemented a view with some include and nested include options. I analyzed the timings of the several steps of the django request lifecycle as so following: WebMapService endpoint with the option to include Layer and Layer.ReferenceSystem objects. Database lookup | 0.2719s If i retrieve a single WebMapService with 145 included Layers and 12 Layer.ReferenceSystem objects it tooks: Database lookup | 0.2872s As i can see, the rendering of the response is the bottleneck and it scales non linear in relation to the count of included objects. Digging deeper, it shows out that the nested call ofextract_included inside the several for loops is the week point. Is there any tweak to optimize the for loops? Maybe as parallelized variation? |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 2 replies
-
Thanks for bringing this up. I took a look at the extract_included function and there are three obvious things I see which can be improved:
In any case, before we do performance improvements, we need a test which shows that So if anyone is interested to dive into it, a PR with a performance test would be a very good first step. |
BetaWas this translation helpful?Give feedback.
All reactions
-
i implemented a high leveltest which calls a view with include option and the view response with 10000 included items. I tested your three points, but none of them increases the performance notable. Interesting to see that as you pointed out, the number of fields increases the runtime a lot. Cause there are no recursive calls of the For now i don't know how to optimize the list serializer looping. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I think to dive deeper into this issue, it would be good to get some in-depth profiling. You could use thepytest-profiling plugin to create a svg graph and post this here for discussion. |
BetaWas this translation helpful?Give feedback.