From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEwg7-0000Ml-LT for qemu-devel@nongnu.org; Tue, 14 Jul 2015 05:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEwg4-0001If-FY for qemu-devel@nongnu.org; Tue, 14 Jul 2015 05:39:07 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:13126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEwg4-0001II-9r for qemu-devel@nongnu.org; Tue, 14 Jul 2015 05:39:04 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRH006VF1H16Z40@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 14 Jul 2015 10:39:01 +0100 (BST) From: Pavel Fedin Date: Tue, 14 Jul 2015 12:38:59 +0300 Message-id: Subject: [Qemu-devel] [PATCH v4 0/2] QOM: object_property_add() performance improvement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= The function originally behaves very badly when adding properties with "[*]" suffix. Normally these are used for numbering IRQ pins. In order to find the correct starting number the function started from zero and checked for duplicates. This takes incredibly long time with large number of CPUs because number of IRQ pins on some architectures (like ARM GICv3) gets multiplied by number of CPUs. The solution is to add one more property which caches last used index so that duplication check is not repeated thousands of times. Every time an array is expanded the index is picked up from this cache. The modification decreases qemu startup time with 32 CPUs by a factor of 2 (~10 sec vs ~20 sec). Pavel Fedin (2): QOM: Introduce object_property_add_single() QOM: object_property_add() performance improvement qom/object.c | 96 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 27 deletions(-) -- 1.9.5.msysgit.0