<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - xdg-open is extremely slow because get_key executes grep unnecessarily"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=88524">88524</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>xdg-open is extremely slow because get_key executes grep unnecessarily
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Portland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.1.0 rc3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>xdg-utils
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>portland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alexhenrie24@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=112374" name="attach_112374" title="[PATCH] xdg-open: Improve performance of get_key function">attachment 112374</a> <a href="attachment.cgi?id=112374&action=edit" title="[PATCH] xdg-open: Improve performance of get_key function">[details]</a></span>
[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 <a href="http://www.google.com/">http://www.google.com/</a>
START /usr/lib/firefox/firefox "<a href="http://www.google.com/">http://www.google.com/</a>"

(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 <a href="http://www.google.com/">http://www.google.com/</a>
START /usr/lib/firefox/firefox "<a href="http://www.google.com/">http://www.google.com/</a>"

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

real    0m0.843s
user    0m0.157s
sys    0m0.043s</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>