[blivet][rhel7-branch] Pass a list of string items to log_method_return. (#1155984)
Anne Mulhern
amulhern at redhat.com
Thu Oct 30 12:34:20 UTC 2014
----- Original Message -----
> From: "Anne Mulhern" <amulhern at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Thursday, October 30, 2014 8:11:03 AM
> Subject: Re: [blivet][rhel7-branch] Pass a list of string items to log_method_return. (#1155984)
>
>
>
>
>
> ----- Original Message -----
> > From: "Samantha N. Bueno" <sbueno+anaconda at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Wednesday, October 29, 2014 1:59:50 PM
> > Subject: [blivet][rhel7-branch] Pass a list of string items to
> > log_method_return. (#1155984)
> >
> > Otherwise there is some serious lagging in the UI when you select/de-select
> > a disk in the anaconda storage spoke.
> >
> > Resolves: rhbz#1155984
> > ---
> > blivet/devicetree.py | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> > index a5310b7..8173e93 100644
> > --- a/blivet/devicetree.py
> > +++ b/blivet/devicetree.py
> > @@ -2298,7 +2298,7 @@ class DeviceTree(object):
> > continue
> > if device.serial == serial:
> > retval.append(device)
> > - log_method_return(self, retval)
> > + log_method_return(self, [r.name for r in retval])
> > return retval
> >
> > def getDeviceByLabel(self, label, incomplete=False, hidden=False):
> > @@ -2376,7 +2376,7 @@ class DeviceTree(object):
> > log_method_call(self, device_type=device_type,
> > incomplete=incomplete, hidden=hidden)
> > devices = self._filterDevices(incomplete=incomplete,
> > hidden=hidden)
> > result = [d for d in devices if d.type == device_type]
> > - log_method_return(self, result)
> > + log_method_return(self, [r.name for r in result])
> > return result
> >
> > def getDevicesByInstance(self, device_class, incomplete=False,
> > hidden=False):
> > @@ -2391,7 +2391,7 @@ class DeviceTree(object):
> > log_method_call(self, device_class=device_class,
> > incomplete=incomplete, hidden=hidden)
> > devices = self._filterDevices(incomplete=incomplete,
> > hidden=hidden)
> > result = [d for d in devices if isinstance(d, device_class)]
> > - log_method_return(self, result)
> > + log_method_return(self, [r.name for r in result])
> > return result
> >
> > def getDeviceByID(self, id_num, incomplete=False, hidden=False):
> > --
> > 1.9.3
> >
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> >
>
> Might be slightly better to use str(r) instead of r.name, to be consistent.
>
> Otherwise, ack, and thanks.
>
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
Also, this should definitely go into master...and probably f21-branch as well.
It occurs to me that the commit message should say something about the fact that
the awful slowdown is due to the fact that str(list) calls __repr__ on the
underlying objects and that device __repr__ happens to be hideously expensive.
- mulhern
More information about the anaconda-patches
mailing list