cosmopolitan/test/ctl
Steven Dee (Jōshin) 7e780e57d4
More ctl::string optimization (#1232)
Moves some isbig checks into string.h, enabling smarter optimizations to
be made on small strings. Also we no longer zero out our string prior to
calling the various constructors, buying back the performance we lost on
big strings when we made the small-string optimization. We further add a
little optimization to the big_string copy constructor: if the string is
using half or more of its capacity, then we don’t recompute capacity and
just take the old string’s. As well, the copy constructor always makes a
small string when it will fit, even if copied from a big string that got
truncated.

This also reworks the test to follow the idiom adopted elsewhere re stl,
and adds a helper function to tell if a string is small based on data().
2024-06-20 14:52:12 -04:00
..
.clang-format Introduce Cosmopolitan Templates Library (CTL) 2024-06-03 09:21:59 -07:00
BUILD.mk Make malloc() go 200x faster 2024-06-05 02:02:14 -07:00
optional_test.cc CTL: utility.h, use ctl::swap in string (#1227) 2024-06-19 01:00:59 -04:00
string_test.cc More ctl::string optimization (#1232) 2024-06-20 14:52:12 -04:00
string_view_test.cc CTL: utility.h, use ctl::swap in string (#1227) 2024-06-19 01:00:59 -04:00
unique_ptr_test.cc CTL: utility.h, use ctl::swap in string (#1227) 2024-06-19 01:00:59 -04:00
vector_test.cc CTL: utility.h, use ctl::swap in string (#1227) 2024-06-19 01:00:59 -04:00