Opened 11 years ago
Closed 10 years ago
#22867 closed Cleanup/optimization (fixed)
Pickling models is slow in alpha versions
Reported by: | Alexander Schepanovski | Owned by: | nobody |
---|---|---|---|
Component: | Utilities | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | loic84 | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When pickling Django models in alpha version get_version()
creates a git subprocess, which is very slow. I suggest memoizing get_version()
.
Change History (12)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
+1 although I'd only wrap get_git_changeset
with lru_cache
.
Marking as a release blocker for 1.8 since this is a regression from #21430.
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
While this commit was correct, I had to revert it because it broke the docs builds, which are still running on Python 2.6.
We need to upgrade the djangoproject.com server before we can push this change. Sorry for the inconvenience.
comment:7 by , 11 years ago
Upgrading Python 2.6 which is EOL and recommitting this fix is the ideal course of action.
However if we don't manage to do so within a few of days, I'd suggest we go with a stopgap solution like https://gist.github.com/313430836d20006916c4.
The regression could be quite severe to anyone caching large querysets since we'd be starting a process for each model.
comment:8 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 by , 11 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | unset |
Severity: | Release blocker → Normal |
Reopening as a "Cleanup/optimization" so we don't lose track of replacing this temporary fix with lru_cache
.
comment:10 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
comment:11 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
We are just waiting on the new server.
comment:12 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Created pull request https://github.com/django/django/pull/2829