CleanSave.__getattribute__ causes significant performance reduction
Bug #1843052 reported by
Björn Tillenius
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Björn Tillenius | ||
2.6 |
Fix Released
|
High
|
Björn Tillenius |
Bug Description
We have code in CleanSave.
that have been deferred to load. It makes sense, since we only defer
attributes if we don't want them to be loaded.
However, doing that check in CleanSave.
it gets executed for every attribute access. That's very expensive.
Even if it takes a few microseconds to do the check, that can easily
add up to seconds in a request.
By moving that check to monkeypatch DeferredAttribu
websocket call to get the list of machines got almost twice as fast
as before.
Related branches
~bjornt/maas:2.6-fix-cleansave-getattribute
- Björn Tillenius: Approve
-
Diff: 123 lines (+31/-33)3 files modifiedsrc/maasserver/models/cleansave.py (+0/-29)
src/maasserver/models/tests/test_cleansave.py (+2/-4)
src/maasserver/monkey.py (+29/-0)
~bjornt/maas:fix-cleansave-getattribute
Merged
into
maas:master
- Blake Rouse (community): Approve
- MAAS Lander: Needs Fixing
- MAAS Maintainers: Pending requested
-
Diff: 123 lines (+31/-33)3 files modifiedsrc/maasserver/models/cleansave.py (+0/-29)
src/maasserver/models/tests/test_cleansave.py (+2/-4)
src/maasserver/monkey.py (+29/-0)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Björn Tillenius (bjornt) |
milestone: | none → 2.7.0alpha1 |
status: | Triaged → In Progress |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.