News for hackers. Stuff that matters.
Re:Django Async: What's new and what's next? by bredren on Friday August 14, 2020 @04:08PM (#24162644)
How detailed was the profiling on this? Reason I ask is I’ve faced this myself and had to spend a lot of time on both query and serializer optimization.
Re:Django Async: What's new and what's next? by Bedon292 on Friday August 14, 2020 @04:51PM (#24163098)
We used `silk` a lot to profile the app. And basically all the time was being spend inside django somewhere between getting the data from the DB and spitting out the response. We would have things like 15ms in the DB, but 250ms to actually create the response. On simple things. Some of our responses were into multiple second (large amounts of data) but still only spending maybe 150ms in the db. And there was at least two weeks spent on and off trying to improve it before we finally decided we had to go somewhere else. And thats after having to redo some of our queries by hand because the ORM was doing something like 15 left joins.
Re:Django Async: What's new and what's next? by dd82 on Saturday August 15, 2020 @11:37AM (#24169614)
You might be interested in https://hakibenita.com/django-rest-framework-slow. If you weren't able to update to a 3.x version that has https://github.com/django/django/commit/a2c31e12da272acc76f3..., this might have bit you pretty hard.
Re:Django Async: What's new and what's next? by ldng on Friday August 14, 2020 @11:22PM (#24165637)
I'd be curious to know more about those 15 joins. Why do you think the ORM was doing those ? And what DB are you using ?
Re:Django Async: What's new and what's next? by Bedon292 on Saturday August 15, 2020 @07:18AM (#24168053)
Basically just a complex permission model based on relationships. Much better handled with a subquery. Mostly on is. I don't blame the ORM entirely, but it was more joins than necessary too.
Re:Django Async: What's new and what's next? by ldng on Saturday August 15, 2020 @03:11PM (#24171416)
Isee. Would love to find an elegant way to use PostgreSQL permissions system from Django that would result in a great perf boost, no doubt.