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

            Bug ID: 36155
           Summary: FastDemangle performance problem
           Product: lldb
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-...@lists.llvm.org
          Reporter: feishenni...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Here's a simple python program that generates a mangled string with size n:

def gen(n):                                                                     
    prefix = '_Z0'                                                              
    suffix = 'Mm0'                                                              
    content = 'M0' * (n-6)                                                      
    return prefix + content + suffix

lldb's FastDemangler exhibit quadratic behavior when demangling such a string.
On my laptop (2015 Thinkpad t440p Arch Linux), setting n to ~20000 will cause a
noticable slowdown, and ~50000 would just segfault the program.

The same inputs are rejected instantly by itaniumDemangle() as well as c++filt.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to