mirror of https://github.com/orefkov/simstr.git
Compare commits
12 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
e9eaa6c4cb | |
|
|
00a4a008a9 | |
|
|
86deccbac3 | |
|
|
a779aa7320 | |
|
|
e9e717c8bd | |
|
|
0861d365f5 | |
|
|
91a2f798e3 | |
|
|
c8fb92fee0 | |
|
|
a083ff1b8b | |
|
|
f798e8fbbb | |
|
|
75c9d52f0d | |
|
|
c604e89bdf |
|
|
@ -5,7 +5,7 @@ include(FetchContent)
|
|||
|
||||
project(
|
||||
simstr
|
||||
VERSION 1.7.0
|
||||
VERSION 1.9.1
|
||||
DESCRIPTION "Yet another modern C++ string library"
|
||||
HOMEPAGE_URL "https://github.com/orefkov/simstr"
|
||||
LANGUAGES CXX
|
||||
|
|
@ -29,6 +29,12 @@ option(SIMSTR_BUILD_TESTS "Build tests" ON)
|
|||
option(SIMSTR_BENCHMARKS "Build benchmarks" Off)
|
||||
option(USE_SYSTEM_DEPS "Use system dependencies" Off)
|
||||
cmake_dependent_option(SIMSTR_LINK_NATVIS "Link natvis file" On CAN_LINK_NATVIS Off)
|
||||
cmake_dependent_option(SIMSTR_USE_LIBCXX "Use libc++" Off "NOT CAN_LINK_NATVIS" Off)
|
||||
|
||||
if (SIMSTR_USE_LIBCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
|
||||
endif(SIMSTR_USE_LIBCXX)
|
||||
|
||||
add_library(simstr_simstr
|
||||
src/sstring.cpp
|
||||
|
|
@ -125,6 +131,9 @@ if(SIMSTR_BUILD_TESTS)
|
|||
if(TARGET gtest)
|
||||
target_compile_features(gtest PUBLIC cxx_std_23)
|
||||
target_compile_features(gtest_main PUBLIC cxx_std_23)
|
||||
if (CLANG_COMPILER)
|
||||
target_compile_options(gtest PRIVATE -Wno-error=character-conversion)
|
||||
endif(CLANG_COMPILER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
@ -142,6 +151,10 @@ function(GBencmark)
|
|||
set(BENCHMARK_INSTALL_DOCS OFF)
|
||||
set(BENCHMARK_DOWNLOAD_DEPENDENCIES ON)
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
|
||||
if (SIMSTR_USE_LIBCXX)
|
||||
set(BENCHMARK_USE_LIBCXX On)
|
||||
endif(SIMSTR_USE_LIBCXX)
|
||||
|
||||
add_compile_definitions(BENCHMARK_STATIC_DEFINE)
|
||||
FetchContent_MakeAvailable(googlebench)
|
||||
if(TARGET benchmark)
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@
|
|||
"inherits": "base",
|
||||
"displayName": "Linux base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "gcc-13",
|
||||
"CMAKE_CXX_COMPILER": "g++-13",
|
||||
"CMAKE_C_COMPILER": "gcc",
|
||||
"CMAKE_CXX_COMPILER": "g++",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": true
|
||||
},
|
||||
"condition": {
|
||||
|
|
@ -169,7 +169,7 @@
|
|||
},
|
||||
{
|
||||
"name": "linux-release",
|
||||
"displayName": "Linux Release",
|
||||
"displayName": "Linux Release GCC",
|
||||
"inherits": "linux-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
|
|
@ -181,8 +181,20 @@
|
|||
"inherits": "linux-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_C_COMPILER": "clang-21",
|
||||
"CMAKE_CXX_COMPILER": "clang++-21"
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-release-clang-libcxx",
|
||||
"displayName": "Linux Release Clang libc++",
|
||||
"inherits": "linux-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++",
|
||||
"SIMSTR_USE_LIBCXX": true,
|
||||
"SIMSTR_BENCHMARKS": true
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -6,7 +6,12 @@ cmake_minimum_required (VERSION 3.15)
|
|||
add_executable(benchStr bench_str.cpp bench.h)
|
||||
target_link_libraries(benchStr simstr::simstr benchmark::benchmark)
|
||||
target_compile_features(benchStr PUBLIC cxx_std_23)
|
||||
target_compile_definitions(benchStr PRIVATE SIMSTR_VERSION="${PROJECT_VERSION}")
|
||||
target_compile_definitions(benchStr PRIVATE
|
||||
SIMSTR_VERSION="${PROJECT_VERSION}"
|
||||
CXX_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}"
|
||||
CXX_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}"
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
fmt
|
||||
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Бенчмарки
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
@ -418,6 +418,20 @@ void FmtFormat(benchmark::State& state) {
|
|||
|
||||
}
|
||||
|
||||
void StdFormatSize(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
size_t len = std::formatted_size("abcdefghihklmopqr {:#010o} end", i);
|
||||
std::string str;
|
||||
str.resize_and_overwrite(len, [&](char* p, size_t) {
|
||||
std::format_to_n(str.data(), len, "abcdefghihklmopqr {:#010o} end", i);
|
||||
return len;
|
||||
});
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("---- format/vformat and subst/vsubst octal number to 32 symbols result ----")->Repetitions(1);
|
||||
BENCHMARK(ConcatSimToSimOct) ->Name("\"abcdefghihklmopqr \"_ss + i / 0x8a010_fmt + \" end\"");
|
||||
BENCHMARK(SubstSimToSimOct) ->Name("e_subst(\"abcdefghihklmopqr {} end\", i / 0x8a010_fmt)");
|
||||
|
|
@ -426,6 +440,7 @@ BENCHMARK(FmtFormatComp) ->Name("fmt::format(FMT_COMPILE(\"abcdefghihklmo
|
|||
BENCHMARK(FmtFormat) ->Name("fmt::format(\"abcdefghihklmopqr {:#010o} end\", i)");
|
||||
BENCHMARK(FormatStdToStdOct) ->Name("std::format(\"abcdefghihklmopqr {:#010o} end\", i)");
|
||||
BENCHMARK(VFormatStdToStdOct) ->Name("std::vformat(pattern, std::make_format_args(i))");
|
||||
BENCHMARK(StdFormatSize) ->Name("std::format with std::formatted_size");
|
||||
BENCHMARK(StreamStdToStdOct) ->Name("strm << \"abcdefghihklmopqr 0\" << std::oct << std::setw(9) << std::setfill('0') << i << \" end\"");
|
||||
|
||||
void ConcatStdToStdS(benchmark::State& state) {
|
||||
|
|
@ -957,11 +972,16 @@ void ToDoubleStr(benchmark::State& state, const std::string& s, double c) {
|
|||
}
|
||||
}
|
||||
|
||||
template<typename K = char>
|
||||
void ToDoubleFromChars(benchmark::State& state, const std::string_view& s, double c) {
|
||||
for (auto _: state) {
|
||||
double res = 0;
|
||||
if (std::from_chars(s.data(), s.data() + s.size(), res).ec != std::errc{}) {
|
||||
state.SkipWithError("not equal");
|
||||
if constexpr (requires { std::from_chars(std::declval<K*>(), std::declval<K*>(), std::declval<double&>()); }) {
|
||||
if (std::from_chars((const K*)s.data(), (const K*)s.data() + s.size(), res).ec != std::errc{}) {
|
||||
state.SkipWithError("not equal");
|
||||
}
|
||||
} else {
|
||||
state.SkipWithError("not implemented");
|
||||
}
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
|
|
@ -2650,7 +2670,12 @@ BENCHMARK(UpperCaseSim)->Name("To upper case lstringw<15>");
|
|||
int main(int argc, char** argv) {
|
||||
std::cout << "Benchmarks of simstr, version " SIMSTR_VERSION << "\n"
|
||||
<< "Sources: https://github.com/orefkov/simstr\n"
|
||||
<< "Results: https://orefkov.github.io/simstr/results.html\n" << std::endl;
|
||||
<< "Results: https://orefkov.github.io/simstr/results.html\n"
|
||||
<< "Compiler " << CXX_COMPILER_ID << " " << CXX_COMPILER_VERSION
|
||||
#ifdef _LIBCPP_VERSION
|
||||
<< ", use libc++"
|
||||
#endif
|
||||
<< std::endl;
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
EM_ASM({ console.log(navigator.userAgent); });
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@
|
|||
|
||||
<body>
|
||||
<div class="head">
|
||||
<h3>SimStr 1.7.0 Benchmark</h3>
|
||||
<h3>SimStr 1.8.1 Benchmark</h3>
|
||||
<span><a href="https://orefkov.github.io/simstr/results.html" target="blank">All results</a></span>
|
||||
<span><a href="https://github.com/orefkov/simstr/blob/main/bench/bench_str.cpp" target="blank">Sources for
|
||||
benchmarks</a></span>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ struct result_info {
|
|||
}
|
||||
// Текущее положение поставим сразу за cpuinfo и откинем завершающие переводы строк
|
||||
// We will put the current position immediately after cpuinfo and discard the final line feeds
|
||||
current_text_ = current_text_(cpu_info_.end() - current_text_.begin() + 1).trimmed_right("\n");
|
||||
current_text_ = current_text_.get(cpu_info_.end() - current_text_.begin() + 1, to_end).trimmed_right("\n");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -96,11 +96,11 @@ results_vector get_results_infos() {
|
|||
// В начале имени файла может идти число и дефис, для сортировки, уберём их
|
||||
// At the beginning of the file name there can be a number and a hyphen, for sorting, remove them
|
||||
if (auto delimiter = fileName.find('-'); delimiter + 1 > 1) {
|
||||
if (fileName(0, delimiter).to_int<unsigned, false, 10, false, false>().ec == IntConvertResult::Success) {
|
||||
if (fileName.prefix(delimiter).to_int<unsigned, false, 10, false, false>().ec == IntConvertResult::Success) {
|
||||
fileName.remove_prefix(delimiter + 1);
|
||||
}
|
||||
}
|
||||
results.emplace_back(get_file_content(lstringa<128>{dirForResults + f}), fileName(0, -suffix.length()));
|
||||
results.emplace_back(get_file_content(lstringa<128>{dirForResults + f}), fileName.get(0, from_end(suffix.length())));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
|
@ -117,7 +117,7 @@ void write_platforms_cpu(out_t& out, const results_vector& results) {
|
|||
for (const auto& r : results) {
|
||||
size_t rp = r.cpu_info_.find('(') + 1, lp = r.cpu_info_.find(')', rp);
|
||||
ssa shortCpuInfo = r.cpu_info_.from_to(rp, lp);
|
||||
ssa cpuInfo = r.cpu_info_(lp + 2);
|
||||
ssa cpuInfo = r.cpu_info_.get(lp + 2, to_end);
|
||||
out += e_subst(R"--(
|
||||
<li><span class="platform">{}</span><span class="tooltip">{}<span class="tooltiptext">{}</span></span> Include in charts: <input type="checkbox" id="pl{}" checked onchange="buildCharts()"/></li>)--",
|
||||
r.platform_, shortCpuInfo, cpuInfo, counter++);
|
||||
|
|
@ -167,7 +167,7 @@ ssa extract_name_result(ssa line, ssa& result) {
|
|||
line.len = ns;
|
||||
if (inNs) {
|
||||
size_t end = line.find_last(' ');
|
||||
result = line(end + 1);
|
||||
result = line.get(end + 1, to_end);
|
||||
if (auto rp = line.find("/repeats"); rp != str::npos) {
|
||||
line.len = rp;
|
||||
} else {
|
||||
|
|
@ -182,7 +182,7 @@ ssa extract_name_result(ssa line, ssa& result) {
|
|||
ssa extract_comment(ssa commentsText, ssa benchmarkName) {
|
||||
size_t idx = commentsText.find_end(lstringa<120>{"- " + benchmarkName + "\n"});
|
||||
if (idx != str::npos) {
|
||||
if (commentsText[idx] != '\n' && commentsText(idx, 2) != "- ") {
|
||||
if (commentsText[idx] != '\n' && commentsText.get(idx, 2) != "- ") {
|
||||
return commentsText.from_to(idx, commentsText.find("\n\n", idx));
|
||||
}
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceTex
|
|||
}();
|
||||
|
||||
size_t delim = benchName.find_last('/');
|
||||
if (delim != str::npos && benchName(delim + 1).to_int<unsigned, false, 10, false, false>().ec == IntConvertResult::Success) {
|
||||
if (delim != str::npos && benchName.get(delim + 1, to_end).to_int<unsigned, false, 10, false, false>().ec == IntConvertResult::Success) {
|
||||
benchName.len = delim;
|
||||
}
|
||||
auto [it, not_exist] = textes.try_emplace(benchName, stringa{}, 0);
|
||||
|
|
@ -218,7 +218,7 @@ std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceTex
|
|||
std::cerr << "Can not found benchmark function name for " << benchName << std::endl;
|
||||
return {stra::empty_str, 0};
|
||||
}
|
||||
start = sourceText(0, start).find('(', sourceText.find_last('\n', start - 1));
|
||||
start = sourceText.prefix(start).find('(', sourceText.find_last('\n', start - 1));
|
||||
if (start == str::npos) {
|
||||
std::cerr << "Can not found benchmark function name for " << benchName << std::endl;
|
||||
return {stra::empty_str, 0};
|
||||
|
|
@ -237,7 +237,7 @@ std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceTex
|
|||
}
|
||||
start = sourceText.find_last('\n', start);
|
||||
size_t templ_start = sourceText.find_last('\n', start) + 1;
|
||||
if (sourceText(templ_start).starts_with("template")) {
|
||||
if (sourceText.get(templ_start, to_end).starts_with("template")) {
|
||||
start = templ_start;
|
||||
} else {
|
||||
start++;
|
||||
|
|
@ -261,7 +261,7 @@ std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceTex
|
|||
throw std::runtime_error{"Not found end of func"};
|
||||
}
|
||||
lstringa<2048> text{sourceText.from_to(beginLine, end + indent.length() + 1), indent, "\n"};
|
||||
func_it->second.first = repl_html_symbols(text(1));
|
||||
func_it->second.first = repl_html_symbols(text.get(1, to_end));
|
||||
} else {
|
||||
end = sourceText.find("\n}\n", start);
|
||||
func_it->second.first = repl_html_symbols(sourceText.from_to(start, end + 2));
|
||||
|
|
@ -274,7 +274,7 @@ std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceTex
|
|||
}
|
||||
|
||||
void write_benchmarks(out_t& out, const results_vector& results, ssa sourceText, ssa commentsText) {
|
||||
ssa releaseVersion = sourceText(sourceText.find_end("\n * ver. ")).until("\n").trimmed();
|
||||
ssa releaseVersion = sourceText.get(sourceText.find_end("\n * ver. "), to_end).until("\n").trimmed();
|
||||
if (!releaseVersion) {
|
||||
std::cerr << "Not found release version in sources" << std::endl;
|
||||
throw std::runtime_error{"Not found release version in sources"};
|
||||
|
|
@ -292,7 +292,7 @@ void write_benchmarks(out_t& out, const results_vector& results, ssa sourceText,
|
|||
while(!splitters[0].is_done()) {
|
||||
ssa line = splitters[0].next(), benchName, result;
|
||||
if (auto rm = line.find("_mean"); rm != str::npos) {
|
||||
benchName = extract_name_result(line, result)(0, rm);
|
||||
benchName = extract_name_result(line, result).prefix(rm);
|
||||
auto [source, line_num] = extract_source_for_benchmark(benchName, sourceText);
|
||||
auto comment = extract_comment(commentsText, benchName);
|
||||
// Нужно вывести название бенча и коммент
|
||||
|
|
@ -312,12 +312,12 @@ void write_benchmarks(out_t& out, const results_vector& results, ssa sourceText,
|
|||
throw std::runtime_error{"Not expected end of file"};
|
||||
}
|
||||
line = splitters[idx].next();
|
||||
ssa rbench_name = extract_name_result(line, result)(0, rm);
|
||||
ssa rbench_name = extract_name_result(line, result).prefix(rm);
|
||||
if (rbench_name != benchName) {
|
||||
while (line.find("_mean") == str::npos && !splitters[idx].is_done()) {
|
||||
line = splitters[idx].next();
|
||||
}
|
||||
rbench_name = extract_name_result(line, result)(0, rm);
|
||||
rbench_name = extract_name_result(line, result).prefix(rm);
|
||||
if (rbench_name != benchName) {
|
||||
std::cerr << "In results for " << results[idx].platform_ << " benchmark '" << rbench_name
|
||||
<< "' does not match with other results" << std::endl;
|
||||
|
|
|
|||
1516
bench/results.html
1516
bench/results.html
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,989 @@
|
|||
Benchmarks of simstr, version 1.8.1
|
||||
Sources: https://github.com/orefkov/simstr
|
||||
Results: https://orefkov.github.io/simstr/results.html
|
||||
Compiler Clang 22.0.0, use libc++
|
||||
2026-03-22T13:31:21+03:00
|
||||
Running ./benchStr
|
||||
Run on (32 X 2494.22 MHz CPU s)
|
||||
CPU Caches:
|
||||
L1 Data 32 KiB (x16)
|
||||
L1 Instruction 32 KiB (x16)
|
||||
L2 Unified 256 KiB (x16)
|
||||
L3 Unified 40960 KiB (x1)
|
||||
Load Average: 0.28, 0.77, 0.74
|
||||
***WARNING*** ASLR is enabled, the results may have unreproducible noise in them.
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Concatenate email ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat email std::format_mean 170 ns 170 ns 4
|
||||
Concat email std::format_median 170 ns 170 ns 4
|
||||
Concat email std::format_stddev 3.56 ns 3.56 ns 4
|
||||
Concat email std::format_cv 2.09 % 2.09 % 4
|
||||
Concat email std::stringstream_mean 279 ns 279 ns 4
|
||||
Concat email std::stringstream_median 277 ns 277 ns 4
|
||||
Concat email std::stringstream_stddev 4.82 ns 4.82 ns 4
|
||||
Concat email std::stringstream_cv 1.73 % 1.73 % 4
|
||||
Concat email stringzilla append_mean 141 ns 141 ns 4
|
||||
Concat email stringzilla append_median 141 ns 141 ns 4
|
||||
Concat email stringzilla append_stddev 1.31 ns 1.31 ns 4
|
||||
Concat email stringzilla append_cv 0.93 % 0.93 % 4
|
||||
Concat email stringzilla concat_mean 55.0 ns 55.0 ns 4
|
||||
Concat email stringzilla concat_median 55.5 ns 55.5 ns 4
|
||||
Concat email stringzilla concat_stddev 1.41 ns 1.41 ns 4
|
||||
Concat email stringzilla concat_cv 2.57 % 2.57 % 4
|
||||
Concat email std::string append_mean 91.0 ns 91.0 ns 4
|
||||
Concat email std::string append_median 91.0 ns 91.0 ns 4
|
||||
Concat email std::string append_stddev 0.590 ns 0.591 ns 4
|
||||
Concat email std::string append_cv 0.65 % 0.65 % 4
|
||||
Concat email std::string by strexpr_mean 46.8 ns 46.8 ns 4
|
||||
Concat email std::string by strexpr_median 46.7 ns 46.7 ns 4
|
||||
Concat email std::string by strexpr_stddev 1.12 ns 1.13 ns 4
|
||||
Concat email std::string by strexpr_cv 2.40 % 2.40 % 4
|
||||
Concat email stringa_mean 38.7 ns 38.7 ns 4
|
||||
Concat email stringa_median 38.6 ns 38.6 ns 4
|
||||
Concat email stringa_stddev 0.446 ns 0.446 ns 4
|
||||
Concat email stringa_cv 1.15 % 1.15 % 4
|
||||
----- Concatenate string + Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and number by std to std::string_mean 242 ns 242 ns 4
|
||||
Concat std::string and number by std to std::string_median 242 ns 242 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 4.41 ns 4.41 ns 4
|
||||
Concat std::string and number by std to std::string_cv 1.82 % 1.82 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 102 ns 102 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 102 ns 102 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 2.17 ns 2.17 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 2.13 % 2.13 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 64.3 ns 64.3 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 64.5 ns 64.5 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 0.626 ns 0.626 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 0.97 % 0.97 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 72.1 ns 72.1 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 72.6 ns 72.6 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 1.16 ns 1.16 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 1.61 % 1.61 % 4
|
||||
----- Concatenate string + Hex Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and format hex number and literal to std::string_mean 724 ns 724 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 719 ns 719 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 20.0 ns 20.0 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 2.76 % 2.77 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 783 ns 783 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 784 ns 784 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 20.1 ns 20.1 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 2.56 % 2.56 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 221 ns 221 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 222 ns 222 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 3.44 ns 3.44 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.56 % 1.56 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 150 ns 150 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 151 ns 151 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 2.94 ns 2.94 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 1.96 % 1.96 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 120 ns 120 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 119 ns 119 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 1.85 ns 1.85 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 1.54 % 1.54 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 124 ns 124 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 124 ns 124 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 2.45 ns 2.45 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 1.97 % 1.97 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 187 ns 187 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 186 ns 186 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 4.21 ns 4.21 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 2.25 % 2.25 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 332 ns 332 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 334 ns 334 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 5.45 ns 5.45 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 1.64 % 1.64 % 4
|
||||
---- format/vformat and subst/vsubst octal number to 32 symbols result ----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_mean 278 ns 278 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 277 ns 277 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 3.23 ns 3.23 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 1.16 % 1.16 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 358 ns 358 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 358 ns 358 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 4.17 ns 4.17 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 1.16 % 1.16 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 608 ns 608 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 607 ns 607 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 8.27 ns 8.26 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 1.36 % 1.36 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 697 ns 697 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 695 ns 695 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 8.91 ns 8.91 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 1.28 % 1.28 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 814 ns 814 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 810 ns 810 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 23.1 ns 23.1 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 2.84 % 2.84 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 1268 ns 1268 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 1255 ns 1255 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 30.3 ns 30.3 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 2.39 % 2.39 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 1228 ns 1228 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 1227 ns 1227 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 9.77 ns 9.77 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 0.80 % 0.80 % 4
|
||||
std::format with std::formatted_size_mean 2175 ns 2175 ns 4
|
||||
std::format with std::formatted_size_median 2181 ns 2180 ns 4
|
||||
std::format with std::formatted_size_stddev 13.9 ns 13.9 ns 4
|
||||
std::format with std::formatted_size_cv 0.64 % 0.64 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 2608 ns 2608 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 2609 ns 2609 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 18.4 ns 18.4 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 0.71 % 0.70 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 34.1 ns 34.1 ns 4
|
||||
Concat std::string by std to std::string_median 33.7 ns 33.7 ns 4
|
||||
Concat std::string by std to std::string_stddev 0.874 ns 0.874 ns 4
|
||||
Concat std::string by std to std::string_cv 2.56 % 2.56 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 37.3 ns 37.3 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 37.2 ns 37.2 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 0.340 ns 0.340 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 0.91 % 0.91 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 28.3 ns 28.3 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 28.0 ns 28.0 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 0.716 ns 0.716 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 2.53 % 2.53 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 92.4 ns 92.4 ns 4
|
||||
Find concat three std::string_median 92.1 ns 92.1 ns 4
|
||||
Find concat three std::string_stddev 1.44 ns 1.44 ns 4
|
||||
Find concat three std::string_cv 1.56 % 1.56 % 4
|
||||
Find concat three strexpr_mean 46.5 ns 46.5 ns 4
|
||||
Find concat three strexpr_median 45.9 ns 45.9 ns 4
|
||||
Find concat three strexpr_stddev 1.25 ns 1.25 ns 4
|
||||
Find concat three strexpr_cv 2.68 % 2.68 % 4
|
||||
Find concat three simstr_mean 17.0 ns 17.0 ns 4
|
||||
Find concat three simstr_median 16.9 ns 16.9 ns 4
|
||||
Find concat three simstr_stddev 0.649 ns 0.649 ns 4
|
||||
Find concat three simstr_cv 3.81 % 3.81 % 4
|
||||
Find concat three stringzilla string_mean 176 ns 176 ns 4
|
||||
Find concat three stringzilla string_median 177 ns 177 ns 4
|
||||
Find concat three stringzilla string_stddev 4.56 ns 4.56 ns 4
|
||||
Find concat three stringzilla string_cv 2.59 % 2.59 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 6.45 ns 6.44 ns 4
|
||||
BuildTypeNameStr 0/0_median 6.46 ns 6.46 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.192 ns 0.192 ns 4
|
||||
BuildTypeNameStr 0/0_cv 2.97 % 2.97 % 4
|
||||
BuildTypeNameExp 0/0_mean 6.41 ns 6.41 ns 4
|
||||
BuildTypeNameExp 0/0_median 6.39 ns 6.39 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.052 ns 0.052 ns 4
|
||||
BuildTypeNameExp 0/0_cv 0.81 % 0.81 % 4
|
||||
BuildTypeNameSim 0/0_mean 4.99 ns 4.99 ns 4
|
||||
BuildTypeNameSim 0/0_median 4.98 ns 4.98 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.092 ns 0.092 ns 4
|
||||
BuildTypeNameSim 0/0_cv 1.84 % 1.84 % 4
|
||||
BuildTypeNameStr 10/10_mean 90.0 ns 90.0 ns 4
|
||||
BuildTypeNameStr 10/10_median 89.9 ns 89.9 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 0.738 ns 0.739 ns 4
|
||||
BuildTypeNameStr 10/10_cv 0.82 % 0.82 % 4
|
||||
BuildTypeNameExp 10/10_mean 39.0 ns 39.0 ns 4
|
||||
BuildTypeNameExp 10/10_median 39.2 ns 39.2 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 1.05 ns 1.05 ns 4
|
||||
BuildTypeNameExp 10/10_cv 2.70 % 2.70 % 4
|
||||
BuildTypeNameSim 10/10_mean 23.6 ns 23.6 ns 4
|
||||
BuildTypeNameSim 10/10_median 23.6 ns 23.6 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 0.539 ns 0.539 ns 4
|
||||
BuildTypeNameSim 10/10_cv 2.28 % 2.28 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 243 ns 243 ns 4
|
||||
Concat with replace str_median 243 ns 243 ns 4
|
||||
Concat with replace str_stddev 5.58 ns 5.58 ns 4
|
||||
Concat with replace str_cv 2.29 % 2.29 % 4
|
||||
Concat with replace exp_mean 151 ns 151 ns 4
|
||||
Concat with replace exp_median 151 ns 151 ns 4
|
||||
Concat with replace exp_stddev 1.04 ns 1.03 ns 4
|
||||
Concat with replace exp_cv 0.69 % 0.69 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 0.758 ns 0.758 ns 4
|
||||
std::string e;_median 0.756 ns 0.756 ns 4
|
||||
std::string e;_stddev 0.006 ns 0.006 ns 4
|
||||
std::string e;_cv 0.74 % 0.74 % 4
|
||||
std::string_view e;_mean 0.380 ns 0.380 ns 4
|
||||
std::string_view e;_median 0.380 ns 0.380 ns 4
|
||||
std::string_view e;_stddev 0.002 ns 0.002 ns 4
|
||||
std::string_view e;_cv 0.49 % 0.49 % 4
|
||||
ssa e;_mean 0.375 ns 0.375 ns 4
|
||||
ssa e;_median 0.375 ns 0.375 ns 4
|
||||
ssa e;_stddev 0.006 ns 0.006 ns 4
|
||||
ssa e;_cv 1.57 % 1.57 % 4
|
||||
stringa e;_mean 0.754 ns 0.754 ns 4
|
||||
stringa e;_median 0.754 ns 0.754 ns 4
|
||||
stringa e;_stddev 0.005 ns 0.005 ns 4
|
||||
stringa e;_cv 0.66 % 0.66 % 4
|
||||
lstringa<20> e;_mean 1.13 ns 1.13 ns 4
|
||||
lstringa<20> e;_median 1.12 ns 1.12 ns 4
|
||||
lstringa<20> e;_stddev 0.026 ns 0.026 ns 4
|
||||
lstringa<20> e;_cv 2.28 % 2.28 % 4
|
||||
lstringa<40> e;_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<40> e;_median 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e;_stddev 0.027 ns 0.027 ns 4
|
||||
lstringa<40> e;_cv 2.39 % 2.39 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 1.51 ns 1.51 ns 4
|
||||
std::string e = "Test text";_median 1.51 ns 1.51 ns 4
|
||||
std::string e = "Test text";_stddev 0.020 ns 0.020 ns 4
|
||||
std::string e = "Test text";_cv 1.30 % 1.30 % 4
|
||||
std::string_view e = "Test text";_mean 0.767 ns 0.767 ns 4
|
||||
std::string_view e = "Test text";_median 0.765 ns 0.765 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.010 ns 0.010 ns 4
|
||||
std::string_view e = "Test text";_cv 1.33 % 1.33 % 4
|
||||
ssa e = "Test text";_mean 0.381 ns 0.381 ns 4
|
||||
ssa e = "Test text";_median 0.382 ns 0.382 ns 4
|
||||
ssa e = "Test text";_stddev 0.006 ns 0.006 ns 4
|
||||
ssa e = "Test text";_cv 1.64 % 1.64 % 4
|
||||
stringa e = "Test text";_mean 1.13 ns 1.13 ns 4
|
||||
stringa e = "Test text";_median 1.13 ns 1.13 ns 4
|
||||
stringa e = "Test text";_stddev 0.014 ns 0.014 ns 4
|
||||
stringa e = "Test text";_cv 1.24 % 1.24 % 4
|
||||
lstringa<20> e = "Test text";_mean 1.89 ns 1.89 ns 4
|
||||
lstringa<20> e = "Test text";_median 1.89 ns 1.89 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.038 ns 0.038 ns 4
|
||||
lstringa<20> e = "Test text";_cv 2.03 % 2.03 % 4
|
||||
lstringa<40> e = "Test text";_mean 1.86 ns 1.86 ns 4
|
||||
lstringa<40> e = "Test text";_median 1.86 ns 1.86 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.017 ns 0.017 ns 4
|
||||
lstringa<40> e = "Test text";_cv 0.92 % 0.92 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 19.3 ns 19.3 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 19.3 ns 19.2 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.214 ns 0.214 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 1.11 % 1.11 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.745 ns 0.745 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.745 ns 0.745 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.016 ns 0.016 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 2.09 % 2.09 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 0.374 ns 0.374 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 0.373 ns 0.373 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.004 ns 0.004 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 1.01 % 1.01 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 1.12 ns 1.12 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 1.12 ns 1.12 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.017 ns 0.017 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 1.53 % 1.53 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 18.9 ns 18.9 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 18.9 ns 18.9 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.143 ns 0.143 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 0.75 % 0.75 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 1.89 ns 1.89 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 1.89 ns 1.89 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.023 ns 0.023 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.21 % 1.22 % 4
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 1.18 ns 1.18 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 1.18 ns 1.18 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.010 ns 0.010 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 0.82 % 0.82 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.377 ns 0.377 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.375 ns 0.375 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.004 ns 0.004 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 1.03 % 1.03 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 0.378 ns 0.378 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 0.378 ns 0.378 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.003 ns 0.003 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 0.80 % 0.80 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 1.13 ns 1.13 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 1.13 ns 1.13 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.020 ns 0.020 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 1.76 % 1.76 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 1.12 ns 1.12 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 1.12 ns 1.12 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.012 ns 0.012 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.04 % 1.04 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 1.85 ns 1.85 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 1.85 ns 1.85 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.023 ns 0.023 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.27 % 1.27 % 4
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 24.9 ns 24.9 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 24.8 ns 24.8 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.277 ns 0.277 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 1.11 % 1.11 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.757 ns 0.757 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.754 ns 0.754 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.013 ns 0.013 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.67 % 1.67 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.381 ns 0.381 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.382 ns 0.382 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.004 ns 0.004 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.01 % 1.01 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 1.14 ns 1.14 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 1.14 ns 1.14 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.019 ns 0.019 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.66 % 1.66 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 18.0 ns 18.0 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 18.1 ns 18.1 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.454 ns 0.454 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 2.52 % 2.52 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 5.53 ns 5.53 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 5.52 ns 5.52 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.080 ns 0.080 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 1.45 % 1.45 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 96.5 ns 96.5 ns 4
|
||||
sz::string::find;_median 96.3 ns 96.3 ns 4
|
||||
sz::string::find;_stddev 1.47 ns 1.47 ns 4
|
||||
sz::string::find;_cv 1.53 % 1.53 % 4
|
||||
std::string::find;_mean 7.76 ns 7.76 ns 4
|
||||
std::string::find;_median 7.84 ns 7.84 ns 4
|
||||
std::string::find;_stddev 0.180 ns 0.180 ns 4
|
||||
std::string::find;_cv 2.31 % 2.31 % 4
|
||||
std::string_view::find;_mean 7.82 ns 7.82 ns 4
|
||||
std::string_view::find;_median 7.85 ns 7.84 ns 4
|
||||
std::string_view::find;_stddev 0.082 ns 0.082 ns 4
|
||||
std::string_view::find;_cv 1.05 % 1.05 % 4
|
||||
ssa::find;_mean 7.82 ns 7.82 ns 4
|
||||
ssa::find;_median 7.81 ns 7.81 ns 4
|
||||
ssa::find;_stddev 0.113 ns 0.113 ns 4
|
||||
ssa::find;_cv 1.44 % 1.45 % 4
|
||||
stringa::find;_mean 8.60 ns 8.60 ns 4
|
||||
stringa::find;_median 8.59 ns 8.59 ns 4
|
||||
stringa::find;_stddev 0.045 ns 0.045 ns 4
|
||||
stringa::find;_cv 0.52 % 0.52 % 4
|
||||
lstringa<20>::find;_mean 6.98 ns 6.98 ns 4
|
||||
lstringa<20>::find;_median 6.95 ns 6.95 ns 4
|
||||
lstringa<20>::find;_stddev 0.090 ns 0.090 ns 4
|
||||
lstringa<20>::find;_cv 1.29 % 1.29 % 4
|
||||
lstringa<40>::find;_mean 7.01 ns 7.01 ns 4
|
||||
lstringa<40>::find;_median 7.02 ns 7.02 ns 4
|
||||
lstringa<40>::find;_stddev 0.253 ns 0.253 ns 4
|
||||
lstringa<40>::find;_cv 3.61 % 3.61 % 4
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string copy{str_with_len_N};/15_mean 1.18 ns 1.18 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 1.17 ns 1.17 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 0.043 ns 0.043 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 3.65 % 3.65 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 1.16 ns 1.16 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 1.16 ns 1.16 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 0.028 ns 0.028 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 2.42 % 2.42 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 25.8 ns 25.8 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 25.6 ns 25.6 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 0.708 ns 0.707 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 2.75 % 2.75 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 24.8 ns 24.8 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 24.9 ns 24.9 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 0.390 ns 0.390 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 1.57 % 1.57 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 24.7 ns 24.7 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 24.9 ns 24.9 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 0.466 ns 0.466 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 1.88 % 1.89 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 26.2 ns 26.2 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 26.2 ns 26.2 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 0.221 ns 0.221 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 0.84 % 0.84 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 26.8 ns 26.8 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 26.8 ns 26.8 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 0.300 ns 0.300 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 1.12 % 1.12 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 27.5 ns 27.5 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 27.5 ns 27.5 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 0.234 ns 0.234 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 0.85 % 0.85 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 31.6 ns 31.6 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 31.6 ns 31.6 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 0.751 ns 0.751 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 2.38 % 2.38 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 38.4 ns 38.4 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 38.4 ns 38.4 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 1.03 ns 1.03 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 2.67 % 2.67 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 86.0 ns 86.0 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 87.3 ns 87.3 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 4.29 ns 4.29 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 4.99 % 4.99 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 117 ns 117 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 118 ns 118 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 3.68 ns 3.68 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 3.14 % 3.14 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 1.13 ns 1.13 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 1.13 ns 1.13 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.037 ns 0.037 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 3.27 % 3.27 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 1.13 ns 1.13 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 1.14 ns 1.14 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.014 ns 0.014 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.22 % 1.22 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 1.13 ns 1.13 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 1.13 ns 1.13 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.006 ns 0.006 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 0.58 % 0.58 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.167 ns 0.167 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 1.01 % 1.01 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.075 ns 0.075 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 0.46 % 0.46 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/64_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.129 ns 0.129 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 0.78 % 0.78 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.176 ns 0.176 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 1.06 % 1.06 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 16.6 ns 16.6 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 16.6 ns 16.6 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.081 ns 0.081 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.49 % 0.49 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 16.6 ns 16.6 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 16.6 ns 16.6 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.117 ns 0.117 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 0.71 % 0.71 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.232 ns 0.232 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 1.41 % 1.41 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.122 ns 0.122 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.74 % 0.74 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 16.7 ns 16.7 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 16.7 ns 16.7 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.175 ns 0.175 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 1.05 % 1.05 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 1.12 ns 1.12 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 1.12 ns 1.12 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.018 ns 0.018 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.63 % 1.63 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 5.35 ns 5.35 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 5.32 ns 5.32 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.139 ns 0.139 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 2.60 % 2.60 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 5.31 ns 5.31 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 5.33 ns 5.33 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.075 ns 0.075 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.42 % 1.42 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 21.8 ns 21.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 21.9 ns 21.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 0.457 ns 0.457 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.10 % 2.10 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 21.9 ns 21.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 21.8 ns 21.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.650 ns 0.650 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 2.97 % 2.97 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 23.1 ns 23.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 22.9 ns 22.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.476 ns 0.476 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 2.06 % 2.06 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 25.7 ns 25.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 25.8 ns 25.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.666 ns 0.666 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 2.59 % 2.59 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 24.8 ns 24.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 24.7 ns 24.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 0.339 ns 0.339 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 1.37 % 1.37 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 27.7 ns 27.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 27.7 ns 27.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 0.248 ns 0.248 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 0.90 % 0.90 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 78.4 ns 78.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 87.3 ns 87.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 19.5 ns 19.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 24.87 % 24.87 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 73.4 ns 73.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 76.1 ns 76.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 6.12 ns 6.12 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 8.34 % 8.34 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 88.6 ns 88.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 88.9 ns 88.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 0.993 ns 0.993 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 1.12 % 1.12 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 1.13 ns 1.13 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 1.14 ns 1.14 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.008 ns 0.008 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 0.74 % 0.74 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 4.98 ns 4.98 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 4.96 ns 4.96 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.149 ns 0.149 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 3.00 % 3.00 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 5.01 ns 5.01 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 5.02 ns 5.02 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.121 ns 0.120 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 2.41 % 2.40 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 4.59 ns 4.59 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 4.59 ns 4.59 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.088 ns 0.088 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.92 % 1.92 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 4.64 ns 4.64 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 4.64 ns 4.64 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.075 ns 0.075 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.61 % 1.61 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 6.06 ns 6.06 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 6.10 ns 6.10 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.122 ns 0.122 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 2.01 % 2.01 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 6.63 ns 6.63 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 6.60 ns 6.60 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.128 ns 0.128 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 1.93 % 1.93 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 17.3 ns 17.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 17.3 ns 17.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.252 ns 0.252 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.45 % 1.45 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 10.6 ns 10.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 10.6 ns 10.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.094 ns 0.094 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 0.88 % 0.88 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 52.1 ns 52.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 52.0 ns 52.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 1.85 ns 1.85 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 3.55 % 3.55 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 73.6 ns 73.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 76.5 ns 76.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 8.36 ns 8.36 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 11.35 % 11.35 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 90.1 ns 90.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 90.3 ns 90.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 0.860 ns 0.860 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 0.95 % 0.95 % 4
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 27.4 ns 27.4 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 27.5 ns 27.5 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.390 ns 0.390 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.42 % 1.42 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 17.5 ns 17.5 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 17.6 ns 17.6 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.354 ns 0.354 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 2.02 % 2.02 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.48 ns 9.48 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.50 ns 9.50 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.135 ns 0.135 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.42 % 1.42 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.76 ns 9.76 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.80 ns 9.80 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.135 ns 0.135 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.38 % 1.38 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.51 ns 9.51 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.53 ns 9.53 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.042 ns 0.042 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.44 % 0.44 % 4
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 24.4 ns 24.4 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 24.3 ns 24.3 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.490 ns 0.490 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 2.01 % 2.01 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 22.0 ns 22.0 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 22.2 ns 22.2 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.697 ns 0.697 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 3.17 % 3.17 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 8.28 ns 8.28 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 8.15 ns 8.15 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.363 ns 0.363 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 4.38 % 4.38 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.65 ns 7.65 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.63 ns 7.63 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.109 ns 0.109 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.43 % 1.43 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.84 ns 7.84 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.87 ns 7.87 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.130 ns 0.130 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.66 % 1.66 % 4
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 29.4 ns 29.4 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 29.3 ns 29.3 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.371 ns 0.371 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 1.26 % 1.26 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 11.4 ns 11.4 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 11.4 ns 11.4 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.079 ns 0.079 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.70 % 0.70 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 13.2 ns 13.2 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 13.2 ns 13.2 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.292 ns 0.292 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 2.21 % 2.21 % 4
|
||||
----- Convert to double '1234.567e10' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_mean 65.8 ns 65.8 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 65.6 ns 65.6 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 0.998 ns 0.998 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 1.52 % 1.52 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res); ERROR OCCURRED: 'not implemented'
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 34.8 ns 34.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 34.7 ns 34.7 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.864 ns 0.864 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 2.48 % 2.48 % 4
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 2080 ns 2080 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 2077 ns 2077 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 35.9 ns 35.9 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 1.72 % 1.72 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 416 ns 416 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 416 ns 416 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 18.5 ns 18.5 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 4.45 % 4.45 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 362 ns 362 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 362 ns 362 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 3.73 ns 3.73 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 1.03 % 1.03 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 245 ns 245 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 248 ns 248 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 19.5 ns 19.5 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 7.96 % 7.96 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 217 ns 217 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 222 ns 222 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 16.2 ns 16.2 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 7.49 % 7.49 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 136 ns 136 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 136 ns 136 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 1.48 ns 1.48 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.09 % 1.08 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 2037 ns 2037 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 2042 ns 2042 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 54.5 ns 54.5 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 2.68 % 2.67 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 1253 ns 1253 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 1255 ns 1255 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 17.7 ns 17.7 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.41 % 1.41 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 401 ns 401 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 406 ns 406 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 23.1 ns 23.1 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 5.75 % 5.75 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 335 ns 335 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 346 ns 346 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 24.4 ns 24.4 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 7.29 % 7.29 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 291 ns 291 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 297 ns 297 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 18.8 ns 18.8 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 6.47 % 6.47 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 214 ns 214 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 214 ns 214 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 1.16 ns 1.16 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 0.54 % 0.54 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 159733 ns 159734 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 158296 ns 158296 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 6342 ns 6342 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 3.97 % 3.97 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 104710 ns 104710 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 104630 ns 104630 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1116 ns 1116 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.07 % 1.07 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 49815 ns 49815 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 49890 ns 49891 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 327 ns 327 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 0.66 % 0.66 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 27270 ns 27270 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 27160 ns 27160 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 903 ns 903 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.31 % 3.31 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16860 ns 16860 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16838 ns 16838 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 204 ns 204 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.21 % 1.21 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16899 ns 16899 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16878 ns 16878 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 88.6 ns 88.6 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 0.52 % 0.52 % 4
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 2073 ns 2073 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 2050 ns 2050 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 66.2 ns 66.2 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 3.19 % 3.19 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 1492 ns 1492 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 1494 ns 1494 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 29.6 ns 29.6 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.98 % 1.98 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 476 ns 476 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 480 ns 480 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 20.4 ns 20.4 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 4.29 % 4.29 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 448 ns 448 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 460 ns 460 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 27.7 ns 27.7 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 6.18 % 6.18 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 379 ns 379 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 385 ns 385 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 13.8 ns 13.8 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 3.63 % 3.63 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 298 ns 298 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 296 ns 296 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 4.34 ns 4.34 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 1.46 % 1.46 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 3419 ns 3419 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 3420 ns 3420 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 78.3 ns 78.3 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 2.29 % 2.29 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 474 ns 474 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 477 ns 477 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 9.20 ns 9.20 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.94 % 1.94 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 1229 ns 1229 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 1226 ns 1226 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 15.9 ns 15.9 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.29 % 1.29 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 959 ns 959 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 955 ns 955 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 9.35 ns 9.35 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 0.97 % 0.97 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 2002 ns 2002 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 2000 ns 2000 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 27.3 ns 27.3 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 1.37 % 1.37 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1745 ns 1745 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1743 ns 1743 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 33.1 ns 33.1 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 1.90 % 1.90 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 263 ns 263 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 264 ns 264 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 5.32 ns 5.32 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 2.02 % 2.02 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 119 ns 119 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 119 ns 119 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 1.45 ns 1.45 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 1.22 % 1.22 % 4
|
||||
stringa str = "test = " + k + " times";_mean 118 ns 118 ns 4
|
||||
stringa str = "test = " + k + " times";_median 118 ns 118 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 0.943 ns 0.943 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 0.80 % 0.80 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 277 ns 277 ns 4
|
||||
std::string::find + substr + std::strtol_median 276 ns 276 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 2.54 ns 2.54 ns 4
|
||||
std::string::find + substr + std::strtol_cv 0.92 % 0.92 % 4
|
||||
ssa::splitter + ssa::as_int_mean 159 ns 159 ns 4
|
||||
ssa::splitter + ssa::as_int_median 159 ns 159 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 3.14 ns 3.14 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 1.97 % 1.97 % 4
|
||||
ssa::splitf + functor_mean 213 ns 213 ns 4
|
||||
ssa::splitf + functor_median 212 ns 212 ns 4
|
||||
ssa::splitf + functor_stddev 8.20 ns 8.20 ns 4
|
||||
ssa::splitf + functor_cv 3.84 % 3.84 % 4
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 916 ns 916 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 909 ns 909 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 27.2 ns 27.2 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 2.97 % 2.97 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 2428 ns 2428 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 2432 ns 2432 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 22.9 ns 22.9 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 0.94 % 0.94 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 1026 ns 1026 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 1018 ns 1018 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 22.2 ns 22.2 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 2.16 % 2.16 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1408 ns 1408 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1410 ns 1410 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 14.7 ns 14.7 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 1.04 % 1.04 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1083 ns 1083 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1076 ns 1076 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 17.0 ns 17.0 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 1.57 % 1.57 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1128 ns 1128 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 1130 ns 1130 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 7.02 ns 7.02 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 0.62 % 0.62 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 820 ns 820 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 812 ns 812 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 23.0 ns 23.0 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 2.81 % 2.81 % 4
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 177 ns 177 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 177 ns 177 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 0.976 ns 0.976 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 0.55 % 0.55 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 324 ns 324 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 325 ns 325 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 4.96 ns 4.96 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.53 % 1.53 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 141 ns 141 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 139 ns 139 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 4.79 ns 4.79 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 3.41 % 3.41 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 198 ns 198 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 197 ns 197 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 6.51 ns 6.51 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 3.29 % 3.29 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 186 ns 186 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 186 ns 186 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 2.39 ns 2.39 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 1.28 % 1.28 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 126 ns 126 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 126 ns 126 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 1.64 ns 1.64 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 1.30 % 1.30 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 136 ns 136 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 136 ns 136 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 2.88 ns 2.88 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 2.12 % 2.12 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 180 ns 180 ns 4
|
||||
replace bb to ---- in std::string|64_median 181 ns 181 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 5.27 ns 5.27 ns 4
|
||||
replace bb to ---- in std::string|64_cv 2.93 % 2.93 % 4
|
||||
replace bb to ---- in std::string|256_mean 842 ns 842 ns 4
|
||||
replace bb to ---- in std::string|256_median 844 ns 844 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 12.7 ns 12.7 ns 4
|
||||
replace bb to ---- in std::string|256_cv 1.50 % 1.50 % 4
|
||||
replace bb to ---- in std::string|512_mean 1259 ns 1259 ns 4
|
||||
replace bb to ---- in std::string|512_median 1269 ns 1269 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 30.9 ns 30.9 ns 4
|
||||
replace bb to ---- in std::string|512_cv 2.45 % 2.45 % 4
|
||||
replace bb to ---- in std::string|1024_mean 2422 ns 2422 ns 4
|
||||
replace bb to ---- in std::string|1024_median 2423 ns 2423 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 19.3 ns 19.3 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 0.80 % 0.80 % 4
|
||||
replace bb to ---- in std::string|2048_mean 6347 ns 6347 ns 4
|
||||
replace bb to ---- in std::string|2048_median 6403 ns 6403 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 221 ns 221 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 3.48 % 3.48 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 129 ns 129 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 129 ns 129 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 3.09 ns 3.09 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.39 % 2.39 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 444 ns 444 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 444 ns 444 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 12.1 ns 12.1 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 2.73 % 2.73 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 828 ns 828 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 825 ns 825 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 23.9 ns 23.9 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.89 % 2.89 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1614 ns 1614 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 1611 ns 1611 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 19.6 ns 19.6 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.21 % 1.21 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3127 ns 3127 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 3109 ns 3109 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 54.0 ns 54.0 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 1.73 % 1.73 % 4
|
||||
replace bb to ---- by init stringa|64_mean 90.9 ns 90.9 ns 4
|
||||
replace bb to ---- by init stringa|64_median 91.5 ns 91.5 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 2.07 ns 2.07 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 2.28 % 2.28 % 4
|
||||
replace bb to ---- by init stringa|256_mean 308 ns 308 ns 4
|
||||
replace bb to ---- by init stringa|256_median 309 ns 309 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 3.01 ns 3.01 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 0.98 % 0.98 % 4
|
||||
replace bb to ---- by init stringa|512_mean 709 ns 709 ns 4
|
||||
replace bb to ---- by init stringa|512_median 709 ns 709 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 3.56 ns 3.56 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 0.50 % 0.50 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 1392 ns 1392 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 1391 ns 1391 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 5.76 ns 5.76 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 0.41 % 0.41 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 2810 ns 2810 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 2815 ns 2815 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 36.4 ns 36.4 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 1.29 % 1.29 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 130 ns 130 ns 4
|
||||
replace bb to -- in std::string|64_median 129 ns 129 ns 4
|
||||
replace bb to -- in std::string|64_stddev 2.30 ns 2.30 ns 4
|
||||
replace bb to -- in std::string|64_cv 1.77 % 1.77 % 4
|
||||
replace bb to -- in std::string|256_mean 427 ns 427 ns 4
|
||||
replace bb to -- in std::string|256_median 429 ns 429 ns 4
|
||||
replace bb to -- in std::string|256_stddev 6.83 ns 6.83 ns 4
|
||||
replace bb to -- in std::string|256_cv 1.60 % 1.60 % 4
|
||||
replace bb to -- in std::string|512_mean 851 ns 851 ns 4
|
||||
replace bb to -- in std::string|512_median 849 ns 849 ns 4
|
||||
replace bb to -- in std::string|512_stddev 11.5 ns 11.5 ns 4
|
||||
replace bb to -- in std::string|512_cv 1.35 % 1.35 % 4
|
||||
replace bb to -- in std::string|1024_mean 1603 ns 1603 ns 4
|
||||
replace bb to -- in std::string|1024_median 1613 ns 1613 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 35.0 ns 35.0 ns 4
|
||||
replace bb to -- in std::string|1024_cv 2.18 % 2.18 % 4
|
||||
replace bb to -- in std::string|2048_mean 3230 ns 3230 ns 4
|
||||
replace bb to -- in std::string|2048_median 3217 ns 3217 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 41.6 ns 41.6 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.29 % 1.29 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 90.8 ns 90.8 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 91.5 ns 91.5 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 1.56 ns 1.56 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 1.72 % 1.72 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 294 ns 294 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 294 ns 294 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 5.26 ns 5.26 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 1.79 % 1.79 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 551 ns 551 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 555 ns 555 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 9.79 ns 9.78 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 1.78 % 1.78 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 1066 ns 1066 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 1071 ns 1071 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 18.1 ns 18.1 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 1.70 % 1.70 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 2242 ns 2242 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 2197 ns 2197 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 132 ns 132 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 5.90 % 5.90 % 4
|
||||
replace bb to -- by init stringa|64_mean 83.0 ns 83.0 ns 4
|
||||
replace bb to -- by init stringa|64_median 81.6 ns 81.6 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 4.12 ns 4.12 ns 4
|
||||
replace bb to -- by init stringa|64_cv 4.96 % 4.96 % 4
|
||||
replace bb to -- by init stringa|256_mean 237 ns 237 ns 4
|
||||
replace bb to -- by init stringa|256_median 236 ns 236 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 4.04 ns 4.04 ns 4
|
||||
replace bb to -- by init stringa|256_cv 1.70 % 1.70 % 4
|
||||
replace bb to -- by init stringa|512_mean 435 ns 435 ns 4
|
||||
replace bb to -- by init stringa|512_median 435 ns 435 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 5.95 ns 5.95 ns 4
|
||||
replace bb to -- by init stringa|512_cv 1.37 % 1.37 % 4
|
||||
replace bb to -- by init stringa|1024_mean 851 ns 851 ns 4
|
||||
replace bb to -- by init stringa|1024_median 846 ns 846 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 18.7 ns 18.7 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 2.20 % 2.20 % 4
|
||||
replace bb to -- by init stringa|2048_mean 1658 ns 1658 ns 4
|
||||
replace bb to -- by init stringa|2048_median 1652 ns 1652 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 28.9 ns 28.9 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 1.74 % 1.74 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3780026 ns 3780035 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3764708 ns 3764717 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 108428 ns 108427 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 2.87 % 2.87 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3706958 ns 3706967 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3712805 ns 3712816 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 32417 ns 32419 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 0.87 % 0.87 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3815600 ns 3815610 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3818146 ns 3818155 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 36526 ns 36523 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 0.96 % 0.96 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4134155 ns 4134170 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4133427 ns 4133445 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 54010 ns 54012 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 1.31 % 1.31 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 1021 ns 1021 ns 4
|
||||
Build func full name std::string;_median 1018 ns 1018 ns 4
|
||||
Build func full name std::string;_stddev 20.5 ns 20.5 ns 4
|
||||
Build func full name std::string;_cv 2.01 % 2.01 % 4
|
||||
Build func full name std::string 1;_mean 1021 ns 1021 ns 4
|
||||
Build func full name std::string 1;_median 1019 ns 1019 ns 4
|
||||
Build func full name std::string 1;_stddev 26.5 ns 26.5 ns 4
|
||||
Build func full name std::string 1;_cv 2.60 % 2.60 % 4
|
||||
Build func full name std::stream;_mean 2984 ns 2984 ns 4
|
||||
Build func full name std::stream;_median 2987 ns 2987 ns 4
|
||||
Build func full name std::stream;_stddev 37.7 ns 37.7 ns 4
|
||||
Build func full name std::stream;_cv 1.26 % 1.26 % 4
|
||||
Build func full name stringa;_mean 471 ns 471 ns 4
|
||||
Build func full name stringa;_median 470 ns 470 ns 4
|
||||
Build func full name stringa;_stddev 4.83 ns 4.83 ns 4
|
||||
Build func full name stringa;_cv 1.02 % 1.02 % 4
|
||||
Build func full name stringa 1;_mean 648 ns 648 ns 4
|
||||
Build func full name stringa 1;_median 651 ns 651 ns 4
|
||||
Build func full name stringa 1;_stddev 9.87 ns 9.87 ns 4
|
||||
Build func full name stringa 1;_cv 1.52 % 1.52 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 175 ns 175 ns 4
|
||||
To upper case std::wstring_median 177 ns 177 ns 4
|
||||
To upper case std::wstring_stddev 3.99 ns 3.99 ns 4
|
||||
To upper case std::wstring_cv 2.28 % 2.28 % 4
|
||||
To upper case lstringw<15>_mean 38.5 ns 38.5 ns 4
|
||||
To upper case lstringw<15>_median 38.5 ns 38.5 ns 4
|
||||
To upper case lstringw<15>_stddev 1.33 ns 1.33 ns 4
|
||||
To upper case lstringw<15>_cv 3.44 % 3.44 % 4
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,977 +0,0 @@
|
|||
Benchmarks of simstr, version 1.7.0
|
||||
Sources: https://github.com/orefkov/simstr
|
||||
Results: https://orefkov.github.io/simstr/results.html
|
||||
Run on (32 X 2513.96 MHz CPU s)
|
||||
Chrome/143.0.0.0 webasm
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Concatenate email ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat email std::format_mean 993 ns 993 ns 4
|
||||
Concat email std::format_median 989 ns 989 ns 4
|
||||
Concat email std::format_stddev 20.8 ns 20.8 ns 4
|
||||
Concat email std::format_cv 2.10 % 2.10 % 4
|
||||
Concat email std::stringstream_mean 2513 ns 2514 ns 4
|
||||
Concat email std::stringstream_median 2493 ns 2493 ns 4
|
||||
Concat email std::stringstream_stddev 118 ns 118 ns 4
|
||||
Concat email std::stringstream_cv 4.68 % 4.68 % 4
|
||||
Concat email stringzilla append_mean 574 ns 574 ns 4
|
||||
Concat email stringzilla append_median 568 ns 568 ns 4
|
||||
Concat email stringzilla append_stddev 19.0 ns 19.0 ns 4
|
||||
Concat email stringzilla append_cv 3.31 % 3.31 % 4
|
||||
Concat email stringzilla concat_mean 222 ns 222 ns 4
|
||||
Concat email stringzilla concat_median 223 ns 223 ns 4
|
||||
Concat email stringzilla concat_stddev 5.74 ns 5.74 ns 4
|
||||
Concat email stringzilla concat_cv 2.59 % 2.59 % 4
|
||||
Concat email std::string append_mean 636 ns 636 ns 4
|
||||
Concat email std::string append_median 621 ns 621 ns 4
|
||||
Concat email std::string append_stddev 53.8 ns 53.8 ns 4
|
||||
Concat email std::string append_cv 8.46 % 8.46 % 4
|
||||
Concat email std::string by strexpr_mean 159 ns 159 ns 4
|
||||
Concat email std::string by strexpr_median 160 ns 160 ns 4
|
||||
Concat email std::string by strexpr_stddev 6.61 ns 6.61 ns 4
|
||||
Concat email std::string by strexpr_cv 4.16 % 4.16 % 4
|
||||
Concat email stringa_mean 133 ns 133 ns 4
|
||||
Concat email stringa_median 132 ns 132 ns 4
|
||||
Concat email stringa_stddev 3.45 ns 3.45 ns 4
|
||||
Concat email stringa_cv 2.59 % 2.59 % 4
|
||||
----- Concatenate string + Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and number by std to std::string_mean 1951 ns 1951 ns 4
|
||||
Concat std::string and number by std to std::string_median 1964 ns 1964 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 85.3 ns 85.3 ns 4
|
||||
Concat std::string and number by std to std::string_cv 4.37 % 4.37 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 974 ns 974 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 984 ns 984 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 63.0 ns 63.0 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 6.47 % 6.47 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 369 ns 369 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 364 ns 364 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 22.2 ns 22.2 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 6.01 % 6.01 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 367 ns 367 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 362 ns 362 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 20.0 ns 20.0 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 5.44 % 5.44 % 4
|
||||
----- Concatenate string + Hex Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and format hex number and literal to std::string_mean 3765 ns 3765 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 3768 ns 3768 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 44.4 ns 44.4 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 1.18 % 1.18 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 4994 ns 4994 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 4970 ns 4970 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 116 ns 116 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 2.33 % 2.33 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 1114 ns 1114 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 1115 ns 1115 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 11.3 ns 11.3 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.01 % 1.01 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 885 ns 885 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 887 ns 887 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 31.7 ns 31.7 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 3.58 % 3.58 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 252 ns 252 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 255 ns 255 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 11.8 ns 11.7 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 4.66 % 4.65 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 276 ns 276 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 279 ns 279 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 8.70 ns 8.70 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 3.15 % 3.15 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 548 ns 548 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 546 ns 546 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 26.7 ns 26.7 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 4.87 % 4.87 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 1724 ns 1724 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 1714 ns 1714 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 31.0 ns 31.0 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 1.80 % 1.80 % 4
|
||||
---- format/vformat and subst/vsubst octal number to 32 symbols result ----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_mean 930 ns 930 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 929 ns 929 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 31.7 ns 31.7 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 3.40 % 3.41 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 1123 ns 1123 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 1111 ns 1111 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 44.9 ns 44.9 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 4.00 % 4.00 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 2923 ns 2923 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 2898 ns 2898 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 70.8 ns 70.8 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 2.42 % 2.42 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 4411 ns 4411 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 4300 ns 4300 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 238 ns 238 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 5.39 % 5.39 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 4578 ns 4578 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 4515 ns 4515 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 169 ns 169 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 3.70 % 3.70 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 5729 ns 5729 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 5737 ns 5737 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 105 ns 105 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.83 % 1.83 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 5777 ns 5777 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 5823 ns 5823 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 285 ns 285 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 4.93 % 4.93 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 18843 ns 18843 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 18764 ns 18764 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 1075 ns 1075 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 5.70 % 5.70 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 155 ns 155 ns 4
|
||||
Concat std::string by std to std::string_median 156 ns 156 ns 4
|
||||
Concat std::string by std to std::string_stddev 4.25 ns 4.26 ns 4
|
||||
Concat std::string by std to std::string_cv 2.74 % 2.74 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 175 ns 175 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 177 ns 177 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 11.8 ns 11.8 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 6.71 % 6.71 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 146 ns 146 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 146 ns 146 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 3.70 ns 3.70 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 2.53 % 2.53 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 501 ns 501 ns 4
|
||||
Find concat three std::string_median 500 ns 500 ns 4
|
||||
Find concat three std::string_stddev 4.58 ns 4.58 ns 4
|
||||
Find concat three std::string_cv 0.91 % 0.91 % 4
|
||||
Find concat three strexpr_mean 288 ns 288 ns 4
|
||||
Find concat three strexpr_median 287 ns 287 ns 4
|
||||
Find concat three strexpr_stddev 11.6 ns 11.6 ns 4
|
||||
Find concat three strexpr_cv 4.04 % 4.03 % 4
|
||||
Find concat three simstr_mean 174 ns 174 ns 4
|
||||
Find concat three simstr_median 169 ns 169 ns 4
|
||||
Find concat three simstr_stddev 9.16 ns 9.16 ns 4
|
||||
Find concat three simstr_cv 5.28 % 5.28 % 4
|
||||
Find concat three stringzilla string_mean 621 ns 621 ns 4
|
||||
Find concat three stringzilla string_median 614 ns 614 ns 4
|
||||
Find concat three stringzilla string_stddev 25.6 ns 25.6 ns 4
|
||||
Find concat three stringzilla string_cv 4.13 % 4.13 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 27.5 ns 27.5 ns 4
|
||||
BuildTypeNameStr 0/0_median 27.5 ns 27.5 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.854 ns 0.854 ns 4
|
||||
BuildTypeNameStr 0/0_cv 3.10 % 3.10 % 4
|
||||
BuildTypeNameExp 0/0_mean 29.2 ns 29.2 ns 4
|
||||
BuildTypeNameExp 0/0_median 29.1 ns 29.1 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 1.09 ns 1.09 ns 4
|
||||
BuildTypeNameExp 0/0_cv 3.74 % 3.74 % 4
|
||||
BuildTypeNameSim 0/0_mean 38.8 ns 81.8 ns 4
|
||||
BuildTypeNameSim 0/0_median 38.5 ns 81.5 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 1.67 ns 1.67 ns 4
|
||||
BuildTypeNameSim 0/0_cv 2.05 % 2.04 % 4
|
||||
BuildTypeNameStr 10/10_mean 661 ns 661 ns 4
|
||||
BuildTypeNameStr 10/10_median 663 ns 663 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 19.6 ns 19.6 ns 4
|
||||
BuildTypeNameStr 10/10_cv 2.96 % 2.97 % 4
|
||||
BuildTypeNameExp 10/10_mean 201 ns 201 ns 4
|
||||
BuildTypeNameExp 10/10_median 199 ns 199 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 9.96 ns 9.96 ns 4
|
||||
BuildTypeNameExp 10/10_cv 4.95 % 4.95 % 4
|
||||
BuildTypeNameSim 10/10_mean 105 ns 105 ns 4
|
||||
BuildTypeNameSim 10/10_median 105 ns 105 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 4.46 ns 4.46 ns 4
|
||||
BuildTypeNameSim 10/10_cv 4.26 % 4.26 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 1091 ns 1091 ns 4
|
||||
Concat with replace str_median 1088 ns 1088 ns 4
|
||||
Concat with replace str_stddev 59.7 ns 59.7 ns 4
|
||||
Concat with replace str_cv 5.48 % 5.48 % 4
|
||||
Concat with replace exp_mean 502 ns 502 ns 4
|
||||
Concat with replace exp_median 501 ns 501 ns 4
|
||||
Concat with replace exp_stddev 25.9 ns 26.0 ns 4
|
||||
Concat with replace exp_cv 5.16 % 5.17 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 2.63 ns 2.63 ns 4
|
||||
std::string e;_median 2.63 ns 2.63 ns 4
|
||||
std::string e;_stddev 0.054 ns 0.054 ns 4
|
||||
std::string e;_cv 2.07 % 2.07 % 4
|
||||
std::string_view e;_mean 2.19 ns 2.19 ns 4
|
||||
std::string_view e;_median 2.20 ns 2.20 ns 4
|
||||
std::string_view e;_stddev 0.027 ns 0.027 ns 4
|
||||
std::string_view e;_cv 1.23 % 1.23 % 4
|
||||
ssa e;_mean 2.14 ns 2.14 ns 4
|
||||
ssa e;_median 2.13 ns 2.13 ns 4
|
||||
ssa e;_stddev 0.028 ns 0.028 ns 4
|
||||
ssa e;_cv 1.33 % 1.33 % 4
|
||||
stringa e;_mean 2.97 ns 2.97 ns 4
|
||||
stringa e;_median 2.95 ns 2.95 ns 4
|
||||
stringa e;_stddev 0.086 ns 0.086 ns 4
|
||||
stringa e;_cv 2.90 % 2.90 % 4
|
||||
lstringa<20> e;_mean 3.67 ns 3.67 ns 4
|
||||
lstringa<20> e;_median 3.65 ns 3.65 ns 4
|
||||
lstringa<20> e;_stddev 0.080 ns 0.080 ns 4
|
||||
lstringa<20> e;_cv 2.18 % 2.17 % 4
|
||||
lstringa<40> e;_mean 3.54 ns 3.54 ns 4
|
||||
lstringa<40> e;_median 3.52 ns 3.52 ns 4
|
||||
lstringa<40> e;_stddev 0.048 ns 0.048 ns 4
|
||||
lstringa<40> e;_cv 1.36 % 1.36 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 3.39 ns 3.39 ns 4
|
||||
std::string e = "Test text";_median 3.35 ns 3.35 ns 4
|
||||
std::string e = "Test text";_stddev 0.100 ns 0.100 ns 4
|
||||
std::string e = "Test text";_cv 2.94 % 2.94 % 4
|
||||
std::string_view e = "Test text";_mean 2.19 ns 2.19 ns 4
|
||||
std::string_view e = "Test text";_median 2.18 ns 2.18 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.025 ns 0.025 ns 4
|
||||
std::string_view e = "Test text";_cv 1.13 % 1.13 % 4
|
||||
ssa e = "Test text";_mean 2.14 ns 2.14 ns 4
|
||||
ssa e = "Test text";_median 2.14 ns 2.14 ns 4
|
||||
ssa e = "Test text";_stddev 0.016 ns 0.016 ns 4
|
||||
ssa e = "Test text";_cv 0.75 % 0.75 % 4
|
||||
stringa e = "Test text";_mean 3.03 ns 3.03 ns 4
|
||||
stringa e = "Test text";_median 3.01 ns 3.01 ns 4
|
||||
stringa e = "Test text";_stddev 0.109 ns 0.109 ns 4
|
||||
stringa e = "Test text";_cv 3.60 % 3.60 % 4
|
||||
lstringa<20> e = "Test text";_mean 3.96 ns 3.96 ns 4
|
||||
lstringa<20> e = "Test text";_median 3.95 ns 3.95 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.041 ns 0.042 ns 4
|
||||
lstringa<20> e = "Test text";_cv 1.05 % 1.05 % 4
|
||||
lstringa<40> e = "Test text";_mean 3.99 ns 3.99 ns 4
|
||||
lstringa<40> e = "Test text";_median 3.95 ns 3.95 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.100 ns 0.100 ns 4
|
||||
lstringa<40> e = "Test text";_cv 2.51 % 2.51 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 69.1 ns 69.1 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 68.6 ns 68.6 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 2.20 ns 2.20 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 3.18 % 3.18 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 2.17 ns 2.17 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 2.17 ns 2.17 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.027 ns 0.027 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.24 % 1.23 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 2.14 ns 2.14 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 2.14 ns 2.14 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.016 ns 0.016 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 0.74 % 0.74 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 2.97 ns 2.97 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 2.97 ns 2.97 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.009 ns 0.009 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 0.31 % 0.31 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 69.7 ns 69.7 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 67.6 ns 67.6 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 4.85 ns 4.85 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 6.96 % 6.96 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 16.5 ns 16.5 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 16.5 ns 16.5 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.074 ns 0.074 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 0.45 % 0.45 % 4
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 6.73 ns 6.73 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 6.67 ns 6.67 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.230 ns 0.230 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 3.41 % 3.41 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 2.20 ns 2.20 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 2.19 ns 2.19 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.036 ns 0.036 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 1.63 % 1.63 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 2.21 ns 2.21 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 2.21 ns 2.21 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.016 ns 0.016 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 0.70 % 0.70 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 4.66 ns 4.66 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 4.68 ns 4.68 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.062 ns 0.062 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 1.34 % 1.34 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 7.15 ns 29.0 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 7.15 ns 28.9 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.309 ns 0.309 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.06 % 1.06 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 7.34 ns 27.0 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 7.31 ns 26.9 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.088 ns 0.294 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.09 % 1.09 % 4
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 119 ns 119 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 119 ns 119 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.539 ns 0.539 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 0.45 % 0.45 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 2.22 ns 2.22 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 2.22 ns 2.22 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.057 ns 0.057 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 2.58 % 2.58 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 2.16 ns 2.16 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 2.15 ns 2.15 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.036 ns 0.036 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.67 % 1.67 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 2.98 ns 2.98 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 2.97 ns 2.97 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.077 ns 0.077 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 2.59 % 2.58 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 72.7 ns 72.7 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 72.1 ns 72.1 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 2.24 ns 2.24 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 3.09 % 3.09 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 50.4 ns 50.4 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 51.2 ns 51.2 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 2.04 ns 2.04 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 4.04 % 4.04 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 231 ns 231 ns 4
|
||||
sz::string::find;_median 228 ns 228 ns 4
|
||||
sz::string::find;_stddev 7.41 ns 7.40 ns 4
|
||||
sz::string::find;_cv 3.20 % 3.20 % 4
|
||||
std::string::find;_mean 99.9 ns 99.9 ns 4
|
||||
std::string::find;_median 100 ns 100 ns 4
|
||||
std::string::find;_stddev 1.27 ns 1.27 ns 4
|
||||
std::string::find;_cv 1.27 % 1.27 % 4
|
||||
std::string_view::find;_mean 96.4 ns 96.4 ns 4
|
||||
std::string_view::find;_median 96.3 ns 96.3 ns 4
|
||||
std::string_view::find;_stddev 2.12 ns 2.12 ns 4
|
||||
std::string_view::find;_cv 2.19 % 2.19 % 4
|
||||
ssa::find;_mean 97.9 ns 97.9 ns 4
|
||||
ssa::find;_median 98.0 ns 98.0 ns 4
|
||||
ssa::find;_stddev 0.885 ns 0.885 ns 4
|
||||
ssa::find;_cv 0.90 % 0.90 % 4
|
||||
stringa::find;_mean 99.1 ns 99.1 ns 4
|
||||
stringa::find;_median 99.2 ns 99.2 ns 4
|
||||
stringa::find;_stddev 1.47 ns 1.47 ns 4
|
||||
stringa::find;_cv 1.48 % 1.48 % 4
|
||||
lstringa<20>::find;_mean 115 ns 115 ns 4
|
||||
lstringa<20>::find;_median 115 ns 115 ns 4
|
||||
lstringa<20>::find;_stddev 0.573 ns 0.573 ns 4
|
||||
lstringa<20>::find;_cv 0.50 % 0.50 % 4
|
||||
lstringa<40>::find;_mean 115 ns 115 ns 4
|
||||
lstringa<40>::find;_median 115 ns 115 ns 4
|
||||
lstringa<40>::find;_stddev 0.998 ns 1.00 ns 4
|
||||
lstringa<40>::find;_cv 0.87 % 0.87 % 4
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string copy{str_with_len_N};/15_mean 125 ns 125 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 124 ns 124 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 4.14 ns 4.14 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 3.31 % 3.31 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 125 ns 125 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 123 ns 123 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 5.81 ns 5.81 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 4.63 % 4.63 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 126 ns 126 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 127 ns 127 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 6.56 ns 6.56 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 5.21 % 5.21 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 120 ns 120 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 121 ns 121 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 3.74 ns 3.74 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 3.11 % 3.11 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 124 ns 124 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 124 ns 124 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 5.54 ns 5.54 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 4.46 % 4.46 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 123 ns 123 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 123 ns 123 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 2.77 ns 2.77 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 2.26 % 2.26 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 133 ns 133 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 131 ns 131 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 8.98 ns 8.98 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 6.77 % 6.77 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 156 ns 156 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 145 ns 145 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 25.0 ns 25.0 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 16.03 % 16.03 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 150 ns 150 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 148 ns 148 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 4.82 ns 4.81 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 3.22 % 3.22 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 174 ns 174 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 157 ns 157 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 39.6 ns 39.6 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 22.78 % 22.78 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 217 ns 217 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 219 ns 219 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 23.4 ns 23.4 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 10.77 % 10.77 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 263 ns 263 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 265 ns 266 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 24.8 ns 24.7 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 9.41 % 9.41 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 4.83 ns 4.83 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 4.84 ns 4.84 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.021 ns 0.021 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 0.43 % 0.43 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 7.81 ns 7.81 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 7.85 ns 7.85 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.103 ns 0.103 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.32 % 1.32 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 8.12 ns 8.12 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 7.93 ns 7.93 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.453 ns 0.453 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 5.58 % 5.58 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 7.86 ns 7.86 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 7.87 ns 7.87 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.119 ns 0.119 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 1.51 % 1.51 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 7.82 ns 7.82 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 7.79 ns 7.79 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.099 ns 0.099 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 1.27 % 1.27 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 7.90 ns 7.90 ns 4
|
||||
stringa copy{str_with_len_N};/64_median 7.86 ns 7.86 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.151 ns 0.151 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 1.92 % 1.92 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 7.78 ns 7.78 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 7.79 ns 7.79 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.074 ns 0.074 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 0.95 % 0.95 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 8.03 ns 8.03 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 7.98 ns 7.98 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.252 ns 0.252 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 3.14 % 3.14 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 7.91 ns 7.91 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 7.89 ns 7.89 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.157 ns 0.157 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 1.98 % 1.98 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 7.78 ns 7.78 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 7.74 ns 7.74 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.113 ns 0.112 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 1.45 % 1.44 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 7.80 ns 7.80 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 7.81 ns 7.81 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.054 ns 0.054 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.69 % 0.69 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 7.79 ns 7.79 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 7.80 ns 7.80 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.057 ns 0.056 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 0.73 % 0.72 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 8.00 ns 8.00 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 7.99 ns 7.99 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.036 ns 0.035 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 0.45 % 0.44 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 20.7 ns 20.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 20.7 ns 20.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.825 ns 0.825 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 3.99 % 3.99 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 88.9 ns 88.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 89.6 ns 89.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 4.34 ns 4.34 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 4.88 % 4.88 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 88.3 ns 88.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 88.5 ns 88.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 1.91 ns 1.90 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.16 % 2.15 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 92.9 ns 92.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 93.4 ns 93.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 1.98 ns 1.98 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 2.14 % 2.14 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 96.1 ns 96.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 95.5 ns 95.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 1.75 ns 1.75 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 1.82 % 1.82 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 97.2 ns 97.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 96.3 ns 96.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 5.52 ns 5.52 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 5.68 % 5.68 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 130 ns 130 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 120 ns 120 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 27.7 ns 27.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 21.29 % 21.29 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 116 ns 116 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 116 ns 116 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 3.61 ns 3.61 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 3.12 % 3.12 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 139 ns 139 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 133 ns 133 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 21.2 ns 21.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 15.28 % 15.28 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 178 ns 178 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 187 ns 187 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 25.0 ns 25.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 14.00 % 13.99 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 221 ns 221 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 226 ns 226 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 16.1 ns 16.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 7.29 % 7.29 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 8.09 ns 8.09 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 8.05 ns 8.05 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.131 ns 0.131 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 1.62 % 1.62 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 21.2 ns 21.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 21.1 ns 21.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 1.21 ns 1.21 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 5.72 % 5.72 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 20.4 ns 20.4 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 20.1 ns 20.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.840 ns 0.840 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 4.13 % 4.13 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 20.3 ns 20.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 20.3 ns 20.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.410 ns 0.409 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 2.02 % 2.01 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 22.6 ns 22.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 22.7 ns 22.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.446 ns 0.446 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.98 % 1.98 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 23.3 ns 23.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 23.2 ns 23.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.362 ns 0.362 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 1.55 % 1.55 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 24.5 ns 24.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 24.7 ns 24.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.694 ns 0.694 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 2.83 % 2.83 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 26.6 ns 26.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 26.5 ns 26.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.879 ns 0.879 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 3.31 % 3.31 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 28.5 ns 28.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 28.4 ns 28.4 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.432 ns 0.434 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.52 % 1.52 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 137 ns 137 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 127 ns 127 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 23.3 ns 23.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 17.03 % 17.03 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 174 ns 174 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 181 ns 181 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 23.2 ns 23.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 13.36 % 13.36 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 220 ns 220 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 224 ns 224 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 18.1 ns 18.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 8.25 % 8.25 % 4
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 201 ns 201 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 200 ns 200 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 3.33 ns 3.33 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.66 % 1.66 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 2.16 ns 2.16 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 2.16 ns 2.16 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.008 ns 0.008 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 0.38 % 0.38 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 61.4 ns 61.4 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 61.1 ns 61.1 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.05 ns 1.05 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.72 % 1.72 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 49.4 ns 49.4 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 49.0 ns 49.0 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.88 ns 1.88 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 3.80 % 3.80 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 49.4 ns 49.4 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 49.0 ns 49.0 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.03 ns 1.03 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.08 % 2.08 % 4
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 146 ns 146 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 146 ns 146 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 1.25 ns 1.25 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 0.85 % 0.85 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 57.3 ns 57.3 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 57.0 ns 57.0 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 1.14 ns 1.14 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.99 % 1.99 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 60.0 ns 60.0 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 60.0 ns 60.0 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.743 ns 0.743 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.24 % 1.24 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 45.9 ns 45.9 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 45.6 ns 45.6 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.727 ns 0.727 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.58 % 1.58 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 46.3 ns 46.3 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 46.3 ns 46.3 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.834 ns 0.834 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.80 % 1.80 % 4
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 208 ns 208 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 207 ns 207 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 7.21 ns 7.21 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 3.47 % 3.47 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 58.9 ns 58.9 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 59.0 ns 59.0 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.521 ns 0.521 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.89 % 0.89 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 45.9 ns 45.9 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 45.8 ns 45.8 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.381 ns 0.381 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 0.83 % 0.83 % 4
|
||||
----- Convert to double '1234.567e10' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_mean 578 ns 578 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 578 ns 578 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 11.4 ns 11.4 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 1.97 % 1.97 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 273 ns 273 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 273 ns 273 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 4.31 ns 4.31 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 1.58 % 1.58 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 93.8 ns 93.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 94.1 ns 94.1 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 2.28 ns 2.28 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 2.43 % 2.43 % 4
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 15958 ns 15958 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 15858 ns 15858 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 399 ns 399 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.50 % 2.50 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1434 ns 1434 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1429 ns 1429 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 32.7 ns 32.7 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.28 % 2.28 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 1411 ns 1411 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 1420 ns 1420 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 35.6 ns 35.6 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 2.52 % 2.52 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 920 ns 920 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 916 ns 916 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 36.6 ns 36.6 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 3.98 % 3.98 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 638 ns 638 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 638 ns 638 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 12.0 ns 12.0 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 1.88 % 1.88 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 509 ns 509 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 510 ns 510 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 10.2 ns 10.2 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 2.00 % 2.00 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 16329 ns 16330 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 16205 ns 16205 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 468 ns 469 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 2.87 % 2.87 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 4574 ns 4574 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 4584 ns 4584 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 48.3 ns 48.3 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.06 % 1.06 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 1521 ns 1521 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 1529 ns 1529 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 20.6 ns 20.6 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.35 % 1.35 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 1206 ns 1206 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 1190 ns 1190 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 40.0 ns 40.0 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.31 % 3.31 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 916 ns 916 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 920 ns 920 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 9.03 ns 9.03 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 0.99 % 0.99 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 813 ns 813 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 812 ns 812 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 6.24 ns 6.24 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 0.77 % 0.77 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 833815 ns 833815 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 836530 ns 836530 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 39471 ns 39471 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 4.73 % 4.73 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 241478 ns 241478 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 241005 ns 241005 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 14187 ns 14187 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 5.87 % 5.87 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 57002 ns 57002 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 57062 ns 57062 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 678 ns 678 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.19 % 1.19 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 56617 ns 56619 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 56656 ns 56659 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1140 ns 1140 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.01 % 2.01 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 53906 ns 53906 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 53986 ns 53986 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 460 ns 460 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 0.85 % 0.85 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 55763 ns 55763 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 54817 ns 54817 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 3366 ns 3366 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 6.04 % 6.04 % 4
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 15927 ns 15927 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 15815 ns 15815 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 288 ns 288 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 1.81 % 1.81 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 4954 ns 4954 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 4942 ns 4942 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 58.1 ns 57.9 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.17 % 1.17 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 1852 ns 1852 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 1853 ns 1853 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 148 ns 148 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 7.99 % 7.99 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 1497 ns 1497 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 1507 ns 1507 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 97.3 ns 97.2 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 6.50 % 6.49 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 1196 ns 1196 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 1182 ns 1182 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 51.4 ns 51.4 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 4.29 % 4.29 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 1089 ns 1089 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 1074 ns 1074 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 79.2 ns 79.1 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 7.27 % 7.26 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 25783 ns 25783 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 25561 ns 25561 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 744 ns 744 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 2.89 % 2.89 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 3681 ns 3681 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 3682 ns 3682 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 52.0 ns 52.0 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.41 % 1.41 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 10716 ns 10716 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 10698 ns 10698 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 118 ns 118 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.10 % 1.10 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 5711 ns 5711 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 5732 ns 5732 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 99.1 ns 99.1 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 1.73 % 1.73 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 8447 ns 8447 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 8495 ns 8495 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 179 ns 179 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.12 % 2.12 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 7294 ns 7294 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 7082 ns 7082 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 498 ns 498 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 6.83 % 6.83 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 1418 ns 1418 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 1379 ns 1379 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 116 ns 116 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 8.21 % 8.21 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 572 ns 572 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 579 ns 579 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 27.3 ns 27.3 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 4.77 % 4.77 % 4
|
||||
stringa str = "test = " + k + " times";_mean 1197 ns 1197 ns 4
|
||||
stringa str = "test = " + k + " times";_median 1193 ns 1193 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 13.9 ns 13.9 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 1.17 % 1.16 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 1443 ns 1443 ns 4
|
||||
std::string::find + substr + std::strtol_median 1445 ns 1445 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 58.1 ns 58.1 ns 4
|
||||
std::string::find + substr + std::strtol_cv 4.03 % 4.03 % 4
|
||||
ssa::splitter + ssa::as_int_mean 595 ns 595 ns 4
|
||||
ssa::splitter + ssa::as_int_median 592 ns 592 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 23.1 ns 23.1 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 3.88 % 3.88 % 4
|
||||
ssa::splitf + functor_mean 853 ns 853 ns 4
|
||||
ssa::splitf + functor_median 868 ns 868 ns 4
|
||||
ssa::splitf + functor_stddev 41.3 ns 41.3 ns 4
|
||||
ssa::splitf + functor_cv 4.84 % 4.84 % 4
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 4959 ns 4959 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 4961 ns 4960 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 158 ns 158 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 3.19 % 3.19 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 9947 ns 9947 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 9790 ns 9790 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 427 ns 427 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 4.30 % 4.30 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 4617 ns 4617 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 4618 ns 4618 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 99.0 ns 98.7 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 2.14 % 2.14 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 4256 ns 4256 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 4222 ns 4222 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 258 ns 258 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 6.07 % 6.07 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 3810 ns 3810 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 3749 ns 3749 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 210 ns 210 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 5.51 % 5.51 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 3231 ns 3231 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 3215 ns 3215 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 96.4 ns 96.4 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 2.98 % 2.98 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 3050 ns 3050 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 3015 ns 3015 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 141 ns 141 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 4.61 % 4.61 % 4
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 889 ns 889 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 898 ns 898 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 42.5 ns 42.5 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 4.79 % 4.79 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 1379 ns 1379 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 1383 ns 1383 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 19.3 ns 19.3 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.40 % 1.40 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 804 ns 804 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 796 ns 796 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 45.8 ns 45.7 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 5.69 % 5.69 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 645 ns 645 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 642 ns 642 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 13.6 ns 13.6 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 2.10 % 2.10 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 770 ns 770 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 763 ns 763 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 25.3 ns 25.4 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 3.29 % 3.30 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 438 ns 438 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 442 ns 442 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 24.3 ns 24.3 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 5.55 % 5.55 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 577 ns 577 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 575 ns 575 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 30.9 ns 30.9 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 5.35 % 5.36 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 776 ns 776 ns 4
|
||||
replace bb to ---- in std::string|64_median 783 ns 783 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 55.1 ns 55.1 ns 4
|
||||
replace bb to ---- in std::string|64_cv 7.10 % 7.10 % 4
|
||||
replace bb to ---- in std::string|256_mean 2406 ns 2406 ns 4
|
||||
replace bb to ---- in std::string|256_median 2382 ns 2382 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 111 ns 111 ns 4
|
||||
replace bb to ---- in std::string|256_cv 4.60 % 4.60 % 4
|
||||
replace bb to ---- in std::string|512_mean 4112 ns 4112 ns 4
|
||||
replace bb to ---- in std::string|512_median 3940 ns 3940 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 365 ns 365 ns 4
|
||||
replace bb to ---- in std::string|512_cv 8.87 % 8.86 % 4
|
||||
replace bb to ---- in std::string|1024_mean 9118 ns 9118 ns 4
|
||||
replace bb to ---- in std::string|1024_median 9205 ns 9205 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 301 ns 301 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 3.30 % 3.30 % 4
|
||||
replace bb to ---- in std::string|2048_mean 19199 ns 19200 ns 4
|
||||
replace bb to ---- in std::string|2048_median 19100 ns 19102 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 483 ns 483 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 2.52 % 2.52 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 620 ns 620 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 603 ns 603 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 42.3 ns 42.3 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 6.82 % 6.83 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 1900 ns 1900 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 1872 ns 1872 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 68.9 ns 68.8 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 3.62 % 3.62 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 3505 ns 3505 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 3510 ns 3510 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 57.5 ns 57.5 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 1.64 % 1.64 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 6338 ns 6338 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 6236 ns 6236 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 282 ns 282 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 4.44 % 4.44 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 12720 ns 12720 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 12652 ns 12652 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 428 ns 428 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 3.36 % 3.36 % 4
|
||||
replace bb to ---- by init stringa|64_mean 379 ns 379 ns 4
|
||||
replace bb to ---- by init stringa|64_median 382 ns 382 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 8.97 ns 8.97 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 2.36 % 2.36 % 4
|
||||
replace bb to ---- by init stringa|256_mean 1126 ns 1126 ns 4
|
||||
replace bb to ---- by init stringa|256_median 1121 ns 1121 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 20.8 ns 20.8 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 1.85 % 1.85 % 4
|
||||
replace bb to ---- by init stringa|512_mean 2808 ns 2808 ns 4
|
||||
replace bb to ---- by init stringa|512_median 2764 ns 2764 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 131 ns 131 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 4.68 % 4.68 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 5776 ns 5776 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 5815 ns 5815 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 281 ns 282 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 4.87 % 4.87 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 12197 ns 12198 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 12071 ns 12072 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 427 ns 427 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 3.50 % 3.50 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 557 ns 557 ns 4
|
||||
replace bb to -- in std::string|64_median 552 ns 552 ns 4
|
||||
replace bb to -- in std::string|64_stddev 30.9 ns 30.9 ns 4
|
||||
replace bb to -- in std::string|64_cv 5.55 % 5.55 % 4
|
||||
replace bb to -- in std::string|256_mean 1747 ns 1747 ns 4
|
||||
replace bb to -- in std::string|256_median 1739 ns 1739 ns 4
|
||||
replace bb to -- in std::string|256_stddev 38.6 ns 38.6 ns 4
|
||||
replace bb to -- in std::string|256_cv 2.21 % 2.21 % 4
|
||||
replace bb to -- in std::string|512_mean 3241 ns 3241 ns 4
|
||||
replace bb to -- in std::string|512_median 3238 ns 3238 ns 4
|
||||
replace bb to -- in std::string|512_stddev 79.2 ns 79.2 ns 4
|
||||
replace bb to -- in std::string|512_cv 2.44 % 2.44 % 4
|
||||
replace bb to -- in std::string|1024_mean 6280 ns 6280 ns 4
|
||||
replace bb to -- in std::string|1024_median 6248 ns 6248 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 166 ns 166 ns 4
|
||||
replace bb to -- in std::string|1024_cv 2.65 % 2.65 % 4
|
||||
replace bb to -- in std::string|2048_mean 12918 ns 12919 ns 4
|
||||
replace bb to -- in std::string|2048_median 12642 ns 12642 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 1037 ns 1038 ns 4
|
||||
replace bb to -- in std::string|2048_cv 8.03 % 8.04 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 466 ns 466 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 465 ns 465 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 25.9 ns 25.9 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 5.55 % 5.55 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 1429 ns 1429 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 1439 ns 1439 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 65.5 ns 65.5 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 4.58 % 4.58 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 2538 ns 2538 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 2520 ns 2520 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 109 ns 109 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 4.29 % 4.29 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 4898 ns 4898 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 4886 ns 4886 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 185 ns 185 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 3.78 % 3.78 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 9438 ns 9439 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 9355 ns 9355 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 510 ns 510 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 5.40 % 5.40 % 4
|
||||
replace bb to -- by init stringa|64_mean 318 ns 318 ns 4
|
||||
replace bb to -- by init stringa|64_median 317 ns 317 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 13.3 ns 13.3 ns 4
|
||||
replace bb to -- by init stringa|64_cv 4.17 % 4.17 % 4
|
||||
replace bb to -- by init stringa|256_mean 958 ns 958 ns 4
|
||||
replace bb to -- by init stringa|256_median 950 ns 951 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 35.5 ns 35.5 ns 4
|
||||
replace bb to -- by init stringa|256_cv 3.71 % 3.71 % 4
|
||||
replace bb to -- by init stringa|512_mean 1814 ns 1814 ns 4
|
||||
replace bb to -- by init stringa|512_median 1816 ns 1816 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 75.8 ns 75.7 ns 4
|
||||
replace bb to -- by init stringa|512_cv 4.18 % 4.18 % 4
|
||||
replace bb to -- by init stringa|1024_mean 3500 ns 3500 ns 4
|
||||
replace bb to -- by init stringa|1024_median 3539 ns 3539 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 181 ns 181 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 5.18 % 5.18 % 4
|
||||
replace bb to -- by init stringa|2048_mean 6788 ns 6788 ns 4
|
||||
replace bb to -- by init stringa|2048_median 6729 ns 6729 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 312 ns 313 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 4.60 % 4.61 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 5109286 ns 5109286 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 5120357 ns 5120357 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 31875 ns 31875 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 0.62 % 0.62 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 6102064 ns 6102064 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 6092202 ns 6092202 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 124767 ns 124767 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 2.04 % 2.04 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 5120455 ns 5120455 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 5144318 ns 5144318 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 88971 ns 88971 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.74 % 1.74 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 7370000 ns 7370263 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 7135263 ns 7135789 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 570862 ns 570784 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 7.75 % 7.74 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 5735 ns 5735 ns 4
|
||||
Build func full name std::string;_median 5690 ns 5690 ns 4
|
||||
Build func full name std::string;_stddev 162 ns 162 ns 4
|
||||
Build func full name std::string;_cv 2.83 % 2.83 % 4
|
||||
Build func full name std::string 1;_mean 6226 ns 6226 ns 4
|
||||
Build func full name std::string 1;_median 6214 ns 6214 ns 4
|
||||
Build func full name std::string 1;_stddev 383 ns 383 ns 4
|
||||
Build func full name std::string 1;_cv 6.15 % 6.15 % 4
|
||||
Build func full name std::stream;_mean 25795 ns 25795 ns 4
|
||||
Build func full name std::stream;_median 25750 ns 25750 ns 4
|
||||
Build func full name std::stream;_stddev 445 ns 445 ns 4
|
||||
Build func full name std::stream;_cv 1.73 % 1.73 % 4
|
||||
Build func full name stringa;_mean 2962 ns 2962 ns 4
|
||||
Build func full name stringa;_median 2961 ns 2961 ns 4
|
||||
Build func full name stringa;_stddev 43.3 ns 43.3 ns 4
|
||||
Build func full name stringa;_cv 1.46 % 1.46 % 4
|
||||
Build func full name stringa 1;_mean 3450 ns 3450 ns 4
|
||||
Build func full name stringa 1;_median 3409 ns 3409 ns 4
|
||||
Build func full name stringa 1;_stddev 163 ns 163 ns 4
|
||||
Build func full name stringa 1;_cv 4.73 % 4.73 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 1276 ns 1276 ns 4
|
||||
To upper case std::wstring_median 1261 ns 1261 ns 4
|
||||
To upper case std::wstring_stddev 56.6 ns 56.6 ns 4
|
||||
To upper case std::wstring_cv 4.44 % 4.43 % 4
|
||||
To upper case lstringw<15>_mean 132 ns 132 ns 4
|
||||
To upper case lstringw<15>_median 132 ns 132 ns 4
|
||||
To upper case lstringw<15>_stddev 1.83 ns 1.83 ns 4
|
||||
To upper case lstringw<15>_cv 1.38 % 1.38 % 4
|
||||
Done!
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,981 @@
|
|||
Benchmarks of simstr, version 1.8.1
|
||||
Sources: https://github.com/orefkov/simstr
|
||||
Results: https://orefkov.github.io/simstr/results.html
|
||||
Compiler Clang 22.0.0, use libc++
|
||||
Run on (32 X 2513.96 MHz CPU s)
|
||||
Chrome/143.0.0.0 webasm
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Concatenate email ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat email std::format_mean 483 ns 483 ns 4
|
||||
Concat email std::format_median 481 ns 481 ns 4
|
||||
Concat email std::format_stddev 5.61 ns 5.61 ns 4
|
||||
Concat email std::format_cv 1.16 % 1.16 % 4
|
||||
Concat email std::stringstream_mean 1090 ns 1090 ns 4
|
||||
Concat email std::stringstream_median 1095 ns 1095 ns 4
|
||||
Concat email std::stringstream_stddev 16.5 ns 16.5 ns 4
|
||||
Concat email std::stringstream_cv 1.51 % 1.51 % 4
|
||||
Concat email stringzilla append_mean 230 ns 230 ns 4
|
||||
Concat email stringzilla append_median 230 ns 230 ns 4
|
||||
Concat email stringzilla append_stddev 1.55 ns 1.55 ns 4
|
||||
Concat email stringzilla append_cv 0.68 % 0.67 % 4
|
||||
Concat email stringzilla concat_mean 92.5 ns 92.5 ns 4
|
||||
Concat email stringzilla concat_median 92.8 ns 92.8 ns 4
|
||||
Concat email stringzilla concat_stddev 2.17 ns 2.17 ns 4
|
||||
Concat email stringzilla concat_cv 2.35 % 2.35 % 4
|
||||
Concat email std::string append_mean 289 ns 289 ns 4
|
||||
Concat email std::string append_median 290 ns 290 ns 4
|
||||
Concat email std::string append_stddev 8.94 ns 8.94 ns 4
|
||||
Concat email std::string append_cv 3.10 % 3.10 % 4
|
||||
Concat email std::string by strexpr_mean 88.2 ns 88.2 ns 4
|
||||
Concat email std::string by strexpr_median 86.7 ns 86.7 ns 4
|
||||
Concat email std::string by strexpr_stddev 5.21 ns 5.21 ns 4
|
||||
Concat email std::string by strexpr_cv 5.91 % 5.91 % 4
|
||||
Concat email stringa_mean 67.4 ns 67.4 ns 4
|
||||
Concat email stringa_median 67.3 ns 67.3 ns 4
|
||||
Concat email stringa_stddev 2.25 ns 2.25 ns 4
|
||||
Concat email stringa_cv 3.34 % 3.34 % 4
|
||||
----- Concatenate string + Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and number by std to std::string_mean 1042 ns 1042 ns 4
|
||||
Concat std::string and number by std to std::string_median 1048 ns 1048 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 25.0 ns 25.0 ns 4
|
||||
Concat std::string and number by std to std::string_cv 2.40 % 2.40 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 486 ns 486 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 484 ns 484 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 13.4 ns 13.4 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 2.77 % 2.77 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 217 ns 217 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 214 ns 214 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 8.29 ns 8.29 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 3.82 % 3.82 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 218 ns 218 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 217 ns 217 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 4.31 ns 4.31 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 1.98 % 1.98 % 4
|
||||
----- Concatenate string + Hex Number + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string and format hex number and literal to std::string_mean 2057 ns 2057 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 2054 ns 2054 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 53.5 ns 53.5 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 2.60 % 2.60 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 2629 ns 2629 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 2624 ns 2624 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 16.4 ns 16.4 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 0.63 % 0.63 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 676 ns 676 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 678 ns 678 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 9.67 ns 9.67 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.43 % 1.43 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 526 ns 526 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 525 ns 525 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 37.8 ns 37.8 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 7.20 % 7.20 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 189 ns 189 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 187 ns 187 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 10.4 ns 10.4 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 5.52 % 5.52 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 198 ns 198 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 199 ns 199 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 3.52 ns 3.52 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 1.77 % 1.77 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 355 ns 355 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 355 ns 355 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 12.1 ns 12.1 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 3.42 % 3.42 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 843 ns 843 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 846 ns 846 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 29.0 ns 29.0 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 3.44 % 3.44 % 4
|
||||
---- format/vformat and subst/vsubst octal number to 32 symbols result ----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_mean 414 ns 414 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 413 ns 413 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 13.6 ns 13.6 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 3.27 % 3.28 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 621 ns 621 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 618 ns 618 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 17.1 ns 17.1 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 2.76 % 2.76 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 1426 ns 1426 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 1430 ns 1430 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 22.1 ns 22.1 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 1.55 % 1.55 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 2149 ns 2149 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 2134 ns 2134 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 53.2 ns 53.2 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 2.48 % 2.48 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 2879 ns 2879 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 2903 ns 2903 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 57.1 ns 57.1 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.98 % 1.98 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 2940 ns 2940 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 2935 ns 2935 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 62.6 ns 62.6 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 2.13 % 2.13 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 2985 ns 2985 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 2971 ns 2971 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 58.0 ns 58.0 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 1.94 % 1.94 % 4
|
||||
std::format with std::formatted_size_mean 5263 ns 5263 ns 4
|
||||
std::format with std::formatted_size_median 5234 ns 5234 ns 4
|
||||
std::format with std::formatted_size_stddev 98.0 ns 98.0 ns 4
|
||||
std::format with std::formatted_size_cv 1.86 % 1.86 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 8433 ns 8433 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 8423 ns 8423 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 118 ns 118 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 1.40 % 1.40 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 109 ns 109 ns 4
|
||||
Concat std::string by std to std::string_median 109 ns 109 ns 4
|
||||
Concat std::string by std to std::string_stddev 1.82 ns 1.82 ns 4
|
||||
Concat std::string by std to std::string_cv 1.68 % 1.68 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 120 ns 120 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 120 ns 120 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 1.50 ns 1.50 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 1.24 % 1.24 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 95.4 ns 95.4 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 95.0 ns 95.0 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 3.65 ns 3.65 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 3.82 % 3.83 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 214 ns 214 ns 4
|
||||
Find concat three std::string_median 210 ns 210 ns 4
|
||||
Find concat three std::string_stddev 13.1 ns 13.1 ns 4
|
||||
Find concat three std::string_cv 6.13 % 6.13 % 4
|
||||
Find concat three strexpr_mean 100.0 ns 100.0 ns 4
|
||||
Find concat three strexpr_median 100.0 ns 100.0 ns 4
|
||||
Find concat three strexpr_stddev 1.10 ns 1.10 ns 4
|
||||
Find concat three strexpr_cv 1.10 % 1.10 % 4
|
||||
Find concat three simstr_mean 58.2 ns 58.2 ns 4
|
||||
Find concat three simstr_median 58.1 ns 58.1 ns 4
|
||||
Find concat three simstr_stddev 0.634 ns 0.635 ns 4
|
||||
Find concat three simstr_cv 1.09 % 1.09 % 4
|
||||
Find concat three stringzilla string_mean 268 ns 268 ns 4
|
||||
Find concat three stringzilla string_median 268 ns 268 ns 4
|
||||
Find concat three stringzilla string_stddev 1.90 ns 1.90 ns 4
|
||||
Find concat three stringzilla string_cv 0.71 % 0.71 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 20.9 ns 20.9 ns 4
|
||||
BuildTypeNameStr 0/0_median 21.0 ns 21.0 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.189 ns 0.189 ns 4
|
||||
BuildTypeNameStr 0/0_cv 0.90 % 0.90 % 4
|
||||
BuildTypeNameExp 0/0_mean 23.1 ns 23.1 ns 4
|
||||
BuildTypeNameExp 0/0_median 23.2 ns 23.2 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.711 ns 0.711 ns 4
|
||||
BuildTypeNameExp 0/0_cv 3.09 % 3.09 % 4
|
||||
BuildTypeNameSim 0/0_mean 20.4 ns 20.4 ns 4
|
||||
BuildTypeNameSim 0/0_median 20.2 ns 20.2 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.751 ns 0.751 ns 4
|
||||
BuildTypeNameSim 0/0_cv 3.67 % 3.67 % 4
|
||||
BuildTypeNameStr 10/10_mean 365 ns 365 ns 4
|
||||
BuildTypeNameStr 10/10_median 370 ns 370 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 13.3 ns 13.3 ns 4
|
||||
BuildTypeNameStr 10/10_cv 3.65 % 3.65 % 4
|
||||
BuildTypeNameExp 10/10_mean 116 ns 116 ns 4
|
||||
BuildTypeNameExp 10/10_median 116 ns 116 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 7.06 ns 7.06 ns 4
|
||||
BuildTypeNameExp 10/10_cv 6.10 % 6.10 % 4
|
||||
BuildTypeNameSim 10/10_mean 69.0 ns 69.0 ns 4
|
||||
BuildTypeNameSim 10/10_median 69.1 ns 69.2 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 1.79 ns 1.79 ns 4
|
||||
BuildTypeNameSim 10/10_cv 2.59 % 2.59 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 500 ns 500 ns 4
|
||||
Concat with replace str_median 498 ns 498 ns 4
|
||||
Concat with replace str_stddev 13.7 ns 13.7 ns 4
|
||||
Concat with replace str_cv 2.74 % 2.74 % 4
|
||||
Concat with replace exp_mean 235 ns 235 ns 4
|
||||
Concat with replace exp_median 234 ns 234 ns 4
|
||||
Concat with replace exp_stddev 2.95 ns 2.95 ns 4
|
||||
Concat with replace exp_cv 1.25 % 1.26 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 2.15 ns 2.15 ns 4
|
||||
std::string e;_median 2.15 ns 2.15 ns 4
|
||||
std::string e;_stddev 0.011 ns 0.011 ns 4
|
||||
std::string e;_cv 0.49 % 0.49 % 4
|
||||
std::string_view e;_mean 0.740 ns 0.740 ns 4
|
||||
std::string_view e;_median 0.736 ns 0.736 ns 4
|
||||
std::string_view e;_stddev 0.010 ns 0.010 ns 4
|
||||
std::string_view e;_cv 1.30 % 1.30 % 4
|
||||
ssa e;_mean 0.378 ns 0.378 ns 4
|
||||
ssa e;_median 0.376 ns 0.376 ns 4
|
||||
ssa e;_stddev 0.010 ns 0.010 ns 4
|
||||
ssa e;_cv 2.62 % 2.62 % 4
|
||||
stringa e;_mean 2.15 ns 2.15 ns 4
|
||||
stringa e;_median 2.16 ns 2.16 ns 4
|
||||
stringa e;_stddev 0.021 ns 0.021 ns 4
|
||||
stringa e;_cv 0.99 % 0.99 % 4
|
||||
lstringa<20> e;_mean 2.20 ns 2.20 ns 4
|
||||
lstringa<20> e;_median 2.20 ns 2.20 ns 4
|
||||
lstringa<20> e;_stddev 0.028 ns 0.028 ns 4
|
||||
lstringa<20> e;_cv 1.27 % 1.27 % 4
|
||||
lstringa<40> e;_mean 2.20 ns 2.20 ns 4
|
||||
lstringa<40> e;_median 2.21 ns 2.21 ns 4
|
||||
lstringa<40> e;_stddev 0.027 ns 0.027 ns 4
|
||||
lstringa<40> e;_cv 1.21 % 1.21 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 2.47 ns 2.47 ns 4
|
||||
std::string e = "Test text";_median 2.47 ns 2.47 ns 4
|
||||
std::string e = "Test text";_stddev 0.048 ns 0.048 ns 4
|
||||
std::string e = "Test text";_cv 1.96 % 1.96 % 4
|
||||
std::string_view e = "Test text";_mean 1.12 ns 1.12 ns 4
|
||||
std::string_view e = "Test text";_median 1.12 ns 1.12 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.023 ns 0.023 ns 4
|
||||
std::string_view e = "Test text";_cv 2.03 % 2.03 % 4
|
||||
ssa e = "Test text";_mean 0.744 ns 0.744 ns 4
|
||||
ssa e = "Test text";_median 0.732 ns 0.732 ns 4
|
||||
ssa e = "Test text";_stddev 0.026 ns 0.026 ns 4
|
||||
ssa e = "Test text";_cv 3.53 % 3.53 % 4
|
||||
stringa e = "Test text";_mean 2.19 ns 2.19 ns 4
|
||||
stringa e = "Test text";_median 2.19 ns 2.19 ns 4
|
||||
stringa e = "Test text";_stddev 0.014 ns 0.014 ns 4
|
||||
stringa e = "Test text";_cv 0.66 % 0.66 % 4
|
||||
lstringa<20> e = "Test text";_mean 2.63 ns 2.63 ns 4
|
||||
lstringa<20> e = "Test text";_median 2.64 ns 2.64 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.019 ns 0.019 ns 4
|
||||
lstringa<20> e = "Test text";_cv 0.71 % 0.71 % 4
|
||||
lstringa<40> e = "Test text";_mean 2.61 ns 2.61 ns 4
|
||||
lstringa<40> e = "Test text";_median 2.61 ns 2.61 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.027 ns 0.027 ns 4
|
||||
lstringa<40> e = "Test text";_cv 1.05 % 1.05 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 21.8 ns 21.8 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 21.9 ns 21.9 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.330 ns 0.329 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 1.51 % 1.51 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 1.10 ns 1.10 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 1.10 ns 1.10 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.010 ns 0.010 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 0.93 % 0.93 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 0.741 ns 0.741 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 0.739 ns 0.739 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.007 ns 0.007 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 0.93 % 0.93 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 2.22 ns 2.22 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 2.21 ns 2.21 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.039 ns 0.039 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 1.76 % 1.76 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 22.0 ns 22.0 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 21.9 ns 21.9 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.303 ns 0.303 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 1.38 % 1.38 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 2.98 ns 2.98 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 2.97 ns 2.97 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.042 ns 0.042 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.40 % 1.40 % 4
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 3.72 ns 3.72 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 3.70 ns 3.70 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.073 ns 0.073 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 1.97 % 1.97 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 1.10 ns 1.10 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 1.10 ns 1.10 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.016 ns 0.016 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 1.43 % 1.43 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 1.11 ns 1.11 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 1.11 ns 1.11 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.016 ns 0.016 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 1.44 % 1.43 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 2.53 ns 2.53 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 2.53 ns 2.53 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.004 ns 0.004 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 0.15 % 0.15 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 4.17 ns 4.17 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 4.17 ns 4.17 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.031 ns 0.031 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 0.75 % 0.75 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 4.49 ns 4.49 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 4.49 ns 4.49 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.079 ns 0.079 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.77 % 1.77 % 4
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 46.5 ns 46.5 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 45.8 ns 45.8 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 1.47 ns 1.47 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 3.17 % 3.17 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 1.11 ns 1.12 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 1.12 ns 1.12 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.019 ns 0.019 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.69 % 1.69 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.750 ns 0.750 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.750 ns 0.750 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.009 ns 0.009 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.22 % 1.22 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 2.21 ns 2.21 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 2.20 ns 2.20 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.033 ns 0.033 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.48 % 1.48 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 21.2 ns 21.2 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 21.2 ns 21.2 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.522 ns 0.522 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 2.46 % 2.46 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 15.8 ns 15.8 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 15.7 ns 15.7 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.213 ns 0.213 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 1.35 % 1.35 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 125 ns 125 ns 4
|
||||
sz::string::find;_median 125 ns 125 ns 4
|
||||
sz::string::find;_stddev 0.709 ns 0.709 ns 4
|
||||
sz::string::find;_cv 0.57 % 0.57 % 4
|
||||
std::string::find;_mean 40.8 ns 40.8 ns 4
|
||||
std::string::find;_median 40.7 ns 40.7 ns 4
|
||||
std::string::find;_stddev 0.562 ns 0.562 ns 4
|
||||
std::string::find;_cv 1.38 % 1.38 % 4
|
||||
std::string_view::find;_mean 41.2 ns 41.2 ns 4
|
||||
std::string_view::find;_median 40.6 ns 40.6 ns 4
|
||||
std::string_view::find;_stddev 1.36 ns 1.36 ns 4
|
||||
std::string_view::find;_cv 3.31 % 3.31 % 4
|
||||
ssa::find;_mean 40.6 ns 40.6 ns 4
|
||||
ssa::find;_median 40.5 ns 40.5 ns 4
|
||||
ssa::find;_stddev 0.597 ns 0.597 ns 4
|
||||
ssa::find;_cv 1.47 % 1.47 % 4
|
||||
stringa::find;_mean 41.2 ns 41.2 ns 4
|
||||
stringa::find;_median 41.1 ns 41.1 ns 4
|
||||
stringa::find;_stddev 0.538 ns 0.537 ns 4
|
||||
stringa::find;_cv 1.30 % 1.30 % 4
|
||||
lstringa<20>::find;_mean 39.8 ns 39.8 ns 4
|
||||
lstringa<20>::find;_median 40.0 ns 40.0 ns 4
|
||||
lstringa<20>::find;_stddev 0.572 ns 0.572 ns 4
|
||||
lstringa<20>::find;_cv 1.44 % 1.44 % 4
|
||||
lstringa<40>::find;_mean 39.7 ns 39.7 ns 4
|
||||
lstringa<40>::find;_median 39.5 ns 39.5 ns 4
|
||||
lstringa<40>::find;_stddev 0.736 ns 0.737 ns 4
|
||||
lstringa<40>::find;_cv 1.86 % 1.86 % 4
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string copy{str_with_len_N};/15_mean 52.3 ns 52.3 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 52.7 ns 52.7 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 1.46 ns 1.46 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 2.79 % 2.80 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 53.0 ns 53.0 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 52.9 ns 52.9 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 1.28 ns 1.28 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 2.42 % 2.42 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 52.5 ns 52.5 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 53.0 ns 53.0 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 1.61 ns 1.61 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 3.07 % 3.07 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 51.6 ns 51.6 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 51.8 ns 51.8 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 0.532 ns 0.531 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 1.03 % 1.03 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 53.9 ns 53.9 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 54.1 ns 54.1 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 0.490 ns 0.490 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 0.91 % 0.91 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 54.4 ns 54.4 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 54.4 ns 54.4 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 0.482 ns 0.482 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 0.89 % 0.89 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 59.7 ns 59.7 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 56.7 ns 56.7 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 6.91 ns 6.91 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 11.58 % 11.58 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 73.8 ns 73.8 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 74.3 ns 74.3 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 8.94 ns 8.94 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 12.12 % 12.12 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 81.2 ns 81.2 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 82.6 ns 82.6 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 9.69 ns 9.69 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 11.94 % 11.94 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 93.3 ns 93.3 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 93.4 ns 93.4 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 1.97 ns 1.97 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 2.11 % 2.11 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 109 ns 109 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 110 ns 110 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 2.09 ns 2.09 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 1.92 % 1.92 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 165 ns 165 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 165 ns 165 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 2.73 ns 2.73 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 1.65 % 1.65 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 2.46 ns 2.46 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 2.45 ns 2.45 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.085 ns 0.085 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 3.46 % 3.46 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.050 ns 0.050 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.09 % 1.09 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 4.54 ns 4.54 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.024 ns 0.024 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 0.54 % 0.54 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.034 ns 0.034 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 0.75 % 0.75 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.064 ns 0.064 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 1.41 % 1.41 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 4.56 ns 4.56 ns 4
|
||||
stringa copy{str_with_len_N};/64_median 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.059 ns 0.059 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 1.29 % 1.29 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 4.55 ns 4.55 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.060 ns 0.060 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 1.32 % 1.32 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 4.56 ns 4.56 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.043 ns 0.043 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.95 % 0.95 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 4.60 ns 4.60 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 4.58 ns 4.58 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.051 ns 0.051 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 1.10 % 1.10 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 4.56 ns 4.56 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.052 ns 0.052 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 1.14 % 1.14 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 4.56 ns 4.56 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.045 ns 0.045 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.98 % 0.98 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 4.57 ns 4.57 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 4.59 ns 4.59 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.055 ns 0.055 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 1.20 % 1.20 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 4.14 ns 4.14 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 4.12 ns 4.12 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.074 ns 0.074 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.78 % 1.78 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 16.9 ns 16.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 16.5 ns 16.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.839 ns 0.839 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 4.97 % 4.97 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 36.0 ns 36.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 36.0 ns 36.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.556 ns 0.556 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.55 % 1.55 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 37.0 ns 37.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 37.0 ns 37.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 0.240 ns 0.240 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 0.65 % 0.65 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 38.0 ns 38.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 37.8 ns 37.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.985 ns 0.985 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 2.60 % 2.60 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 38.3 ns 38.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 38.3 ns 38.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.332 ns 0.332 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 0.87 % 0.87 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 38.8 ns 38.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 38.4 ns 38.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.889 ns 0.889 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 2.29 % 2.29 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 62.4 ns 62.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 66.7 ns 66.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 10.1 ns 10.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 16.21 % 16.21 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 66.7 ns 66.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 69.9 ns 69.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 11.9 ns 11.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 17.82 % 17.82 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 78.8 ns 78.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 78.5 ns 78.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 3.36 ns 3.36 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 4.27 % 4.27 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 94.8 ns 94.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 94.8 ns 94.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 0.570 ns 0.570 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 0.60 % 0.60 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 146 ns 146 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 146 ns 146 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 2.30 ns 2.30 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 1.57 % 1.57 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 4.06 ns 4.06 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 4.06 ns 4.06 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.038 ns 0.038 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 0.94 % 0.94 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 15.1 ns 15.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 15.1 ns 15.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.210 ns 0.210 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 1.40 % 1.40 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 15.1 ns 15.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 15.2 ns 15.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.322 ns 0.322 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 2.13 % 2.13 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 15.2 ns 15.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 15.2 ns 15.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.357 ns 0.357 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 2.34 % 2.34 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 16.9 ns 16.9 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 17.0 ns 17.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.320 ns 0.320 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.90 % 1.90 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 17.9 ns 17.9 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 18.1 ns 18.1 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.618 ns 0.618 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 3.46 % 3.46 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 18.2 ns 18.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 18.2 ns 18.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.466 ns 0.466 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 2.56 % 2.56 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 20.8 ns 20.8 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 21.0 ns 21.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.540 ns 0.540 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 2.59 % 2.59 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 24.0 ns 24.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 24.0 ns 24.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.374 ns 0.374 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.56 % 1.56 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 78.6 ns 78.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 77.5 ns 77.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 2.75 ns 2.75 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 3.49 % 3.49 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 95.8 ns 95.8 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 95.7 ns 95.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 2.32 ns 2.32 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.42 % 2.42 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 146 ns 146 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 146 ns 146 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 1.96 ns 1.96 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 1.34 % 1.34 % 4
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 91.7 ns 91.7 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 91.5 ns 91.5 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 1.23 ns 1.23 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.34 % 1.34 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 0.739 ns 0.739 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 0.740 ns 0.740 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.006 ns 0.006 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 0.86 % 0.86 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 20.4 ns 20.4 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 20.4 ns 20.4 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.133 ns 0.133 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.65 % 0.65 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 16.2 ns 16.2 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 16.2 ns 16.2 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.183 ns 0.183 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.13 % 1.13 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 16.1 ns 16.1 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 16.1 ns 16.1 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.297 ns 0.297 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.84 % 1.84 % 4
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 67.2 ns 67.2 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 67.2 ns 67.2 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.233 ns 0.233 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 0.35 % 0.35 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 18.3 ns 18.3 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 18.3 ns 18.3 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.264 ns 0.263 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.44 % 1.44 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 17.2 ns 17.2 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 17.3 ns 17.3 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.309 ns 0.309 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.79 % 1.79 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 16.7 ns 16.7 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 16.6 ns 16.6 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.184 ns 0.184 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.10 % 1.10 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 16.1 ns 16.1 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 16.0 ns 16.0 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.330 ns 0.330 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.04 % 2.04 % 4
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 97.3 ns 97.3 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 97.6 ns 97.6 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 1.28 ns 1.28 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 1.32 % 1.32 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 13.7 ns 13.7 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 13.7 ns 13.7 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.061 ns 0.061 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.44 % 0.44 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 15.0 ns 15.0 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 15.0 ns 15.0 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.408 ns 0.407 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 2.71 % 2.71 % 4
|
||||
----- Convert to double '1234.567e10' ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_mean 298 ns 298 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 297 ns 297 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 4.44 ns 4.45 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 1.49 % 1.49 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 108 ns 108 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 108 ns 108 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 1.57 ns 1.57 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 1.45 % 1.45 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 42.2 ns 42.2 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 42.3 ns 42.3 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.399 ns 0.399 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 0.95 % 0.95 % 4
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 6499 ns 6499 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 6469 ns 6469 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 189 ns 189 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.90 % 2.90 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 815 ns 815 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 820 ns 820 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 20.2 ns 20.2 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.48 % 2.48 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 794 ns 794 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 793 ns 793 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 94.1 ns 94.1 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 11.84 % 11.84 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 620 ns 620 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 615 ns 615 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 22.6 ns 22.6 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 3.65 % 3.65 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 401 ns 401 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 405 ns 405 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 14.1 ns 14.1 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 3.52 % 3.52 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 335 ns 335 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 335 ns 335 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 4.51 ns 4.52 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.35 % 1.35 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 7163 ns 7163 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 7211 ns 7211 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 153 ns 153 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 2.14 % 2.14 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 2186 ns 2186 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 2185 ns 2185 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 40.6 ns 40.6 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.86 % 1.86 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 890 ns 890 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 892 ns 892 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 31.5 ns 31.5 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.54 % 3.54 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 864 ns 864 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 843 ns 843 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 72.7 ns 72.7 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 8.42 % 8.42 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 722 ns 722 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 723 ns 723 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 6.78 ns 6.79 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 0.94 % 0.94 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 639 ns 639 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 637 ns 637 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 18.2 ns 18.3 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.85 % 2.86 % 4
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 348509 ns 348511 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 346178 ns 346180 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 6563 ns 6565 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 1.88 % 1.88 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 120123 ns 120124 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 119443 ns 119443 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 2307 ns 2307 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.92 % 1.92 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 44146 ns 44146 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 44022 ns 44023 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 746 ns 746 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.69 % 1.69 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 44572 ns 44572 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 44629 ns 44629 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 793 ns 793 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.78 % 1.78 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 44298 ns 44298 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 44441 ns 44441 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 777 ns 777 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.75 % 1.75 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 44327 ns 44327 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 44235 ns 44235 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 660 ns 660 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.49 % 1.49 % 4
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 7317 ns 7317 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 7276 ns 7276 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 187 ns 187 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.55 % 2.55 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 2607 ns 2607 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 2588 ns 2588 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 76.9 ns 77.0 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 2.95 % 2.95 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 1132 ns 1132 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 1125 ns 1125 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 24.3 ns 24.3 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 2.15 % 2.15 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 1062 ns 1062 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 1062 ns 1062 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 10.9 ns 10.9 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 1.03 % 1.03 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 914 ns 914 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 917 ns 917 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 16.5 ns 16.5 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 1.81 % 1.81 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 829 ns 829 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 829 ns 829 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 14.6 ns 14.6 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 1.76 % 1.76 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 11412 ns 11412 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 11465 ns 11465 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 153 ns 153 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 1.34 % 1.34 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 1772 ns 1772 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 1755 ns 1755 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 99.1 ns 99.1 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 5.59 % 5.59 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 5285 ns 5285 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 5294 ns 5294 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 36.6 ns 36.6 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 0.69 % 0.69 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 2834 ns 2834 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 2832 ns 2832 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 37.0 ns 37.0 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 1.30 % 1.30 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 4681 ns 4681 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 4678 ns 4678 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 65.6 ns 65.6 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 1.40 % 1.40 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 4054 ns 4054 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 4047 ns 4047 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 105 ns 105 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 2.59 % 2.59 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 555 ns 555 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 546 ns 546 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 29.0 ns 29.0 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 5.22 % 5.22 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 339 ns 339 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 341 ns 341 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 10.3 ns 10.3 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 3.03 % 3.03 % 4
|
||||
stringa str = "test = " + k + " times";_mean 511 ns 511 ns 4
|
||||
stringa str = "test = " + k + " times";_median 512 ns 512 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 30.8 ns 30.8 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 6.01 % 6.01 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 660 ns 660 ns 4
|
||||
std::string::find + substr + std::strtol_median 660 ns 660 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 10.3 ns 10.3 ns 4
|
||||
std::string::find + substr + std::strtol_cv 1.56 % 1.56 % 4
|
||||
ssa::splitter + ssa::as_int_mean 245 ns 245 ns 4
|
||||
ssa::splitter + ssa::as_int_median 244 ns 244 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 3.30 ns 3.30 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 1.35 % 1.35 % 4
|
||||
ssa::splitf + functor_mean 271 ns 271 ns 4
|
||||
ssa::splitf + functor_median 268 ns 268 ns 4
|
||||
ssa::splitf + functor_stddev 7.54 ns 7.54 ns 4
|
||||
ssa::splitf + functor_cv 2.78 % 2.78 % 4
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 2872 ns 2872 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 2855 ns 2855 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 93.5 ns 93.5 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 3.25 % 3.26 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 5223 ns 5223 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 5241 ns 5241 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 157 ns 157 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 3.01 % 3.01 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2704 ns 2704 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 2721 ns 2721 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 96.7 ns 96.7 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 3.58 % 3.57 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 2675 ns 2675 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 2681 ns 2681 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 59.7 ns 59.7 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 2.23 % 2.23 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 2107 ns 2107 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 2118 ns 2118 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 57.8 ns 57.8 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 2.74 % 2.74 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 2227 ns 2227 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 2210 ns 2210 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 56.1 ns 56.1 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 2.52 % 2.52 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 1872 ns 1872 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 1874 ns 1874 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 23.9 ns 23.9 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 1.27 % 1.27 % 4
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 472 ns 472 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 472 ns 472 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 8.01 ns 8.00 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.70 % 1.70 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 718 ns 718 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 717 ns 717 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 18.4 ns 18.4 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 2.57 % 2.57 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 433 ns 433 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 438 ns 438 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 15.1 ns 15.1 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 3.49 % 3.49 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 378 ns 378 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 374 ns 374 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 11.6 ns 11.6 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 3.07 % 3.07 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 391 ns 391 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 389 ns 389 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 8.66 ns 8.66 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 2.22 % 2.22 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 271 ns 271 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 274 ns 274 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 10.6 ns 10.6 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 3.91 % 3.91 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 294 ns 294 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 296 ns 296 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 6.16 ns 6.16 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 2.09 % 2.09 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 363 ns 363 ns 4
|
||||
replace bb to ---- in std::string|64_median 363 ns 363 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 17.7 ns 17.7 ns 4
|
||||
replace bb to ---- in std::string|64_cv 4.89 % 4.89 % 4
|
||||
replace bb to ---- in std::string|256_mean 1189 ns 1189 ns 4
|
||||
replace bb to ---- in std::string|256_median 1176 ns 1176 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 42.3 ns 42.3 ns 4
|
||||
replace bb to ---- in std::string|256_cv 3.56 % 3.56 % 4
|
||||
replace bb to ---- in std::string|512_mean 2210 ns 2210 ns 4
|
||||
replace bb to ---- in std::string|512_median 2215 ns 2215 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 90.9 ns 90.9 ns 4
|
||||
replace bb to ---- in std::string|512_cv 4.12 % 4.12 % 4
|
||||
replace bb to ---- in std::string|1024_mean 4756 ns 4756 ns 4
|
||||
replace bb to ---- in std::string|1024_median 4774 ns 4774 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 235 ns 235 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 4.94 % 4.94 % 4
|
||||
replace bb to ---- in std::string|2048_mean 11109 ns 11109 ns 4
|
||||
replace bb to ---- in std::string|2048_median 11132 ns 11132 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 260 ns 260 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 2.34 % 2.34 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 292 ns 292 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 292 ns 292 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 13.1 ns 13.1 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 4.49 % 4.49 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 913 ns 913 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 918 ns 918 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 27.9 ns 27.9 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 3.06 % 3.06 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 1685 ns 1685 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 1682 ns 1682 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 31.6 ns 31.6 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 1.88 % 1.88 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 3100 ns 3100 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 3052 ns 3052 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 117 ns 117 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 3.77 % 3.77 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 6119 ns 6119 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 6220 ns 6220 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 316 ns 316 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 5.16 % 5.16 % 4
|
||||
replace bb to ---- by init stringa|64_mean 187 ns 187 ns 4
|
||||
replace bb to ---- by init stringa|64_median 184 ns 184 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 13.2 ns 13.2 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 7.05 % 7.05 % 4
|
||||
replace bb to ---- by init stringa|256_mean 580 ns 580 ns 4
|
||||
replace bb to ---- by init stringa|256_median 591 ns 591 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 28.6 ns 28.6 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 4.94 % 4.94 % 4
|
||||
replace bb to ---- by init stringa|512_mean 1341 ns 1341 ns 4
|
||||
replace bb to ---- by init stringa|512_median 1340 ns 1340 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 12.1 ns 12.1 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 0.90 % 0.90 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 2813 ns 2813 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 2828 ns 2828 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 55.7 ns 55.7 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 1.98 % 1.98 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 5550 ns 5550 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 5503 ns 5503 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 133 ns 133 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 2.39 % 2.39 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 243 ns 243 ns 4
|
||||
replace bb to -- in std::string|64_median 242 ns 242 ns 4
|
||||
replace bb to -- in std::string|64_stddev 4.47 ns 4.47 ns 4
|
||||
replace bb to -- in std::string|64_cv 1.84 % 1.84 % 4
|
||||
replace bb to -- in std::string|256_mean 814 ns 814 ns 4
|
||||
replace bb to -- in std::string|256_median 817 ns 817 ns 4
|
||||
replace bb to -- in std::string|256_stddev 30.9 ns 30.9 ns 4
|
||||
replace bb to -- in std::string|256_cv 3.79 % 3.79 % 4
|
||||
replace bb to -- in std::string|512_mean 1542 ns 1542 ns 4
|
||||
replace bb to -- in std::string|512_median 1548 ns 1548 ns 4
|
||||
replace bb to -- in std::string|512_stddev 58.0 ns 58.0 ns 4
|
||||
replace bb to -- in std::string|512_cv 3.76 % 3.76 % 4
|
||||
replace bb to -- in std::string|1024_mean 2825 ns 2825 ns 4
|
||||
replace bb to -- in std::string|1024_median 2823 ns 2823 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 73.7 ns 73.7 ns 4
|
||||
replace bb to -- in std::string|1024_cv 2.61 % 2.61 % 4
|
||||
replace bb to -- in std::string|2048_mean 5545 ns 5545 ns 4
|
||||
replace bb to -- in std::string|2048_median 5553 ns 5553 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 80.6 ns 80.6 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.45 % 1.45 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 192 ns 192 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 192 ns 192 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 2.88 ns 2.88 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 1.50 % 1.50 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 636 ns 636 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 636 ns 636 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 5.38 ns 5.37 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 0.85 % 0.84 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 1150 ns 1150 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 1131 ns 1131 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 42.8 ns 42.8 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 3.72 % 3.72 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 2296 ns 2296 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 2292 ns 2292 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 64.2 ns 64.2 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 2.80 % 2.80 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 4237 ns 4237 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 4236 ns 4236 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 67.5 ns 67.4 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.59 % 1.59 % 4
|
||||
replace bb to -- by init stringa|64_mean 136 ns 136 ns 4
|
||||
replace bb to -- by init stringa|64_median 137 ns 137 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 3.83 ns 3.84 ns 4
|
||||
replace bb to -- by init stringa|64_cv 2.81 % 2.81 % 4
|
||||
replace bb to -- by init stringa|256_mean 464 ns 464 ns 4
|
||||
replace bb to -- by init stringa|256_median 468 ns 468 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 10.2 ns 10.2 ns 4
|
||||
replace bb to -- by init stringa|256_cv 2.20 % 2.20 % 4
|
||||
replace bb to -- by init stringa|512_mean 838 ns 838 ns 4
|
||||
replace bb to -- by init stringa|512_median 843 ns 843 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 11.5 ns 11.5 ns 4
|
||||
replace bb to -- by init stringa|512_cv 1.37 % 1.37 % 4
|
||||
replace bb to -- by init stringa|1024_mean 1620 ns 1620 ns 4
|
||||
replace bb to -- by init stringa|1024_median 1616 ns 1616 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 45.0 ns 45.0 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 2.78 % 2.78 % 4
|
||||
replace bb to -- by init stringa|2048_mean 2774 ns 2774 ns 4
|
||||
replace bb to -- by init stringa|2048_median 2790 ns 2790 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 87.5 ns 87.5 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 3.16 % 3.15 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3271665 ns 3271682 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3273789 ns 3273823 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 31230 ns 31230 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 0.95 % 0.95 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3592775 ns 3592795 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3597592 ns 3597618 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 44741 ns 44725 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 1.25 % 1.24 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3244867 ns 3244884 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3239181 ns 3239192 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 17436 ns 17437 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 0.54 % 0.54 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4041903 ns 4041917 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4036025 ns 4036025 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 24855 ns 24882 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 0.61 % 0.62 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 3162 ns 3162 ns 4
|
||||
Build func full name std::string;_median 3147 ns 3147 ns 4
|
||||
Build func full name std::string;_stddev 52.6 ns 52.5 ns 4
|
||||
Build func full name std::string;_cv 1.66 % 1.66 % 4
|
||||
Build func full name std::string 1;_mean 3363 ns 3363 ns 4
|
||||
Build func full name std::string 1;_median 3372 ns 3372 ns 4
|
||||
Build func full name std::string 1;_stddev 87.9 ns 87.9 ns 4
|
||||
Build func full name std::string 1;_cv 2.61 % 2.61 % 4
|
||||
Build func full name std::stream;_mean 11876 ns 11876 ns 4
|
||||
Build func full name std::stream;_median 11928 ns 11928 ns 4
|
||||
Build func full name std::stream;_stddev 311 ns 311 ns 4
|
||||
Build func full name std::stream;_cv 2.62 % 2.62 % 4
|
||||
Build func full name stringa;_mean 1461 ns 1461 ns 4
|
||||
Build func full name stringa;_median 1472 ns 1472 ns 4
|
||||
Build func full name stringa;_stddev 42.0 ns 42.0 ns 4
|
||||
Build func full name stringa;_cv 2.87 % 2.87 % 4
|
||||
Build func full name stringa 1;_mean 1910 ns 1910 ns 4
|
||||
Build func full name stringa 1;_median 1889 ns 1889 ns 4
|
||||
Build func full name stringa 1;_stddev 57.7 ns 57.7 ns 4
|
||||
Build func full name stringa 1;_cv 3.02 % 3.02 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 204 ns 204 ns 4
|
||||
To upper case std::wstring_median 204 ns 204 ns 4
|
||||
To upper case std::wstring_stddev 1.85 ns 1.85 ns 4
|
||||
To upper case std::wstring_cv 0.91 % 0.91 % 4
|
||||
To upper case lstringw<15>_mean 63.1 ns 63.1 ns 4
|
||||
To upper case lstringw<15>_median 62.9 ns 62.9 ns 4
|
||||
To upper case lstringw<15>_stddev 0.872 ns 0.872 ns 4
|
||||
To upper case lstringw<15>_cv 1.38 % 1.38 % 4
|
||||
|
|
@ -48,7 +48,7 @@ PROJECT_NAME = "simstr"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.7.0
|
||||
PROJECT_NUMBER = 1.9.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewers a
|
||||
|
|
@ -2928,7 +2928,7 @@ MAX_DOT_GRAPH_DEPTH = 0
|
|||
|
||||
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
|
||||
# files in one run (i.e. multiple -o and -T options on the command line). This
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.20) support
|
||||
# this, this feature is disabled by default.
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ PROJECT_NAME = "simstr"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.7.0
|
||||
PROJECT_NUMBER = 1.9.1
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewers a
|
||||
|
|
@ -2928,7 +2928,7 @@ MAX_DOT_GRAPH_DEPTH = 0
|
|||
|
||||
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
|
||||
# files in one run (i.e. multiple -o and -T options on the command line). This
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.20) support
|
||||
# this, this feature is disabled by default.
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* База для строковых конкатенаций через выражения времени компиляции
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
@ -1602,7 +1602,10 @@ constexpr const size_t npos = static_cast<size_t>(-1); //NOLINT
|
|||
} // namespace str
|
||||
|
||||
template<typename K>
|
||||
struct ch_traits : std::char_traits<K>{};
|
||||
std::char_traits<K> char_traits_selector(...);
|
||||
|
||||
template<typename K>
|
||||
using ch_traits = decltype(char_traits_selector<K>(int(0)));
|
||||
|
||||
template<typename T>
|
||||
concept FromIntNumber =
|
||||
|
|
@ -1673,11 +1676,11 @@ struct expr_num : expr_to_std_string<expr_num<K, T>> {
|
|||
constexpr expr_num(expr_num&& t) noexcept : value(t.value) {}
|
||||
|
||||
constexpr size_t length() const noexcept {
|
||||
value = (T)fromInt(buf + bufSize, value);
|
||||
return (size_t)value;
|
||||
value = static_cast<T>(fromInt(buf + bufSize, value));
|
||||
return static_cast<size_t>(value);
|
||||
}
|
||||
constexpr K* place(K* ptr) const noexcept {
|
||||
size_t len = (size_t)value;
|
||||
size_t len = static_cast<size_t>(value);
|
||||
ch_traits<K>::copy(ptr, buf + bufSize - len, len);
|
||||
return ptr + len;
|
||||
}
|
||||
|
|
@ -2061,7 +2064,6 @@ template<is_one_of_char_v K, FromIntNumber T, unsigned Radix, f::FmtParamSet FP>
|
|||
requires (Radix > 1 && Radix <= 36)
|
||||
struct expr_integer : expr_to_std_string<expr_integer<K, T, Radix, FP>> {
|
||||
using symb_type = K;
|
||||
using my_type = expr_num<K, T>;
|
||||
|
||||
enum { bufSize = 64 };
|
||||
mutable K buf[bufSize];
|
||||
|
|
@ -2115,7 +2117,7 @@ struct expr_integer : expr_to_std_string<expr_integer<K, T, Radix, FP>> {
|
|||
}
|
||||
}
|
||||
constexpr K* place(K* ptr) const noexcept {
|
||||
size_t len = (size_t)value_, all_len = len;
|
||||
size_t len = static_cast<size_t>(value_), all_len = len;
|
||||
if constexpr (std::is_signed_v<T>) {
|
||||
if constexpr (FP::sign != f::int_plus_sign::none) {
|
||||
all_len++;
|
||||
|
|
@ -2792,7 +2794,7 @@ struct expr_join : expr_to_std_string<expr_join<K, T, I, tail, skip_empty>> {
|
|||
* @param s - контейнер со строками, должен поддерживать `range for`.
|
||||
* @param d - разделитель, строковый литерал.
|
||||
* @en @brief Get a string expression concatenating the strings in the container into a single string with the given delimiter.limiter.limiter.
|
||||
* @tparam tail - whether to add a separator after the last line.
|
||||
* @tparam tail - whether to add a separator after the last string.
|
||||
* @tparam skip_empty - skip empty lines without adding a separator.
|
||||
* @param s - container with strings, must support `range for`.
|
||||
* @param d - delimiter, string literal.
|
||||
|
|
@ -3014,7 +3016,7 @@ struct int_convert { // NOLINT
|
|||
result = negate ? 0 - number : number;
|
||||
if constexpr (CheckOverflow) {
|
||||
if (error != IntConvertResult::Overflow) {
|
||||
if (number > std::numeric_limits<T>::max() + (negate ? 1 : 0)) {
|
||||
if (number > (u_type)std::numeric_limits<T>::max() + (negate ? 1 : 0)) {
|
||||
error = IntConvertResult::Overflow;
|
||||
}
|
||||
}
|
||||
|
|
@ -3140,7 +3142,7 @@ public:
|
|||
* @ru @brief Указатель на константный символ после после последнего символа строки.
|
||||
* @return const K* - конец строки.
|
||||
* @en @brief Pointer to a constant character after the last character of the string.
|
||||
* @return const K* - end of line.
|
||||
* @return const K* - end of string.
|
||||
*/
|
||||
constexpr const K* end() const { return d().symbols() + d().length(); }
|
||||
/*!
|
||||
|
|
@ -3154,7 +3156,7 @@ public:
|
|||
* @ru @brief Указатель на константный символ после после последнего символа строки.
|
||||
* @return const K* - конец строки.
|
||||
* @en @brief Pointer to a constant character after the last character of the string.
|
||||
* @return const K* - end of line.
|
||||
* @return const K* - end of string.
|
||||
*/
|
||||
constexpr const K* cend() const { return d().symbols() + d().length(); }
|
||||
};
|
||||
|
|
@ -3182,7 +3184,7 @@ public:
|
|||
* @ru @brief Указатель на константный символ после после последнего символа строки.
|
||||
* @return const K* - конец строки.
|
||||
* @en @brief Pointer to a constant character after the last character of the string.
|
||||
* @return const K* - end of line.
|
||||
* @return const K* - end of string.
|
||||
*/
|
||||
constexpr const K* end() const { return base::end(); }
|
||||
/*!
|
||||
|
|
@ -3196,7 +3198,7 @@ public:
|
|||
* @ru @brief Указатель на константный символ после после последнего символа строки.
|
||||
* @return const K* - конец строки.
|
||||
* @en @brief Pointer to a constant character after the last character of the string.
|
||||
* @return const K* - end of line.
|
||||
* @return const K* - end of string.
|
||||
*/
|
||||
constexpr const K* cend() const { return base::cend(); }
|
||||
/*!
|
||||
|
|
@ -3217,7 +3219,7 @@ public:
|
|||
* @ru @brief Указатель на символ после после последнего символа строки.
|
||||
* @return K* - конец строки.
|
||||
* @en @brief Pointer to the character after the last character of the string.
|
||||
* @return K* - end of line.
|
||||
* @return K* - end of string.
|
||||
*/
|
||||
constexpr K* end() { return d().str() + d().length(); }
|
||||
};
|
||||
|
|
@ -3272,6 +3274,20 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct from_begin {
|
||||
size_t idx_;
|
||||
};
|
||||
struct from_end {
|
||||
size_t idx_;
|
||||
};
|
||||
inline constexpr from_end to_end{0};
|
||||
|
||||
template<typename T>
|
||||
concept first_index_in_str = std::is_same_v<T, from_end> || std::is_convertible_v<T, size_t>;
|
||||
|
||||
template<typename T>
|
||||
concept last_index_in_str = first_index_in_str<T> || std::is_same_v<T, from_begin>;
|
||||
|
||||
/*!
|
||||
* @ru @brief Класс с базовыми константными строковыми алгоритмами.
|
||||
* @details Является базой для классов, могущих выполнять константные операции со строками.
|
||||
|
|
@ -3290,7 +3306,7 @@ public:
|
|||
* only with a pointer to a string and its length.
|
||||
* To work, the descendant class must implement the following methods:
|
||||
* - size_t length() const noexcept - returns the length of the string.
|
||||
* - const K* symbols() const noexcept - returns a pointer to the beginning of the line.
|
||||
* - const K* symbols() const noexcept - returns a pointer to the beginning of the string.
|
||||
* - bool is_empty() const noexcept - checks whether the string is empty.
|
||||
* @tparam K - character type.
|
||||
* @tparam StrRef - storage type for the string chunk.
|
||||
|
|
@ -3428,10 +3444,10 @@ public:
|
|||
* @details Если `from` меньше нуля, то отсчитывается `-from` символов от конца строки в сторону начала.
|
||||
* Если `len` меньше или равно нулю, то отсчитать `-len` символов от конца строки
|
||||
* @en @brief Get part of a string as "str_src".
|
||||
* @param from - number of characters from the beginning of the line.
|
||||
* @param from - number of characters from the beginning of the string.
|
||||
* @param len - the number of characters in the resulting "chunk".
|
||||
* @return Substring, str_src.
|
||||
* @details If `from` is less than zero, then `-from` characters are counted from the end of the line towards the beginning.
|
||||
* @details If `from` is less than zero, then `-from` characters are counted from the end of the string towards the beginning.
|
||||
* If `len` is less than or equal to zero, then count `-len` characters from the end of the line
|
||||
* @~
|
||||
* ```cpp
|
||||
|
|
@ -3443,23 +3459,101 @@ public:
|
|||
* "0123456789"_ss(-4, -1) == "678";
|
||||
* ```
|
||||
*/
|
||||
[[deprecated("Use 'get' or [start, end] in C++23")]]
|
||||
constexpr str_piece operator()(ptrdiff_t from, ptrdiff_t len = 0) const noexcept {
|
||||
size_t myLen = _len(), idxStart = from >= 0 ? from : myLen > -from ? myLen + from : 0,
|
||||
idxEnd = len > 0 ? idxStart + len : myLen > -len ? myLen + len : 0;
|
||||
size_t myLen = _len(), idxStart = from >= 0 ? from : (ptrdiff_t)myLen > -from ? myLen + from : 0,
|
||||
idxEnd = len > 0 ? idxStart + len : (ptrdiff_t)myLen > -len ? myLen + len : 0;
|
||||
if (idxEnd > myLen)
|
||||
idxEnd = myLen;
|
||||
if (idxStart > idxEnd)
|
||||
idxStart = idxEnd;
|
||||
return str_piece{_str() + idxStart, idxEnd - idxStart};
|
||||
}
|
||||
|
||||
/*!
|
||||
* @ru @brief Получить часть строки как "str_src".
|
||||
* @param start - начальная позиция в строке.
|
||||
* @param end - конечная позиция в строке.
|
||||
* @return Подстроку, str_src.
|
||||
* @details В качестве начальной позиции может задаваться или число - отсчитывается от начала строки, но не далее её конца,
|
||||
* или `from_end(число)` - отсчитывается от конца строки, но не ранее её начала.
|
||||
* В качестве конечной позиции может задаваться или число - отсчитывается от начальной позиции, но не далее конца строки,
|
||||
* или `from_end(число)` - отсчитывается от конца строки, но не ранее начальной позиции,
|
||||
* или `from_begin(число)` - отсчитывается от начала строки, но не ранее начальной позиции и не далее конца строки.
|
||||
* Также можно использовать `to_end` - эквивалентно from_end(0).
|
||||
* @en @brief Get part of a string as "str_src".
|
||||
* @param start - starting position in the string.
|
||||
* @param end - the end position in the string.
|
||||
* @return Substring, str_src.
|
||||
* @details Either a number can be specified as the starting position - it is counted from the beginning of the string, but not further than its end,
|
||||
* or `from_end(number)` - counted from the end of the string, but not earlier than its beginning.
|
||||
* The ending position can be either a number - counted from the starting position, but not further than the end of the string,
|
||||
* or `from_end(number)` - counted from the end of the string, but not earlier than the starting position,
|
||||
* or `from_begin(number)` - counted from the beginning of the string, but not earlier than the starting position and not further than the end of the string.
|
||||
* You can also use `to_end` - equivalent to from_end(0).
|
||||
* @~
|
||||
* ```cpp
|
||||
* "0123456789"_ss.get(5, 2) == "56";
|
||||
* "0123456789"_ss.get(5, to_end) == "56789";
|
||||
* "0123456789"_ss.get(5, from_end(1)) == "5678";
|
||||
* "0123456789"_ss.get(from_end(3), to_end) == "789";
|
||||
* "0123456789"_ss.get(from_end(3), 2) == "78";
|
||||
* "0123456789"_ss.get(from_end(4), from_end(1)) == "678";
|
||||
* ```
|
||||
*/
|
||||
template<first_index_in_str S, last_index_in_str E>
|
||||
constexpr str_piece get(S start, E end) const noexcept {
|
||||
size_t idxStart, idxEnd, len = _len();
|
||||
if constexpr (std::is_same_v<S, from_end>) {
|
||||
idxStart = start.idx_ > len ? 0 : len - start.idx_;
|
||||
} else {
|
||||
idxStart = std::min(size_t(start), len);
|
||||
}
|
||||
|
||||
if constexpr (std::is_same_v<E, from_begin>) {
|
||||
idxEnd = std::max(idxStart, std::min(end.idx_, len));
|
||||
} else if constexpr (std::is_same_v<E, from_end>) {
|
||||
idxEnd = std::max(idxStart, end.idx_ > len ? 0 : len - end.idx_);
|
||||
} else {
|
||||
size_t e = end;
|
||||
idxEnd = len - idxStart < e ? len : idxStart + e;
|
||||
}
|
||||
|
||||
return str_piece{_str() + idxStart, idxEnd - idxStart};
|
||||
}
|
||||
|
||||
#if defined(__cpp_multidimensional_subscript) && __cpp_multidimensional_subscript >= 202211L
|
||||
/*!
|
||||
* @ru @brief Обертка вокруг `get` в виде многомерного оператора [].
|
||||
* @en @brief Wraps `get` as a multidimensional operator [].
|
||||
*/
|
||||
template<first_index_in_str S, last_index_in_str E>
|
||||
constexpr str_piece operator[](S start, E end) const noexcept {
|
||||
return get(start, end);
|
||||
}
|
||||
#endif
|
||||
/*!
|
||||
* @ru @brief Обертка вокруг `get(0, count)`.
|
||||
* @en @brief Wraps `get(0, count)`.
|
||||
*/
|
||||
constexpr str_piece prefix(size_t count) const noexcept {
|
||||
return get(0, count);
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Обертка вокруг `get(from_end(count), to_end)`.
|
||||
* @en @brief Wraps `get(from_end(count), to_end)`.
|
||||
*/
|
||||
constexpr str_piece suffix(size_t count) const noexcept {
|
||||
return get(from_end(count), to_end);
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить часть строки как "кусок строки".
|
||||
* @param from - количество символов от начала строки. При превышении размера строки вернёт пустую строку.
|
||||
* @param len - количество символов в получаемом "куске". При выходе за пределы строки вернёт всё до конца строки.
|
||||
* @return Подстроку, str_src.
|
||||
* @en @brief Get part of a string as "string chunk".
|
||||
* @param from - number of characters from the beginning of the line. If the string size is exceeded, it will return an empty string.
|
||||
* @param len - the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the line.
|
||||
* @param from - number of characters from the beginning of the string. If the string size is exceeded, it will return an empty string.
|
||||
* @param len - the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the string.
|
||||
* @return Substring, str_src.
|
||||
*/
|
||||
constexpr str_piece mid(size_t from, size_t len = -1) const noexcept {
|
||||
|
|
@ -3478,8 +3572,8 @@ public:
|
|||
* @param to - конечная позиция (не входит в результат).
|
||||
* @return Подстроку, str_src.
|
||||
* @en @brief Get the substring str_src from position from to position to (not including it).
|
||||
* @details For performance reasons, the method does not check for line boundaries in any way, use
|
||||
* in scenarios when you know for sure that these are positions inside the line and to >= from.
|
||||
* @details For performance reasons, the method does not check for string boundaries in any way, use
|
||||
* in scenarios when you know for sure that these are positions inside the string and to >= from.
|
||||
* @param from - starting position.
|
||||
* @param to - final position (not included in the result).
|
||||
* @return Substring, str_src.
|
||||
|
|
@ -3498,7 +3592,7 @@ public:
|
|||
* @return Substring, str_src.
|
||||
*/
|
||||
constexpr str_piece until(str_piece pattern, size_t offset = 0) const noexcept {
|
||||
return (*this)(0, find_or_all(pattern, offset));
|
||||
return get(0, find_or_all(pattern, offset));
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Проверка на пустоту.
|
||||
|
|
@ -3513,9 +3607,9 @@ public:
|
|||
* @return K - символ.
|
||||
* @details Не производит проверку на выход за границы строки.
|
||||
* @en @brief Get the character at the given position.
|
||||
* @param idx - symbol index. For negative values, it is counted from the end of the line.
|
||||
* @param idx - symbol index. For negative values, it is counted from the end of the string.
|
||||
* @return K - character.
|
||||
* @details Does not check for line boundaries.
|
||||
* @details Does not check for string boundaries.
|
||||
*/
|
||||
constexpr K at(ptrdiff_t idx) const {
|
||||
return _str()[idx >= 0 ? idx : _len() + idx];
|
||||
|
|
@ -3532,7 +3626,7 @@ public:
|
|||
* @param o - другая строка.
|
||||
* @return <0 эта строка меньше, ==0 - строки равны, >0 - эта строка больше.
|
||||
* @en @brief Compare strings character by character.
|
||||
* @param o - another line.
|
||||
* @param o - another string.
|
||||
* @return <0 this string is less, ==0 - strings are equal, >0 - this string is greater.
|
||||
*/
|
||||
constexpr int compare(str_piece o) const {
|
||||
|
|
@ -3543,7 +3637,7 @@ public:
|
|||
* @param text - другая строка.
|
||||
* @return <0 эта строка меньше, ==0 - строки равны, >0 - эта строка больше.
|
||||
* @en @brief Compare with C-string character by character.
|
||||
* @param text - another line.
|
||||
* @param text - another string.
|
||||
* @return <0 this string is less, ==0 - strings are equal, >0 - this string is greater.
|
||||
*/
|
||||
constexpr int strcmp(const K* text) const {
|
||||
|
|
@ -3572,7 +3666,7 @@ public:
|
|||
* @param other - другая строка.
|
||||
* @return равны ли строки.
|
||||
* @en @brief String comparison for equality.
|
||||
* @param other - another line.
|
||||
* @param other - another string.
|
||||
* @return whether the strings are equal.
|
||||
*/
|
||||
constexpr bool equal(str_piece other) const noexcept {
|
||||
|
|
@ -3583,7 +3677,7 @@ public:
|
|||
* @param other - другая строка.
|
||||
* @return равны ли строки.
|
||||
* @en @brief Operator comparing strings for equality.
|
||||
* @param other - another line.
|
||||
* @param other - another string.
|
||||
* @return whether the strings are equal.
|
||||
*/
|
||||
constexpr bool operator==(const base& other) const noexcept {
|
||||
|
|
@ -3593,7 +3687,7 @@ public:
|
|||
* @ru @brief Оператор сравнения строк.
|
||||
* @param other - другая строка.
|
||||
* @en @brief String comparison operator.
|
||||
* @param other - another line.
|
||||
* @param other - another string.
|
||||
*/
|
||||
constexpr auto operator<=>(const base& other) const noexcept {
|
||||
return compare(other._str(), other._len()) <=> 0;
|
||||
|
|
@ -3647,7 +3741,7 @@ public:
|
|||
* @param text - другая строка.
|
||||
* @return <0 эта строка меньше, ==0 - строки равны, >0 - эта строка больше.
|
||||
* @en @brief Compare strings character by character and not case sensitive ASCII characters.
|
||||
* @param text - another line.
|
||||
* @param text - another string.
|
||||
* @return <0 this string is less, ==0 - strings are equal, >0 - this string is greater.
|
||||
*/
|
||||
constexpr int compare_ia(str_piece text) const noexcept { // NOLINT
|
||||
|
|
@ -3659,7 +3753,7 @@ public:
|
|||
* @param text - другая строка.
|
||||
* @return равны ли строки.
|
||||
* @en @brief Whether a string is equal to another string, character-by-character-insensitive, of ASCII characters.
|
||||
* @param text - another line.
|
||||
* @param text - another string.
|
||||
* @return whether the strings are equal.
|
||||
*/
|
||||
constexpr bool equal_ia(str_piece text) const noexcept { // NOLINT
|
||||
|
|
@ -3670,7 +3764,7 @@ public:
|
|||
* @param text - другая строка.
|
||||
* @return меньше ли строка.
|
||||
* @en @brief Whether a string is smaller than another string, character-by-character-insensitive, ASCII characters.
|
||||
* @param text - another line.
|
||||
* @param text - another string.
|
||||
* @return whether the string is smaller.
|
||||
*/
|
||||
constexpr bool less_ia(str_piece text) const noexcept { // NOLINT
|
||||
|
|
@ -3680,7 +3774,7 @@ public:
|
|||
constexpr size_t find(const K* pattern, size_t lenPattern, size_t offset) const noexcept {
|
||||
size_t lenText = _len();
|
||||
// Образец, не вмещающийся в строку и пустой образец не находим
|
||||
// We don't look for an empty line or a line longer than the text.
|
||||
// We don't look for an empty string or a string longer than the text.
|
||||
if (!lenPattern || offset >= lenText || offset + lenPattern > lenText)
|
||||
return str::npos;
|
||||
lenPattern--;
|
||||
|
|
@ -3724,7 +3818,7 @@ public:
|
|||
* @return size_t - the position of the beginning of the substring occurrence, or throws an Exc exception if not found.
|
||||
*/
|
||||
template<typename Exc, typename ... Args> requires std::is_constructible_v<Exc, Args...>
|
||||
constexpr size_t find_or_throw(str_piece pattern, size_t offset = 0, Args&& ... args) const noexcept {
|
||||
constexpr size_t find_or_throw(str_piece pattern, size_t offset = 0, Args&& ... args) const {
|
||||
if (auto fnd = find(pattern.symbols(), pattern.length(), offset); fnd != str::npos) {
|
||||
return fnd;
|
||||
}
|
||||
|
|
@ -3778,7 +3872,7 @@ public:
|
|||
return find_last(pattern[0], offset);
|
||||
size_t lenText = std::min(_len(), offset);
|
||||
// Образец, не вмещающийся в строку и пустой образец не находим
|
||||
// We don't look for an empty line or a line longer than the text.
|
||||
// We don't look for an empty string or a string longer than the text.
|
||||
if (!lenPattern || lenPattern > lenText)
|
||||
return str::npos;
|
||||
|
||||
|
|
@ -4065,21 +4159,26 @@ public:
|
|||
* @param len - количество символов в получаемом "куске". Если меньше или равно нулю, то отсчитать len символов от конца строки.
|
||||
* @return my_type - подстроку, объект того же типа, к которому применён метод.
|
||||
* @en @brief Get a substring. Works similarly to operator(), only the result is the same type as the method applied to.
|
||||
* @param from - number of characters from the beginning of the line. If less than zero, it is counted from the end of the line towards the beginning.
|
||||
* @param len - the number of characters in the resulting "chunk". If less than or equal to zero, then count len characters from the end of the line.
|
||||
* @param from - number of characters from the beginning of the string. If less than zero, it is counted from the end of the string towards the beginning.
|
||||
* @param len - the number of characters in the resulting "chunk". If less than or equal to zero, then count len characters from the end of the string.
|
||||
* @return my_type - a substring, an object of the same type to which the method is applied.
|
||||
*/
|
||||
[[deprecated("Use sub(start, end)")]]
|
||||
constexpr my_type substr(ptrdiff_t from, ptrdiff_t len = 0) const { // индексация в code units | indexing in code units
|
||||
return my_type{d()(from, len)};
|
||||
}
|
||||
template<first_index_in_str S, last_index_in_str E>
|
||||
constexpr my_type sub(S start, E end) const noexcept {
|
||||
return my_type{get(start, end)};
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить часть строки объектом того же типа, к которому применён метод, аналогично mid.
|
||||
* @param from - количество символов от начала строки. При превышении размера строки вернёт пустую строку.
|
||||
* @param len - количество символов в получаемом "куске". При выходе за пределы строки вернёт всё до конца строки.
|
||||
* @return Строку того же типа, к которому применён метод.
|
||||
* @en @brief Get part of a string with an object of the same type to which the method is applied, similar to mid.
|
||||
* @param from - number of characters from the beginning of the line. If the string size is exceeded, it will return an empty string.
|
||||
* @param len - the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the line.
|
||||
* @param from - number of characters from the beginning of the string. If the string size is exceeded, it will return an empty string.
|
||||
* @param len - the number of characters in the resulting "chunk". When going beyond the line, it will return everything up to the end of the string.
|
||||
* @return A string of the same type to which the method is applied.
|
||||
*/
|
||||
constexpr my_type str_mid(size_t from, size_t len = -1) const { // индексация в code units | indexing in code units
|
||||
|
|
@ -4109,7 +4208,7 @@ public:
|
|||
* - 0[bB]: 2
|
||||
* - 0[xX]: 16
|
||||
* - in other cases 10.
|
||||
* @tparam SkipWs - skip whitespace characters at the beginning of the line.
|
||||
* @tparam SkipWs - skip whitespace characters at the beginning of the string.
|
||||
* @tparam AllowSign - whether the '+' sign is allowed before a number.
|
||||
* @return T - a number, the result of the transformation, how much it turned out, or 0 if it overflows.
|
||||
*/
|
||||
|
|
@ -4142,7 +4241,7 @@ public:
|
|||
* - 0[bB]: 2
|
||||
* - 0[xX]: 16
|
||||
* - in other cases 10.
|
||||
* @tparam SkipWs - skip whitespace characters at the beginning of the line. All characters with ASCII codes <= 32 are skipped.
|
||||
* @tparam SkipWs - skip whitespace characters at the beginning of the string. All characters with ASCII codes <= 32 are skipped.
|
||||
* @tparam AllowSign - whether the '+' sign is allowed before a number.
|
||||
* @return convert_result<T> - a tuple of the received number, the success of the conversion and the number of characters processed.
|
||||
*/
|
||||
|
|
@ -4156,7 +4255,9 @@ public:
|
|||
* @en @brief Convert string to double.
|
||||
* @return std::optional<double>.
|
||||
*/
|
||||
template<bool SkipWS = true, bool AllowPlus = true> requires (sizeof(K) == 1)
|
||||
template<bool SkipWS = true, bool AllowPlus = true>
|
||||
requires(sizeof(K) == 1 &&
|
||||
requires { std::from_chars(std::declval<K*>(), std::declval<K*>(), std::declval<double&>()); })
|
||||
std::optional<double> to_double() const noexcept {
|
||||
size_t len = _len();
|
||||
const K* ptr = _str();
|
||||
|
|
@ -4175,9 +4276,11 @@ public:
|
|||
if (!len) {
|
||||
return {};
|
||||
}
|
||||
double d{};
|
||||
if (std::from_chars((const u8s*)ptr, (const u8s*)ptr + len, d).ec == std::errc{}) {
|
||||
return d;
|
||||
if constexpr (requires { std::from_chars(std::declval<K*>(), std::declval<K*>(), std::declval<double&>()); }) {
|
||||
double d{};
|
||||
if (std::from_chars((const K*)ptr, (const K*)ptr + len, d).ec == std::errc{}) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
@ -4187,7 +4290,9 @@ public:
|
|||
* @en @brief Convert string in hex form to double.
|
||||
* @return std::optional<double>.
|
||||
*/
|
||||
template<bool SkipWS = true> requires (sizeof(K) == 1)
|
||||
template<bool SkipWS = true>
|
||||
requires(sizeof(K) == 1 &&
|
||||
requires { std::from_chars(std::declval<K*>(), std::declval<K*>(), std::declval<double&>()); })
|
||||
std::optional<double> to_double_hex() const noexcept {
|
||||
size_t len = _len();
|
||||
const K* ptr = _str();
|
||||
|
|
@ -4198,9 +4303,11 @@ public:
|
|||
}
|
||||
}
|
||||
if (len) {
|
||||
double d{};
|
||||
if (std::from_chars(ptr, ptr + len, d, std::chars_format::hex).ec == std::errc{}) {
|
||||
return d;
|
||||
if constexpr (requires { std::from_chars(std::declval<K*>(), std::declval<K*>(), std::declval<double&>()); }) {
|
||||
double d{};
|
||||
if (std::from_chars((const K*)ptr, (const K*)ptr + len, d, std::chars_format::hex).ec == std::errc{}) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
|
@ -4223,7 +4330,7 @@ public:
|
|||
size_t mylen = _len();
|
||||
std::conditional_t<std::is_same_v<T, void>, char, T> results;
|
||||
str_piece me{_str(), mylen};
|
||||
for (int i = 0;; i++) {
|
||||
for (size_t i = 0;; i++) {
|
||||
size_t beginOfDelim = find(delimiter, lendelimiter, offset);
|
||||
if (beginOfDelim == str::npos) {
|
||||
str_piece last{me.symbols() + offset, me.length() - offset};
|
||||
|
|
@ -4345,6 +4452,36 @@ public:
|
|||
constexpr bool starts_with(str_piece prefix) const noexcept {
|
||||
return starts_with(prefix.symbols(), prefix.length());
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Проверить, начинается ли строка с указанной подстроки, за которой следует ней пробельный ASCII символ.
|
||||
* @param prefix - проверяемая подстрока.
|
||||
* @en @brief Check if a string begins with the specified substring followed by a whitespace ASCII character.
|
||||
* @param prefix - substring to be checked.
|
||||
*/
|
||||
constexpr bool starts_with_and_ws(str_piece prefix) const noexcept {
|
||||
return _len() > prefix.length() &&
|
||||
starts_with(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, size_t(-1), true>{}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Проверить, начинается ли строка с указанной подстроки, за которой следует один из указанных символов.
|
||||
* @param prefix - проверяемая подстрока.
|
||||
* @param next_symbol - проверяемые после подстроки символы.
|
||||
* @en @brief Check if a string begins with the specified substring followed by one of the specified characters.
|
||||
* @param prefix - substring to be checked.
|
||||
* @param next_symbol - symbols to be checked after the substring.
|
||||
*/
|
||||
constexpr bool starts_with_and_oneof(str_piece prefix, str_piece next_symbol) const noexcept {
|
||||
return _len() > prefix.length() &&
|
||||
starts_with(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, 0, false>{next_symbol}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
template<typename T, size_t N = const_lit_for<K, T>::Count, StrType<K> From> requires is_const_pattern<N>
|
||||
constexpr bool starts_with_and_oneof(str_piece prefix, T&& next_symbol) const noexcept {
|
||||
return _len() >= N &&
|
||||
starts_with(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, N - 1, false>{next_symbol}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
|
||||
constexpr bool starts_with_ia(const K* prefix, size_t len) const noexcept {
|
||||
size_t myLen = _len();
|
||||
|
|
@ -4370,6 +4507,36 @@ public:
|
|||
constexpr bool starts_with_ia(str_piece prefix) const noexcept {
|
||||
return starts_with_ia(prefix.symbols(), prefix.length());
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Проверить, начинается ли строка с указанной подстроки без учета регистра ASCII, за которой следует ней пробельный ASCII символ.
|
||||
* @param prefix - проверяемая подстрока.
|
||||
* @en @brief Check if a string begins with the specified case-insensitive ASCII substring followed by a whitespace ASCII character.
|
||||
* @param prefix - substring to be checked.
|
||||
*/
|
||||
constexpr bool starts_with_ia_and_ws(str_piece prefix) const noexcept {
|
||||
return _len() > prefix.length() &&
|
||||
starts_with_ia(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, size_t(-1), true>{}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Проверить, начинается ли строка с указанной подстроки без учета регистра ASCII, за которой следует один из указанных символов.
|
||||
* @param prefix - проверяемая подстрока.
|
||||
* @param next_symbol - проверяемые после подстроки символы.
|
||||
* @en @brief Check if a string begins with the specified case-insensitive ASCII substring followed by one of the specified characters.
|
||||
* @param prefix - substring to be checked.
|
||||
* @param next_symbol - symbols to be checked after the substring.
|
||||
*/
|
||||
constexpr bool starts_with_ia_and_oneof(str_piece prefix, str_piece next_symbol) const noexcept {
|
||||
return _len() > prefix.length() &&
|
||||
starts_with_ia(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, 0, false>{next_symbol}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
template<typename T, size_t N = const_lit_for<K, T>::Count, StrType<K> From> requires is_const_pattern<N>
|
||||
constexpr bool starts_with_ia_and_oneof(str_piece prefix, T&& next_symbol) const noexcept {
|
||||
return _len() >= N &&
|
||||
starts_with_ia(prefix) &&
|
||||
trim_operator<TrimSides::TrimLeft, K, N - 1, false>{next_symbol}.isTrim(_str()[prefix.length()]);
|
||||
}
|
||||
|
||||
// Является ли эта строка началом указанной строки
|
||||
// Is this string the beginning of the specified string
|
||||
|
|
@ -4512,6 +4679,82 @@ public:
|
|||
R replaced(str_piece pattern, str_piece repl, size_t offset = 0, size_t maxCount = 0) const {
|
||||
return R::replaced_from(d(), pattern, repl, offset, maxCount);
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить строку без префикса, если она начинается с него.
|
||||
* @tparam R - желаемый тип строкового объекта, по умолчанию str_piece.
|
||||
* @param prefix - искомый префикс.
|
||||
* @return constexpr std::optional<R> - если строка начинается с указанного префикса, возвращает часть строки без этого префикса,
|
||||
* иначе пустое значение.
|
||||
* @en @brief Get a string without a prefix if it starts with one.
|
||||
* @tparam R - the desired type of string object, defaults to str_piece.
|
||||
* @param prefix - the prefix to search for.
|
||||
* @return constexpr std::optional<R> - if the string begins with the specified prefix, returns the part of the string without this prefix,
|
||||
* otherwise empty value.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr std::optional<R> strip_prefix(str_piece prefix) const {
|
||||
if (starts_with(prefix)) {
|
||||
return R{get(prefix.length(), to_end)};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить строку без префикса, если она начинается с него без учёта регистра ASCII символов.
|
||||
* @tparam R - желаемый тип строкового объекта, по умолчанию str_piece.
|
||||
* @param prefix - искомый префикс.
|
||||
* @return constexpr std::optional<R> - если строка начинается с указанного префикса без учёта регистра ASCII символов,
|
||||
* возвращает часть строки без этого префикса, иначе пустое значение.
|
||||
* @en @brief Get a string without a prefix if it starts with it, insensitive to ASCII characters.
|
||||
* @tparam R - the desired type of string object, defaults to str_piece.
|
||||
* @param prefix - the prefix to search for.
|
||||
* @return constexpr std::optional<R> - if the string begins with the specified prefix, insensitive to ASCII characters,
|
||||
* returns the part of the string without this prefix, otherwise empty.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr std::optional<R> strip_prefix_ia(str_piece prefix) const {
|
||||
if (starts_with_ia(prefix)) {
|
||||
return R{get(prefix.length(), to_end)};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить строку без суффикса, если она заканчивается им.
|
||||
* @tparam R - желаемый тип строкового объекта, по умолчанию str_piece.
|
||||
* @param suffix - искомый суффикс.
|
||||
* @return constexpr std::optional<R> - если строка заканчивается указанным суффиксом, возвращает часть строки без него,
|
||||
* иначе пустое значение.
|
||||
* @en @brief Get a string without a suffix if it ends with one.
|
||||
* @tparam R - the desired type of string object, defaults to str_piece.
|
||||
* @param suffix - the suffix you are looking for.
|
||||
* @return constexpr std::optional<R> - if the string ends with the specified suffix, returns the part of the string without it,
|
||||
* otherwise empty value.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr std::optional<R> strip_suffix(str_piece suffix) const {
|
||||
if (ends_with(suffix)) {
|
||||
return R{get(0, from_end{suffix.length()})};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить строку без суффикса, если она заканчивается им без учёта регистра ASCII символов.
|
||||
* @tparam R - желаемый тип строкового объекта, по умолчанию str_piece.
|
||||
* @param suffix - искомый суффикс.
|
||||
* @return constexpr std::optional<R> - если строка заканчивается указанным суффиксом без учёта регистра ASCII символов,
|
||||
* возвращает часть строки без него, иначе пустое значение.
|
||||
* @en @brief Get a string without a suffix if it ends with one in case-insensitive ASCII characters.
|
||||
* @tparam R - the desired type of string object, defaults to str_piece.
|
||||
* @param suffix - the suffix you are looking for.
|
||||
* @return constexpr std::optional<R> - if the string ends with the specified suffix, insensitive to ASCII characters,
|
||||
* returns part of the string without it, otherwise empty.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr std::optional<R> strip_suffix_ia(str_piece suffix) const {
|
||||
if (ends_with_ia(suffix)) {
|
||||
return R{get(0, from_end{suffix.length()})};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
template<StrType<K> From>
|
||||
constexpr static my_type make_trim_op(const From& from, const auto& opTrim) {
|
||||
|
|
@ -4558,7 +4801,7 @@ public:
|
|||
* @return R - a string with leading whitespace characters removed.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_left() const {
|
||||
constexpr R trimmed_left() const {
|
||||
return R::template trim_static<TrimSides::TrimLeft>(d());
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4570,7 +4813,7 @@ public:
|
|||
* @return R - a string with whitespace characters removed at the end.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_right() const {
|
||||
constexpr R trimmed_right() const {
|
||||
return R::template trim_static<TrimSides::TrimRight>(d());
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4585,7 +4828,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed(T&& pattern) const {
|
||||
constexpr R trimmed(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimAll, false>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4600,7 +4843,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed_left(T&& pattern) const {
|
||||
constexpr R trimmed_left(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimLeft, false>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4615,7 +4858,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed_right(T&& pattern) const {
|
||||
constexpr R trimmed_right(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimRight, false>(d(), pattern);
|
||||
}
|
||||
// Триминг по символам в литерале и пробелам
|
||||
|
|
@ -4637,7 +4880,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed_with_spaces(T&& pattern) const {
|
||||
constexpr R trimmed_with_spaces(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimAll, true>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4656,7 +4899,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed_left_with_spaces(T&& pattern) const {
|
||||
constexpr R trimmed_left_with_spaces(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimLeft, true>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4675,7 +4918,7 @@ public:
|
|||
*/
|
||||
template<typename R = str_piece, typename T, size_t N = const_lit_for<K, T>::Count>
|
||||
requires is_const_pattern<N>
|
||||
R trimmed_right_with_spaces(T&& pattern) const {
|
||||
constexpr R trimmed_right_with_spaces(T&& pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimRight, true>(d(), pattern);
|
||||
}
|
||||
// Триминг по динамическому источнику
|
||||
|
|
@ -4692,7 +4935,7 @@ public:
|
|||
* @return R - a string with the characters contained in the pattern removed at the beginning and at the end.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed(str_piece pattern) const {
|
||||
constexpr R trimmed(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimAll, false>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4706,7 +4949,7 @@ public:
|
|||
* @return R - a string with the characters contained in the pattern removed at the beginning.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_left(str_piece pattern) const {
|
||||
constexpr R trimmed_left(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimLeft, false>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4720,7 +4963,7 @@ public:
|
|||
* @return R - a string with characters contained in the pattern removed at the end.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_right(str_piece pattern) const {
|
||||
constexpr R trimmed_right(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimRight, false>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4738,7 +4981,7 @@ public:
|
|||
* and whitespace characters.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_with_spaces(str_piece pattern) const {
|
||||
constexpr R trimmed_with_spaces(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimAll, true>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4756,7 +4999,7 @@ public:
|
|||
* and whitespace characters.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_left_with_spaces(str_piece pattern) const {
|
||||
constexpr R trimmed_left_with_spaces(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimLeft, true>(d(), pattern);
|
||||
}
|
||||
/*!
|
||||
|
|
@ -4774,10 +5017,95 @@ public:
|
|||
* and whitespace characters.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
R trimmed_right_with_spaces(str_piece pattern) const {
|
||||
constexpr R trimmed_right_with_spaces(str_piece pattern) const {
|
||||
return R::template trim_static<TrimSides::TrimRight, true>(d(), pattern);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @ru @brief Возвращает строку, в которой удалено начало строки, если она начинается с указанного префикса.
|
||||
* @tparam R - желаемый тип строки, по умолчанию str_src.
|
||||
* @param prefix - искомый префикс.
|
||||
* @param max_count - до сколько раз можно удалять префикс, 0 - без ограничений.
|
||||
* @return R - Копию строки, в которой удалено начало, если она начинается с этого префикса.
|
||||
* @en @brief Returns a string with the beginning of the string removed if it begins with the specified prefix.
|
||||
* @tparam R - desired string type, default str_src.
|
||||
* @param prefix - the prefix to search for.
|
||||
* @param max_count - up to how many times a prefix can be removed, 0 - no restrictions.
|
||||
* @return R - A copy of the string with the beginning removed, if it starts with this prefix.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr R trimmed_prefix(str_piece prefix, size_t max_count = 0) const {
|
||||
str_piece res = *this;
|
||||
while(res.starts_with(prefix)) {
|
||||
res.remove_prefix(prefix.length());
|
||||
if (--max_count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Возвращает строку, в которой удалено начало строки, если она начинается с указанного префикса без учёта регистра ASCII символов.
|
||||
* @tparam R - желаемый тип строки, по умолчанию str_src.
|
||||
* @param prefix - искомый префикс.
|
||||
* @param max_count - до сколько раз можно удалять префикс, 0 - без ограничений.
|
||||
* @return R - Копию строки, в которой удалено начало, если она начинается с этого префикса без учёта регистра ASCII символов.
|
||||
* @en @brief Returns a string with the beginning of the string removed if it begins with the specified prefix, insensitive to ASCII characters.
|
||||
* @tparam R - desired string type, default str_src.
|
||||
* @param prefix - the prefix to search for.
|
||||
* @param max_count - up to how many times a prefix can be removed, 0 - no restrictions.
|
||||
* @return R - A copy of the string with the beginning removed if it starts with this prefix, insensitive to ASCII characters.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr R trimmed_prefix_ia(str_piece prefix, size_t max_count = 0) const {
|
||||
str_piece res = *this;
|
||||
while(res.starts_with_ia(prefix)) {
|
||||
res.remove_prefix(prefix.length());
|
||||
if (--max_count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Возвращает строку, в которой удалён конец строки, если она заканчивается указанным суффиксом.
|
||||
* @tparam R - желаемый тип строки, по умолчанию str_src.
|
||||
* @param suffix - искомый суффикс.
|
||||
* @param max_count - до сколько раз можно удалять суффикс, 0 - без ограничений.
|
||||
* @return R - Копию строки, в которой удалён конец, если она заканчивается этим суффиксом.
|
||||
* @en @brief Returns a string with the beginning of the string removed if it begins with the specified prefix.
|
||||
* @tparam R - desired string type, default str_src.
|
||||
* @param suffix - the prefix to search for.
|
||||
* @param max_count - up to how many times a suffix can be removed, 0 - no restrictions.
|
||||
* @return R - A copy of the string with the beginning removed, if it starts with this prefix.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr R trimmed_suffix(str_piece suffix) const {
|
||||
str_piece res = *this;
|
||||
while(res.ends_with(suffix)) {
|
||||
res.remove_suffix(suffix.length());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Возвращает строку, в которой удалён конец строки, если она заканчивается указанным суффиксом без учёта регистра ASCII символов.
|
||||
* @tparam R - желаемый тип строки, по умолчанию str_src.
|
||||
* @param suffix - искомый суффикс.
|
||||
* @param max_count - до сколько раз можно удалять суффикс, 0 - без ограничений.
|
||||
* @return R - Копию строки, в которой удалён конец, если она заканчивается этим суффиксом без учёта регистра ASCII символов.
|
||||
* @en @brief Returns a string with the end of the string removed if it ends with the specified suffix, insensitive to ASCII characters.
|
||||
* @tparam R - desired string type, default str_src.
|
||||
* @param suffix - the suffix you are looking for.
|
||||
* @param max_count - up to how many times a suffix can be removed, 0 - no restrictions.
|
||||
* @return R - A copy of the string with the end removed if it ends with this suffix, insensitive to ASCII characters.
|
||||
*/
|
||||
template<typename R = str_piece>
|
||||
constexpr R trimmed_suffix_ia(str_piece suffix) const {
|
||||
str_piece res = *this;
|
||||
while(res.ends_with_ia(suffix)) {
|
||||
res.remove_suffix(suffix.length());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/*!
|
||||
* @ru @brief Получить объект `Splitter` по заданному разделителю, который позволяет последовательно
|
||||
* получать подстроки методом `next()`, пока `is_done()` false.
|
||||
|
|
@ -4913,7 +5241,7 @@ struct str_src : str_src_algs<K, str_src<K>, str_src<K>, false> {
|
|||
* @ru @brief Сдвигает начало строки на заданное количество символов.
|
||||
* @param delta - количество символов.
|
||||
* @return my_type&.
|
||||
* @en @brief Shifts the start of a line by the specified number of characters.
|
||||
* @en @brief Shifts the start of a string by the specified number of characters.
|
||||
* @param delta - number of characters.
|
||||
* @return my_type&.
|
||||
*/
|
||||
|
|
@ -5019,7 +5347,7 @@ struct str_src_nt : str_src<K>, null_terminated<K, str_src_nt<K>> {
|
|||
* @param from - на сколько символов сдвинуть начало строки.
|
||||
* @return my_type.
|
||||
* @en @brief Get a null-terminated string by shifting the start by the specified number of characters.
|
||||
* @param from - by how many characters to shift the beginning of the line.
|
||||
* @param from - by how many characters to shift the beginning of the string.
|
||||
* @return my_type.
|
||||
*/
|
||||
constexpr my_type to_nts(size_t from) {
|
||||
|
|
@ -5374,7 +5702,7 @@ struct expr_replaces : expr_to_std_string<expr_replaces<K, N, L>> {
|
|||
}
|
||||
if (matches_.added_ == 0) {
|
||||
return what.place(ptr);
|
||||
} else if (matches_.added_ == -1) {
|
||||
} else if (matches_.added_ == size_t(-1)) {
|
||||
// after replaces text become empty
|
||||
return ptr;
|
||||
}
|
||||
|
|
@ -6768,7 +7096,7 @@ std::basic_string<K, std::char_traits<K>, A>& change(std::basic_string<K, std::c
|
|||
if (from > str_length) {
|
||||
from = str_length;
|
||||
}
|
||||
if (from + count > str_length) {
|
||||
if (count > str_length || from + count > str_length) {
|
||||
count = str_length - from;
|
||||
}
|
||||
size_t new_length = str_length - count + expr_length;
|
||||
|
|
@ -7007,7 +7335,7 @@ struct replace_grow_helper {
|
|||
total_length = end_of_piece + all_delta;
|
||||
my_type* dst_str{};
|
||||
if (total_length <= str.capacity()) {
|
||||
// Строка поместится в старое место | The line will be placed in the old location.
|
||||
// Строка поместится в старое место | The string will be placed in the old location.
|
||||
dst_str = &str;
|
||||
} else {
|
||||
// Будем создавать в другом буфере | We will create in another buffer.
|
||||
|
|
@ -7221,7 +7549,7 @@ std::basic_string<K, std::char_traits<K>, A>& replace(std::basic_string<K, std::
|
|||
* @ru @brief Изменить строчные ASCII символы строки (a-z) на прописные.
|
||||
* @param str - стандартная строка
|
||||
* @param from - позиция начала замены, по умолчанию 0.
|
||||
* @param to - по какую позицию (не включительно) заменять (по умолчанию до каонца строки).
|
||||
* @param to - по какую позицию (не включительно) заменять (по умолчанию до конца строки).
|
||||
* @return переданную строку
|
||||
* @en @brief Change lowercase ASCII string characters (a-z) to uppercase.
|
||||
* @param str - standard string
|
||||
|
|
@ -7244,7 +7572,7 @@ std::basic_string<K, std::char_traits<K>, A>& make_ascii_upper(std::basic_string
|
|||
* @ru @brief Изменить прописные ASCII символы строки (A-Z) на строчные.
|
||||
* @param str - стандартная строка
|
||||
* @param from - позиция начала замены, по умолчанию 0.
|
||||
* @param to - по какую позицию (не включительно) заменять (по умолчанию до каонца строки).
|
||||
* @param to - по какую позицию (не включительно) заменять (по умолчанию до конца строки).
|
||||
* @return переданную строку
|
||||
* @en @brief Change uppercase ASCII string characters (A-Z) to lowercase.
|
||||
* @param str - standard string
|
||||
|
|
@ -7267,6 +7595,10 @@ std::basic_string<K, std::char_traits<K>, A>& make_ascii_lower(std::basic_string
|
|||
|
||||
} // namespace simstr
|
||||
|
||||
/*!
|
||||
* @ru @brief Некоторые методы для работы с стандартными строками.
|
||||
* @en @brief Some methods for working with standard strings.
|
||||
*/
|
||||
namespace std {
|
||||
/*!
|
||||
* @ingroup StrExprs
|
||||
|
|
@ -7293,7 +7625,7 @@ simstr::expr_stdstr<typename T::value_type, T> operator+(const T& str) {
|
|||
}
|
||||
|
||||
/*!
|
||||
* @brief Оператор для добавления строкового выражения к стандартной строке.
|
||||
* @ru @brief Оператор для добавления строкового выражения к стандартной строке.
|
||||
* @tparam K - тип символов.
|
||||
* @tparam A - тип аллокатора.
|
||||
* @tparam E - тип строкового выражения.
|
||||
|
|
@ -7318,7 +7650,6 @@ simstr::expr_stdstr<typename T::value_type, T> operator+(const T& str) {
|
|||
* Before C++23, resize was used; since C++23, resize_and_overwrite was used.
|
||||
*
|
||||
* IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!
|
||||
*
|
||||
*/
|
||||
template<typename K, typename A, simstr::StrExprForType<K> E>
|
||||
std::basic_string<K, std::char_traits<K>, A>& operator |=(std::basic_string<K, std::char_traits<K>, A>& str, const E& expr) {
|
||||
|
|
@ -7351,7 +7682,6 @@ std::basic_string<K, std::char_traits<K>, A>& operator |=(std::basic_string<K, s
|
|||
* Before C++23, resize was used; since C++23, resize_and_overwrite was used.
|
||||
*
|
||||
* IMPORTANT!!! Parts of a string expression must not reference the string itself, otherwise the result is undefined!!!
|
||||
*
|
||||
*/
|
||||
template<typename K, typename A, simstr::StrExprForType<K> E>
|
||||
std::basic_string<K, std::char_traits<K>, A>& operator ^=(std::basic_string<K, std::char_traits<K>, A>& str, const E& expr) {
|
||||
|
|
|
|||
15
readme.md
15
readme.md
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
[](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
|
||||
|
||||
Version 1.7.0.
|
||||
Version 1.9.1
|
||||
|
||||
<h2>Speed up your work with strings by 2-10 times!</h2>
|
||||
|
||||
|
|
@ -76,13 +76,14 @@ When using only `#include "simstr/strexpr.h"`:
|
|||
- str::replace - replaces occurrences of the search substring with a replacement string or string expression.
|
||||
If the substring is not found, the string expression is not even evaluated.
|
||||
- str::make_ascii_upper, str::make_ascii_lower - change the case of ASCII characters.
|
||||
- Parsing integers with the possibility of "fine" tuning at compile time - you can set options for checking overflow,
|
||||
skipping whitespace characters, a specific radix or auto-selection by prefixes `0x`, `0`, `0b`, `0o`,
|
||||
the admissibility of the `+` sign. Parsing is implemented for all types of strings and characters.
|
||||
- Parsing double for `char` and `wchar_t`, as well as character types compatible with them in size.
|
||||
- Parsing of integers from a "piece of string" (does not require null termination) with the possibility of "fine" tuning during compilation -
|
||||
you can set options for checking for overflow, skipping whitespace characters, a specific radix, or auto-select by
|
||||
prefixes `0x`, `0`, `0b`, `0o`, the `+` sign is allowed. Parsing is implemented for all types of strings and characters.
|
||||
- Parsing double from a "piece of string" for `char` and `char8_t`.
|
||||
|
||||
When using the full version of the library:
|
||||
- Everything that is listed above, plus
|
||||
- Parsing double from a "piece of string" for all types of characters.
|
||||
- Additional efficient string objects - `sstring` (shared string), `lstring` (local string).
|
||||
- `lstring` - supports many mutable operations with strings - various replacements, insertions, deletions, etc.
|
||||
Allows you to set the size for the internal character buffer, which can turn *Small String Optimization* into *Big String Optimization* :).
|
||||
|
|
@ -324,8 +325,8 @@ function(add_simstr)
|
|||
simstr
|
||||
GIT_REPOSITORY https://github.com/orefkov/simstr.git
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_TAG tags/rel1.7.0 # Specify the desired release
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.7.0
|
||||
GIT_TAG tags/rel1.9.1# Specify the desired release
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.9.1
|
||||
)
|
||||
FetchContent_MakeAvailable(simstr)
|
||||
endfunction()
|
||||
|
|
|
|||
15
readme_ru.md
15
readme_ru.md
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
[](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
|
||||
|
||||
Версия 1.7.0.
|
||||
Версия 1.9.1
|
||||
|
||||
<h2>Ускорь работу со строками в 2-10 раз!</h2>
|
||||
|
||||
|
|
@ -77,13 +77,14 @@
|
|||
- str::replace - заменяет вхождения искомой подстроки на строку замены или строковое выражение.
|
||||
Если подстрока не найдена, строковое выражение даже не вычисляется.
|
||||
- str::make_ascii_upper, str::make_ascii_lower - смена регистра ASCII символов.
|
||||
- Парсинг целых чисел с возможностью "тонкой" настройки при компиляции - можно задавать опции проверки переполнения,
|
||||
пропуск пробельных символов, конкретное основание счисления либо автовыбор по префиксам `0x`, `0`, `0b`, `0o`,
|
||||
допустимость знака `+`. Парсинг реализован для всех видов строк и символов.
|
||||
- Парсинг double для `char` и `wchar_t`, а также совместимых с ними по размеру типов символов.
|
||||
- Парсинг целых чисел из "куска строки" (не требует нуль-терминированности) с возможностью "тонкой" настройки при компиляции -
|
||||
можно задавать опции проверки переполнения, пропуск пробельных символов, конкретное основание счисления либо автовыбор по
|
||||
префиксам `0x`, `0`, `0b`, `0o`, допустимость знака `+`. Парсинг реализован для всех видов строк и символов.
|
||||
- Парсинг double из "куска строки" для `char` и `char8_t`.
|
||||
|
||||
При использовании полной версии библиотеки:
|
||||
- Всё то же, что и перечислено выше, плюс
|
||||
- Парсинг double из "куска строки" для всех типов символов.
|
||||
- Дополнительные эффективные строковые объекты - `sstring` (shared string), `lstring` (local string).
|
||||
- `lstring` - поддерживает множество мутабельных операций со строками - различные замены, вставки, удаления и т.п.
|
||||
Позволяет задавать размер для внутреннего буфера символов, что может превращать *Small String Optimization* в *Big String Optimization* :).
|
||||
|
|
@ -325,8 +326,8 @@ function(add_simstr)
|
|||
simstr
|
||||
GIT_REPOSITORY https://github.com/orefkov/simstr.git
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_TAG tags/rel1.7.0 # Укажите нужный релиз
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.7.0
|
||||
GIT_TAG tags/rel1.9.1# Укажите нужный релиз
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.9.1
|
||||
)
|
||||
FetchContent_MakeAvailable(simstr)
|
||||
endfunction()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Реализация строковых функций
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
@ -250,7 +250,7 @@ size_t utf8_case_change(const u8s*& src, size_t len, u8s*& dest, size_t lenBuffe
|
|||
// то есть если символ считан, и длина записываемого символа не больше считанного, то он поместится в буфер записи
|
||||
// и не перетрет символы, которые еще не прочитали
|
||||
// По другому работать откажемся
|
||||
if (lenBuffer < len || (dest > src && dest < src + len))
|
||||
if (dest > src && dest < src + len)
|
||||
return len;
|
||||
const uu8s *beginReadPos = reinterpret_cast<const uu8s*>(src), *readPos = beginReadPos, *endReadPos = beginReadPos + len,
|
||||
*readFromPos = readPos;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
@ -427,4 +427,47 @@ TEST(StrExpr, ChangeCase) {
|
|||
EXPECT_EQ(ures, u"/teST/");
|
||||
}
|
||||
|
||||
TEST(StrExpr, StripPrefixSuffix) {
|
||||
const ssa from = "begin--end";
|
||||
EXPECT_EQ(*from.strip_prefix("begin"), "--end");
|
||||
EXPECT_FALSE(from.strip_prefix("sd").has_value());
|
||||
EXPECT_EQ(*from.strip_suffix_ia("End"), "begin--");
|
||||
EXPECT_FALSE(from.strip_suffix("sd").has_value());
|
||||
}
|
||||
|
||||
TEST(StrExpr, TrimPrefixSuffix) {
|
||||
const ssa from = "beginbegin--end";
|
||||
EXPECT_EQ(from.trimmed_prefix("begin"), "--end");
|
||||
EXPECT_EQ(from.trimmed_prefix("begin", 1), "begin--end");
|
||||
EXPECT_EQ(from.trimmed_prefix("sd"), from);
|
||||
EXPECT_EQ(from.trimmed_suffix_ia("End"), "beginbegin--");
|
||||
EXPECT_EQ(from.trimmed_suffix("sd"), from);
|
||||
}
|
||||
|
||||
TEST(StrExpr, StartWithAnd) {
|
||||
EXPECT_TRUE("begin --end"_ss.starts_with_and_ws("begin"));
|
||||
EXPECT_FALSE("beginn --end"_ss.starts_with_and_ws("begin"));
|
||||
EXPECT_TRUE("BegiN\t--end"_ss.starts_with_ia_and_ws("begin"_ss));
|
||||
EXPECT_TRUE("begin[ --end"_ss.starts_with_and_oneof("begin", "/*[]"));
|
||||
EXPECT_TRUE("Begin[ --end"_ss.starts_with_ia_and_oneof("begin", "/*[]"_ss));
|
||||
}
|
||||
|
||||
TEST(SimStr, Get) {
|
||||
ssa testa{"test"};
|
||||
EXPECT_EQ(testa.get(1, to_end), "est");
|
||||
EXPECT_EQ(testa.get(1, 2), "es");
|
||||
EXPECT_EQ(testa.get(1, from_end(1)), "es");
|
||||
EXPECT_EQ(testa.get(1, from_end(10)), "");
|
||||
EXPECT_EQ(testa.get(from_end(3), from_end(1)), "es");
|
||||
|
||||
ssu testu{u"test"};
|
||||
EXPECT_EQ(testu.get(1, to_end), u"est");
|
||||
EXPECT_EQ(testu.get(1, 2), u"es");
|
||||
EXPECT_EQ(testu.get(from_end(3), from_end(1)), u"es");
|
||||
|
||||
ssw testw{L"test"};
|
||||
EXPECT_EQ(testw.get(1, to_end), L"est");
|
||||
EXPECT_EQ(testw.get(1, 2), L"es");
|
||||
EXPECT_EQ(testw.get(from_end(3), from_end(1)), L"es");
|
||||
}
|
||||
} // namespace simstr::tests
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
@ -24,6 +24,9 @@ public:
|
|||
size_t sharedCount() const {
|
||||
return type_ == Shared ? SharedStringData<u8s>::from_str(sstr_)->ref_.load() : 0u;
|
||||
}
|
||||
size_t sharedCountForce() const {
|
||||
return SharedStringData<u8s>::from_str(sstr_)->ref_.load();
|
||||
}
|
||||
};
|
||||
|
||||
TEST(SimStr, CreateSimpleEmpty) {
|
||||
|
|
@ -271,6 +274,7 @@ TEST(SimStr, SimpleFind) {
|
|||
EXPECT_EQ("abccccc"_ss.find_last("ab"), 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
TEST(SimStr, SubPiece) {
|
||||
ssa testa{"test"};
|
||||
EXPECT_EQ(testa(1), "est");
|
||||
|
|
@ -286,39 +290,83 @@ TEST(SimStr, SubPiece) {
|
|||
EXPECT_EQ(testw(1), L"est");
|
||||
EXPECT_EQ(testw(1, 2), L"es");
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(SimStr, Get) {
|
||||
ssa testa{"test"};
|
||||
EXPECT_EQ(testa.get(1, to_end), "est");
|
||||
EXPECT_EQ(testa.get(1, 2), "es");
|
||||
EXPECT_EQ(testa.get(1, from_end(1)), "es");
|
||||
EXPECT_EQ(testa.get(1, from_end(10)), "");
|
||||
|
||||
ssu testu{u"test"};
|
||||
EXPECT_EQ(testu.get(1, to_end), u"est");
|
||||
EXPECT_EQ(testu.get(1, 2), u"es");
|
||||
|
||||
ssw testw{L"test"};
|
||||
EXPECT_EQ(testw.get(1, to_end), L"est");
|
||||
EXPECT_EQ(testw.get(1, 2), L"es");
|
||||
}
|
||||
|
||||
TEST(SimStr, SimpleSubstr) {
|
||||
ssa testa = "test";
|
||||
#if 0
|
||||
EXPECT_EQ(testa.substr(1, 0), "est");
|
||||
EXPECT_EQ(testa.substr(1, 2), "es");
|
||||
EXPECT_EQ(testa.substr(0, -1), "tes");
|
||||
EXPECT_EQ(testa.substr(-2), "st");
|
||||
EXPECT_EQ(testa.substr(-3, 2), "es");
|
||||
EXPECT_EQ(testa.substr(-3, -1), "es");
|
||||
#endif
|
||||
EXPECT_EQ(testa.sub(1, to_end), "est");
|
||||
EXPECT_EQ(testa.sub(1, 2), "es");
|
||||
EXPECT_EQ(testa.sub(0, from_end(1)), "tes");
|
||||
EXPECT_EQ(testa.sub(from_end(2), to_end), "st");
|
||||
EXPECT_EQ(testa.sub(from_end(3), 2), "es");
|
||||
EXPECT_EQ(testa.sub(from_end(3), from_end(1)), "es");
|
||||
|
||||
EXPECT_EQ(testa.str_mid(1), "est");
|
||||
EXPECT_EQ(testa.str_mid(1, 0), "");
|
||||
EXPECT_EQ(testa.str_mid(1, 2), "es");
|
||||
EXPECT_EQ(testa.str_mid(2, 2), "st");
|
||||
|
||||
ssu testu = u"test";
|
||||
#if 0
|
||||
EXPECT_EQ(testu.substr(1, 0), u"est");
|
||||
EXPECT_EQ(testu.substr(1, 2), u"es");
|
||||
EXPECT_EQ(testu.substr(0, -1), u"tes");
|
||||
EXPECT_EQ(testu.substr(-2), u"st");
|
||||
EXPECT_EQ(testu.substr(-3, 2), u"es");
|
||||
EXPECT_EQ(testu.substr(-3, -1), u"es");
|
||||
#endif
|
||||
EXPECT_EQ(testu.sub(1, to_end), u"est");
|
||||
EXPECT_EQ(testu.sub(1, 2), u"es");
|
||||
EXPECT_EQ(testu.sub(0, from_end(1)), u"tes");
|
||||
EXPECT_EQ(testu.sub(from_end(2), to_end), u"st");
|
||||
EXPECT_EQ(testu.sub(from_end(3), 2), u"es");
|
||||
EXPECT_EQ(testu.sub(from_end(3), from_end(1)), u"es");
|
||||
|
||||
EXPECT_EQ(testu.str_mid(1), u"est");
|
||||
EXPECT_EQ(testu.str_mid(1, 0), u"");
|
||||
EXPECT_EQ(testu.str_mid(1, 2), u"es");
|
||||
EXPECT_EQ(testu.str_mid(2, 2), u"st");
|
||||
|
||||
ssw testw = L"test";
|
||||
#if 0
|
||||
EXPECT_EQ(testw.substr(1, 0), L"est");
|
||||
EXPECT_EQ(testw.substr(1, 2), L"es");
|
||||
EXPECT_EQ(testw.substr(0, -1), L"tes");
|
||||
EXPECT_EQ(testw.substr(-2), L"st");
|
||||
EXPECT_EQ(testw.substr(-3, 2), L"es");
|
||||
EXPECT_EQ(testw.substr(-3, -1), L"es");
|
||||
#endif
|
||||
EXPECT_EQ(testw.sub(1, to_end), L"est");
|
||||
EXPECT_EQ(testw.sub(1, 2), L"es");
|
||||
EXPECT_EQ(testw.sub(0, from_end(1)), L"tes");
|
||||
EXPECT_EQ(testw.sub(from_end(2), to_end), L"st");
|
||||
EXPECT_EQ(testw.sub(from_end(3), 2), L"es");
|
||||
EXPECT_EQ(testw.sub(from_end(3), from_end(1)), L"es");
|
||||
|
||||
EXPECT_EQ(testw.str_mid(1), L"est");
|
||||
EXPECT_EQ(testw.str_mid(1, 0), L"");
|
||||
EXPECT_EQ(testw.str_mid(1, 2), L"es");
|
||||
|
|
@ -327,7 +375,7 @@ TEST(SimStr, SimpleSubstr) {
|
|||
|
||||
TEST(SimStr, ToInt) {
|
||||
EXPECT_EQ(ssa{" 123"}.as_int<int>(), 123);
|
||||
EXPECT_EQ(ssa{" 123"}(0, -1).as_int<int>(), 12);
|
||||
EXPECT_EQ(ssa{" 123"}.get(0, from_end(1)).as_int<int>(), 12);
|
||||
EXPECT_EQ(ssa{"+123"}.as_int<int>(), 123);
|
||||
EXPECT_EQ(ssa{" -123aa"}.as_int<int>(), -123);
|
||||
EXPECT_EQ(ssa{"123"}.as_int<size_t>(), 123u);
|
||||
|
|
@ -810,7 +858,7 @@ TEST(SimStr, AssignSstring) {
|
|||
EXPECT_EQ(test = ssa{"other"}, "other");
|
||||
EXPECT_EQ(test = stringa{"trtr"_ss + 10}, "trtr10");
|
||||
EXPECT_EQ(test = "trtr"_ss + 20, "trtr20");
|
||||
EXPECT_EQ(test = test(2), "tr20");
|
||||
EXPECT_EQ(test = test.get(2, to_end), "tr20");
|
||||
EXPECT_EQ(test = lstringa<10>{"func"}, "func");
|
||||
EXPECT_EQ(test = lstringsa<10>{"func"}, "func");
|
||||
lstringsa<10> sample{15, "1234"};
|
||||
|
|
@ -939,10 +987,10 @@ TEST(SimStr, LStringAssign) {
|
|||
test = lstringa<1>{"next step"};
|
||||
EXPECT_EQ(test, "next step");
|
||||
|
||||
test = test(0);
|
||||
test = test.get(0, to_end);
|
||||
EXPECT_EQ(test, "next step");
|
||||
|
||||
test = test(1, 2);
|
||||
test = test.get(1, 2);
|
||||
EXPECT_EQ(test, "ex");
|
||||
|
||||
test = e_c(100, 'a');
|
||||
|
|
@ -1402,7 +1450,7 @@ TEST(SimStr, LStrJoinAndExpressions) {
|
|||
buffer.prepend(e_choice(test.length() > 2, eea + 99, eea + 12.1 + "asd"));
|
||||
EXPECT_EQ(buffer, "99asd<>fgh<>jkl");
|
||||
|
||||
buffer.change(2, 4, test(0, 3) + "__" + 1 + ',');
|
||||
buffer.change(2, 4, test.get(0, 3) + "__" + 1 + ',');
|
||||
EXPECT_EQ(buffer, "99>as__1,>fgh<>jkl");
|
||||
}
|
||||
|
||||
|
|
@ -1987,13 +2035,21 @@ TEST(SimStr, HexEpr) {
|
|||
|
||||
std::u32string textuu = +U"val = 0X"sv + e_hex<HexFlags::No0x | HexFlags::Short>(0x12Au);
|
||||
EXPECT_EQ(textuu, U"val = 0X12A");
|
||||
if (sizeof(void*) == 8) {
|
||||
text = +"ptr = "sv + (const void*)0xdeadbeefcafe01;
|
||||
EXPECT_EQ(text, "ptr = 0x00DEADBEEFCAFE01");
|
||||
|
||||
text = +"ptr = "sv + (const void*)0xdeadbeefcafe01;
|
||||
EXPECT_EQ(text, "ptr = 0x00DEADBEEFCAFE01");
|
||||
const char* ptr = (const char*)0xdeadbeefcafe01;
|
||||
std::u16string utext = ptr + +u" freed"sv;
|
||||
EXPECT_EQ(utext, u"0x00DEADBEEFCAFE01 freed");
|
||||
} else {
|
||||
text = +"ptr = "sv + (const void*)0xdeadbeef;
|
||||
EXPECT_EQ(text, "ptr = 0xDEADBEEF");
|
||||
|
||||
const char* ptr = (const char*)0xdeadbeefcafe01;
|
||||
std::u16string utext = ptr + +u" freed"sv;
|
||||
EXPECT_EQ(utext, u"0x00DEADBEEFCAFE01 freed");
|
||||
const char* ptr = (const char*)0xdeadbeef;
|
||||
std::u16string utext = ptr + +u" freed"sv;
|
||||
EXPECT_EQ(utext, u"0xDEADBEEF freed");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SimStr, EFill) {
|
||||
|
|
@ -2101,6 +2157,62 @@ TEST(SimStr, ConstEval) {
|
|||
}
|
||||
#endif
|
||||
|
||||
struct sized_alloc {
|
||||
inline static size_t allocated = 0, dealloced = 0;
|
||||
inline static void* alloced = nullptr;
|
||||
|
||||
void* allocate(size_t bytes) {
|
||||
allocated += bytes;
|
||||
return alloced = ::operator new(bytes);
|
||||
}
|
||||
template<typename T>
|
||||
void deallocate(T* address, size_t size) noexcept {
|
||||
dealloced += size;
|
||||
EXPECT_EQ(address, alloced);
|
||||
if constexpr (requires{::operator delete(address, size);}) {
|
||||
::operator delete(address, size);
|
||||
} else {
|
||||
::operator delete(address);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TEST(SimStr, SizedAlloc) {
|
||||
sized_alloc::allocated = sized_alloc::dealloced = 0;
|
||||
{
|
||||
lstring<u8s, 0, true, sized_alloc> src{10, "test"};
|
||||
sstring<u8s, sized_alloc> str{std::move(src)};
|
||||
EXPECT_TRUE(src.is_empty());
|
||||
EXPECT_EQ(((Tstringa*)&str)->sharedCount(), SharedStringData<u8s>::check | 1);
|
||||
}
|
||||
EXPECT_EQ(sized_alloc::allocated, sized_alloc::dealloced);
|
||||
EXPECT_EQ(sized_alloc::allocated, 64);
|
||||
{
|
||||
sstring<u8s, sized_alloc> str{10, "test"};
|
||||
EXPECT_EQ(((Tstringa*)&str)->sharedCount(), 1);
|
||||
}
|
||||
EXPECT_EQ(sized_alloc::allocated, sized_alloc::dealloced);
|
||||
EXPECT_EQ(sized_alloc::allocated, 113);
|
||||
}
|
||||
|
||||
TEST(SimStr, SizedAllocU) {
|
||||
sized_alloc::allocated = sized_alloc::dealloced = 0;
|
||||
{
|
||||
lstring<u16s, 0, true, sized_alloc> src{10, u"test"};
|
||||
sstring<u16s, sized_alloc> str{std::move(src)};
|
||||
EXPECT_TRUE(src.is_empty());
|
||||
EXPECT_EQ(((Tstringa*)&str)->sharedCountForce(), SharedStringData<u8s>::check | 1);
|
||||
}
|
||||
EXPECT_EQ(sized_alloc::allocated, sized_alloc::dealloced);
|
||||
EXPECT_EQ(sized_alloc::allocated, 112);
|
||||
{
|
||||
sstring<u16s, sized_alloc> str{10, u"test"};
|
||||
EXPECT_EQ(((Tstringa*)&str)->sharedCountForce(), 1);
|
||||
}
|
||||
EXPECT_EQ(sized_alloc::allocated, sized_alloc::dealloced);
|
||||
EXPECT_EQ(sized_alloc::allocated, 202);
|
||||
}
|
||||
|
||||
} // namespace simstr::tests
|
||||
|
||||
TEST(SimStr, StrNoNamespace) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* ver. 1.7.0
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
|
|
|
|||
Loading…
Reference in New Issue