Bug 88524

Summary: xdg-open is extremely slow because get_key executes grep unnecessarily
Product: Portland Reporter: Alex Henrie <alexhenrie24>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 1.1.0 rc3   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH] xdg-open: Improve performance of get_key function

Description Alex Henrie 2015-01-17 08:33:32 UTC
Created attachment 112374 [details]
[PATCH] xdg-open: Improve performance of get_key function

The attached patch improves the performance of xdg-open by a factor of 10 by avoiding unnecessary grep calls.


Without this optimization:

time ./xdg-open http://www.google.com/
START /usr/lib/firefox/firefox "http://www.google.com/"

(process:17426): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

real	0m7.956s
user	0m1.693s
sys	0m0.453s


With this optimization:

time ./xdg-open http://www.google.com/
START /usr/lib/firefox/firefox "http://www.google.com/"

(process:17531): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

real	0m0.843s
user	0m0.157s
sys	0m0.043s
Comment 1 Rex Dieter 2015-01-19 11:37:54 UTC
committed,thanks.
Comment 2 Alex Henrie 2015-01-19 16:21:35 UTC
Thank you!

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.