----- Original Message -----
> From: "Nir Soffer" <[email protected]>
> To: "devel" <[email protected]>, "Francesco Romani" <[email protected]>, 
> "Eldad Marciano" <[email protected]>,
> "Vinzenz Feenstra" <[email protected]>, "Dan Kenigsberg" 
> <[email protected]>, "Piotr Kliczewski"
> <[email protected]>
> Sent: Thursday, February 18, 2016 12:38:44 AM
> Subject: [VDSM] Profiling results - 144 cores, 144 vms
> 
> Hi all,
> 
> I noticed that Eldad posted profiling result from 144 cores / 144 vms run:
> See https://bugzilla.redhat.com/attachment.cgi?id=1128028
> 
> Looking at the profile bellow:
> 
> 2. Creating DomainDescriptor seems expensive - is this xml.minidom?

Let's look at DomainDescriptor's __init__


class DomainDescriptor(object):

    def __init__(self, xmlStr):
        self._xml = xmlStr
        self._dom = xml.dom.minidom.parseString(xmlStr)
        self._devices = self._first_element_by_tag_name('devices')
        self._devices_hash = hash(self._devices.toxml()
                                  if self._devices is not None else '')

so we parse using the slow minidom _and_ we do toxml() on a subset of the xml 
tree.
Both operations are expensive (and quite memory expensive).

Milan is already working on moving from minidom to etree, I think we are on 
good track
here for 4.0.


-- 
Francesco Romani
RedHat Engineering Virtualization R & D
Phone: 8261328
IRC: fromani
_______________________________________________
Devel mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/devel

Reply via email to