[PATCH] D22782: Added 'inline' attribute to __init to inline the basic_string's constructor

Sebastian Pop via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 17:07:24 PDT 2016


sebpop added a comment.

In https://reviews.llvm.org/D22782#495436, @mclow.lists wrote:

> Do we have a test for the problem that this is solving?


I think we can write a testcase that shows that copy constructors are not optimized away unless the string constructor is inlined.

This patch fixes the performance of a proprietary benchmark when compiled with libc++, closing the performance gap with the same benchmark compiled with the gnu libstdc++. Overall with this patch we have half a billion fewer instructions out of about 10 billion.


https://reviews.llvm.org/D22782





More information about the cfe-commits mailing list