Performance hit in a django view
See original GitHub issueWe saw a performance hit on one of our stats pages where we query around 800 rows of data each one of them has around 15-20 columns, some of them query json fields and some arrays.
We discovered that the issue is in django-dirtyfields, which we use a lot, but not in this specific view.
There is no easy way to turn off the checks, we patch
ed the _as_dict
method as a workaround.
Would be great if we could have a way to turn the dirtyfields off in specific cases where its not needed and not just globally with FIELDS_TO_CHECK
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Performance and optimization - Django documentation
However: most performance problems in well-written Django sites aren't at the Python execution level, but rather in inefficient database querying, caching, and ...
Read more >Guide to Django Performance Testing and Optimization - Toptal
In this article, I would like to talk about five common methods to optimize your web project's code. I will use Django, but...
Read more >Solving Performance Problems in the Django ORM
The vast majority of performance problems in a web application are related to accessing the database. Unless you are dealing with large amounts...
Read more >guidelines for speeding up template rendering performance
I've already attempted to perform all database access in the view, such that the template only hits RAM and not the DB engine....
Read more >Data Performance Tips with Django - YouTube
Most performance problems in web applications come down to one thing: the database. In this webinar, veteran #Python developer Andrew ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @romgar
I work with @OrDuan I created a PR to show our current solution using a queryset method if that can help: https://github.com/romgar/django-dirtyfields/pull/134
IMO, it’s quite hacky as it requires to override some core django components so if you have a better solution, feel free to ignore all or most of it. 😄
Thanks
Since no-one objected to my suggestion above, I went ahead and documented it in #193. Going to close this issue now.