<html>
    <head>
      <base href="https://bugs.llvm.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 - __cxa_throw performance issue"
   href="https://bugs.llvm.org/show_bug.cgi?id=51037">51037</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__cxa_throw performance issue
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++abi
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>glibcxx.chrono@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=25012" name="attach_25012" title="File with code in issue">attachment 25012</a> <a href="attachment.cgi?id=25012&action=edit" title="File with code in issue">[details]</a></span>
File with code in issue

Hi, i noticed this unusual behaviour of exception-throwing system.

This is small analysis of `Storage::StorageRecord* Storage::find` function most
expensive operations from my project (full code available in file below):

    flags:      -std=c++1z -O1 -fno-stack-protector
    ldflags:    <none>

    сlang++ -   QtCreator profiler:
                 __cxa_throw                 cost (instruction read access): 
171,241,920
                |__ _Unwind_RaiseException   cost (instruction read access): 
170,541,920

     g++ -      QtCreator profiler:
                 __cxa_throw                 cost (instruction read access): 
133,161,906
                |__ _Unwind_RaiseException:  cost (instruction read access): 
132,541,906


You can see, that performance difference between GCC and Clang almost 30%.

I think, for same optimization level Clang's exception-throwing costs are too
high compared to GCC.

Thank you for your attention.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>