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. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
If i retrieve a single WebMapService with 145 included Layers it tooks:
Database lookup | 0.2719s
Serialization | 0.0548s
Django request/response | 0.0144s
API view | 0.0053s
Response rendering | 2.1091s
If i retrieve a single WebMapService with 145 included Layers and 12 Layer.ReferenceSystem objects it tooks:
Database lookup | 0.2872s
Serialization | 0.0620s
Django request/response | 0.0201s
API view | 0.0051s
Response rendering | 4.2001s
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 of extract_included inside the several for loops is the week point.
Is there any tweak to optimize the for loops? Maybe as parallelized variation?
Beta Was this translation helpful? Give feedback.
All reactions