llvm-capstone/libcxx
Martijn Vels b019c5c037 Partially inline basic_string copy constructor in UNSTABLE
Summary:
    This is a recommit of https://reviews.llvm.org/D73223 where the added function accidentally ended up inside an idef block.

    This change splits the copy constructor up inlining short initialization, and explicitly outlining long initialization into __init_copy_ctor_external() which is the externally instantiated slow path.

    For unstable ABI, this has the following changes:

    remove basic_string(const basic_string&)
    remove basic_string(const basic_string&, const Allocator&)
    add __init_copy_ctor_external(const value_type*, size_type)
    Quick local benchmark for Copy:

    Master
    ```
    ---------------------------------------------------------------
    Benchmark                    Time             CPU   Iterations
    ---------------------------------------------------------------
    BM_StringCopy_Empty       3.50 ns         3.51 ns    199326720
    BM_StringCopy_Small       3.50 ns         3.51 ns    199510016
    BM_StringCopy_Large       15.7 ns         15.7 ns     45230080
    BM_StringCopy_Huge        1503 ns         1503 ns       464896
    ```
    With this change
    ```
    ---------------------------------------------------------------
    Benchmark                    Time             CPU   Iterations
    ---------------------------------------------------------------
    BM_StringCopy_Empty       1.99 ns         2.00 ns    356471808
    BM_StringCopy_Small       3.29 ns         3.30 ns    203425792
    BM_StringCopy_Large       13.3 ns         13.3 ns     52948992
    BM_StringCopy_Huge        1472 ns         1472 ns       475136
    ```

    Subscribers: libcxx-commits

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D75639
2020-03-04 17:52:46 -05:00
..
benchmarks Add benchmarks for basic_string::erase 2020-02-19 17:09:25 -05:00
cmake [libc++] Explicitly specify LIBCXX_ENABLE_SHARED to try and fix CI 2020-01-29 17:29:43 -08:00
docs Reland [libc++] [P0325] Implement to_array from LFTS with updates. 2020-01-31 11:47:18 +01:00
fuzzing [libc++] Tolerate NaN returning random distributions for now 2019-12-12 17:11:13 -05:00
include Partially inline basic_string copy constructor in UNSTABLE 2020-03-04 17:52:46 -05:00
lib [libc++] Fix CI and Linux failures after landing D68480 2020-02-24 11:58:25 -05:00
src Add flag _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATIONS for basic_string ABI 2020-03-02 10:26:37 -05:00
test Partially inline basic_string copy constructor in UNSTABLE 2020-03-04 17:52:46 -05:00
utils [libcxx] Drop -D option from libtool when merging archives 2020-03-02 16:07:18 -08:00
www [libc++] Implementation of C++20's P1135R6 for libcxx 2020-02-24 10:59:35 -05:00
.clang-format
.gitignore
appveyor-reqs-install.cmd
appveyor.yml
CMakeLists.txt [CMake][libcxx] Don't wrap __config_site path in quotes on Windows 2020-01-29 19:37:35 -08:00
CREDITS.TXT [libcxx] Add Sergej Jaskiewicz to CREDITS.txt 2019-11-21 12:06:10 +03:00
LICENSE.TXT
NOTES.TXT
TODO.TXT