[llvm-bugs] [Bug 51037] New: __cxa_throw performance issue

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 9 04:20:16 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51037

            Bug ID: 51037
           Summary: __cxa_throw performance issue
           Product: libc++abi
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: glibcxx.chrono at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 25012
  --> https://bugs.llvm.org/attachment.cgi?id=25012&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210709/631846fb/attachment.html>


More information about the llvm-bugs mailing list