[PATCH] D26241: [ELF] Speed-up lld up to 5 times by replacing llvm:regex with simple string matcher.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 11:04:48 PDT 2016


When I suggested using the regular expression, I was thinking that we can
use the C++11 regex, and because it's a standard, I expected it to be
highly optimized just like people did to the Perl regex engine. It would
have both NFA and DFA engines. However, it turned out that C++11 regex is
not a viable option for us (IIRC because it depends on exceptions), and at
the moment I wasn't sure how good llvm::regex is.

Ideally, we should improve llvm::regex. However, if it doesn't even support
a DFA-based matcher, it's going to be a way too much work.

So I think I'm OK with this change as long as LLD speeds up with this patch
and all tests pass. It means llvm::regex is too slow, which made me sad,
though.

On Wed, Nov 2, 2016 at 10:51 AM, Eugene Leviant <evgeny.leviant at gmail.com>
wrote:

> evgeny777 added a comment.
>
> > If you want to optimize something, you might want to do that in
> llvm::regex
>
> AFAIK llvm::regex is NFA (it's actually a rip from OpenBSD). Are you
> suggesting to implement additional DFA engine for this purpose?
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D26241
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161102/24184ce1/attachment.html>


More information about the llvm-commits mailing list