Bug 21741

Summary: startup / parsing is 50% too slow at least ...
Product: hal Reporter: Michael Meeks <michael.meeks>
Component: haldAssignee: Danny Kukawka <danny.kukawka>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: bugs, jobi, scottt.tw
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch
callgrind profiles before and after

Description Michael Meeks 2009-05-14 16:56:38 UTC
The attached patch substantially accelerates hald startup, by simplifying a very slow code-path. We were spending 50% of the time (previously) calling strncpy 400k times or so ;-)
The patch swaps this for a simple pointer assignment in the common case - and also mostly avoids the 13% of the time we were spending in g_strsplit / g_strnfree un-necessarily.
Comment 1 Michael Meeks 2009-05-14 17:03:21 UTC
Created attachment 25877 [details] [review]
patch
Comment 2 Michael Meeks 2009-05-14 17:06:33 UTC
Created attachment 25878 [details]
callgrind profiles before and after
Comment 3 Scott Tsai 2009-05-14 20:57:33 UTC
The new 'resolve_udiprop_path' in the patch doesn't have 'udi_result_size' and 'prop_result_size' parameters but the copy and pasted comment block still have '@param  prop_result_size'.
Comment 4 Michael Meeks 2009-05-18 03:53:55 UTC
Scott - true; a trivial fix is required there as it's committed ;-)
Any other review ? and/or who might merge this ?
Comment 5 Kay Sievers 2009-07-18 04:18:52 UTC
part of 0.5.13

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.