CleanSave.__getattribute__ causes significant performance reduction

Bug #1843052 reported by Björn Tillenius
6
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.__getattribute__ which prevents attributes
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.__getattribute__ means that
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 DeferredAttribute.__get__, the
websocket call to get the list of machines got almost twice as fast
as before.

Related branches

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.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.