mirror of https://github.com/orefkov/simstr.git
Compare commits
53 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
e9eaa6c4cb | |
|
|
00a4a008a9 | |
|
|
86deccbac3 | |
|
|
a779aa7320 | |
|
|
e9e717c8bd | |
|
|
0861d365f5 | |
|
|
91a2f798e3 | |
|
|
c8fb92fee0 | |
|
|
a083ff1b8b | |
|
|
f798e8fbbb | |
|
|
75c9d52f0d | |
|
|
c604e89bdf | |
|
|
7bb7ddb766 | |
|
|
8610bea2a9 | |
|
|
ee73896337 | |
|
|
e62493a678 | |
|
|
8cf026f2c6 | |
|
|
2148718b32 | |
|
|
4e1d1b5ffa | |
|
|
ad3a452db5 | |
|
|
c0dfdd4ef5 | |
|
|
317a4c5994 | |
|
|
15c78e65f9 | |
|
|
1d633b72dd | |
|
|
928ed1af23 | |
|
|
ce3fe2204c | |
|
|
bb70d1b0a4 | |
|
|
35d2ea2ee8 | |
|
|
620383a5a4 | |
|
|
07760fc2b6 | |
|
|
9b668edf24 | |
|
|
508ee0caa8 | |
|
|
c278fb8f2b | |
|
|
de7461dcd5 | |
|
|
3a86c9c221 | |
|
|
bde616b8f4 | |
|
|
b593eeb540 | |
|
|
bca4664d1a | |
|
|
1301597229 | |
|
|
13b31fdc4b | |
|
|
573ffd247e | |
|
|
458007e1dc | |
|
|
fa55aa5f46 | |
|
|
6905c9bb76 | |
|
|
5b81228a03 | |
|
|
1ceba4fa5c | |
|
|
17782d6e6a | |
|
|
1f0e64432e | |
|
|
170e343391 | |
|
|
2c54daf32b | |
|
|
f6a0be3e83 | |
|
|
b76486ff2b | |
|
|
8d8ec95faa |
|
|
@ -5,8 +5,8 @@ include(FetchContent)
|
|||
|
||||
project(
|
||||
simstr
|
||||
VERSION 1.0.0
|
||||
DESCRIPTION "Yet another string library"
|
||||
VERSION 1.9.1
|
||||
DESCRIPTION "Yet another modern C++ string library"
|
||||
HOMEPAGE_URL "https://github.com/orefkov/simstr"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
|
@ -21,14 +21,20 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
|
|||
set(CLANG_COMPILER ON)
|
||||
endif()
|
||||
|
||||
option(SIMSTR_BUILD_TESTS "Построить тесты" ON)
|
||||
option(SIMSTR_BENCHMARKS "Построить замеры производительности" Off)
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
|
||||
set(CAN_LINK_NATVIS On)
|
||||
endif()
|
||||
|
||||
# При OFF - строится обычная статическая библиотека.
|
||||
# При On - simstr собирается как статическая библиотека, которую потом встроят в shared библиотеку,
|
||||
# и она будет свои функции объявлять как экспортируемые. Потребители же будут собираться с указанием,
|
||||
# что функции - импортируемые
|
||||
option(SIMSTR_IN_SHARED "Функции simstr будут экспортироваться или импортироваться" Off)
|
||||
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
|
||||
|
|
@ -54,12 +60,19 @@ if(EMSCRIPTEN)
|
|||
endif()
|
||||
endif(EMSCRIPTEN)
|
||||
|
||||
if (NOT CMAKE_CXX_SIMULATE_ID)
|
||||
set (CMAKE_CXX_SIMULATE_ID "None")
|
||||
endif()
|
||||
message("Configuring simstr for [${CMAKE_BUILD_TYPE}]")
|
||||
|
||||
if (SIMSTR_LINK_NATVIS)
|
||||
# Для MSVC подключаем natvis файл для красивой отладки
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR ${CMAKE_CXX_SIMULATE_ID} STREQUAL MSVC)
|
||||
target_link_options(simstr_simstr PUBLIC "/natvis:${CMAKE_CURRENT_SOURCE_DIR}/for_debug/simstr.natvis")
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
|
||||
add_custom_command(
|
||||
TARGET simstr_simstr PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/for_debug/simstr.natvis
|
||||
${CMAKE_BINARY_DIR}/simstr.natvis
|
||||
)
|
||||
target_link_options(simstr_simstr PUBLIC "/natvis:${CMAKE_BINARY_DIR}/simstr.natvis")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
|
|
@ -86,22 +99,20 @@ function(add_simdutf)
|
|||
FetchContent_MakeAvailable(simdutf)
|
||||
endfunction()
|
||||
|
||||
if (USE_SYSTEM_DEPS)
|
||||
find_package(simdutf REQUIRED)
|
||||
else ()
|
||||
add_simdutf()
|
||||
endif()
|
||||
|
||||
target_link_libraries(simstr_simstr PUBLIC simdutf::simdutf)
|
||||
|
||||
if(SIMSTR_IN_SHARED)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# Всем объявляем, что мы будем в shared библиотеке
|
||||
add_compile_definitions(SIMSTR_IN_SHARED)
|
||||
# Себе объявим, что мы должны экспортировать функции
|
||||
target_compile_definitions(simstr_simstr PRIVATE SIMSTR_EXPORT)
|
||||
# Пример построения shared библиотеки, которая включит в себя simstr.
|
||||
# Как при этом создать экзешник, пользующийся этой dll - пример в tests/CMakeLists.txt
|
||||
# Нельзя объявить библиотеку без исходников, добавим просто .h файл
|
||||
add_library(simstr_dll SHARED include/simstr/sstring.h)
|
||||
# simstr должна войти в simstr_dll целиком
|
||||
target_link_libraries(simstr_dll PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,simstr::simstr>")
|
||||
endif(SIMSTR_IN_SHARED)
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
|
||||
if(SIMSTR_BUILD_TESTS)
|
||||
enable_testing()
|
||||
|
|
@ -110,13 +121,20 @@ if(SIMSTR_BUILD_TESTS)
|
|||
FetchContent_Declare(
|
||||
googletest
|
||||
# Specify the commit you depend on and update it regularly.
|
||||
URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip
|
||||
FIND_PACKAGE_ARGS NAMES GTest
|
||||
URL https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip
|
||||
FIND_PACKAGE_ARGS NAMES "GTest 1.17.0"
|
||||
)
|
||||
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
||||
set(gtest_force_shared_crt FALSE CACHE BOOL "" FORCE)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
add_subdirectory(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()
|
||||
|
||||
function(GBencmark)
|
||||
|
|
@ -125,7 +143,7 @@ function(GBencmark)
|
|||
googlebench
|
||||
# Specify the commit you depend on and update it regularly.
|
||||
URL https://github.com/google/benchmark/archive/refs/tags/v1.9.4.zip
|
||||
FIND_PACKAGE_ARGS NAMES benchmark
|
||||
FIND_PACKAGE_ARGS NAMES "benchmark 1.9.4"
|
||||
)
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
set(BENCHMARK_ENABLE_LTO OFF)
|
||||
|
|
@ -133,9 +151,15 @@ 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)
|
||||
target_compile_features(benchmark PUBLIC cxx_std_20)
|
||||
if(TARGET benchmark)
|
||||
target_compile_features(benchmark PUBLIC cxx_std_23)
|
||||
endif()
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
# Свежий Clang в Emscripten ругается на __COUNTER__
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -5,13 +5,35 @@ 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}"
|
||||
CXX_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}"
|
||||
CXX_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}"
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
fmt
|
||||
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
||||
GIT_TAG tags/12.1.0
|
||||
)
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
|
||||
FetchContent_Declare(
|
||||
stringzilla
|
||||
GIT_REPOSITORY https://github.com/ashvardanian/StringZilla.git
|
||||
GIT_TAG main # or specify a version tag
|
||||
)
|
||||
FetchContent_MakeAvailable(stringzilla)
|
||||
|
||||
target_link_libraries(benchStr fmt::fmt stringzilla_header)
|
||||
|
||||
add_executable(process_result process_result.cpp)
|
||||
target_link_libraries(process_result simstr_simstr)
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
#target_link_options(benchStr PRIVATE -sSTACK_SIZE=1048576 -sINITIAL_MEMORY=128MB -sALLOW_MEMORY_GROWTH=0)
|
||||
set_target_properties (benchStr PROPERTIES SUFFIX .html)
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sASYNCIFY --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/emscripten/shell_minimal.html")
|
||||
if(SIMSTR_EMSCRIPTEN_MT)
|
||||
target_link_options(benchStr PUBLIC -pthread -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency-1 -sENVIRONMENT=web,worker)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,22 +1,699 @@
|
|||
/*
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Бенчмарки
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
* Benchmarks
|
||||
*/
|
||||
#include <stringzilla/stringzilla.h>
|
||||
#include <stringzilla/stringzilla.hpp>
|
||||
|
||||
#include "bench.h"
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <charconv>
|
||||
#include <iomanip>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/compile.h>
|
||||
|
||||
using namespace simstr;
|
||||
using namespace std::literals;
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
bool do_sync = false;
|
||||
static void DoTeardown(const benchmark::State& state) {
|
||||
// Это нужно чтобы интерфейс браузера обновился
|
||||
// This is necessary for the browser interface to refresh.
|
||||
if (!do_sync) {
|
||||
emscripten_sleep(1);
|
||||
}
|
||||
}
|
||||
#undef BENCHMARK
|
||||
#define BENCHMARK(...) \
|
||||
BENCHMARK_PRIVATE_DECLARE(_benchmark_) = \
|
||||
(::benchmark::internal::RegisterBenchmarkInternal( \
|
||||
::benchmark::internal::make_unique< \
|
||||
::benchmark::internal::FunctionBenchmark>(#__VA_ARGS__, \
|
||||
__VA_ARGS__)))->Teardown(DoTeardown)
|
||||
|
||||
#undef BENCHMARK_CAPTURE
|
||||
#define BENCHMARK_CAPTURE(func, test_case_name, ...) \
|
||||
BENCHMARK_PRIVATE_DECLARE(_benchmark_) = \
|
||||
(::benchmark::internal::RegisterBenchmarkInternal( \
|
||||
::benchmark::internal::make_unique< \
|
||||
::benchmark::internal::FunctionBenchmark>( \
|
||||
#func "/" #test_case_name, \
|
||||
[](::benchmark::State& st) { func(st, __VA_ARGS__); })))->Teardown(DoTeardown)
|
||||
|
||||
#endif
|
||||
|
||||
#define TEST_TEXT "Test text"
|
||||
#define LONG_TEXT "123456789012345678901234567890"
|
||||
#define TEXT_16 "abbaabbaabbaabba"
|
||||
|
||||
#define CHECK_RESULT
|
||||
//#define CHECK_RESULT
|
||||
|
||||
void __(benchmark::State& state) { for (auto _: state) {} }
|
||||
namespace sz = ashvardanian::stringzilla;
|
||||
|
||||
sz::string email_concat_stringzilla_app(sz::string name, sz::string_view domain, sz::string_view tld) {
|
||||
return name.append("@").append(domain).append(".").append(tld);
|
||||
}
|
||||
|
||||
//> sz::string email_concat_stringzilla_app(sz::string name, sz::string_view domain, sz::string_view tld) {
|
||||
void ConcatEmailSzApp(benchmark::State& state) {
|
||||
sz::string name = "username";
|
||||
sz::string_view domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_stringzilla_app(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
sz::string email_concat_stringzilla_exp(sz::string name, sz::string_view domain, sz::string_view tld) {
|
||||
return sz::string{name | sz::string_view{"@"} | domain | sz::string_view{"."} | tld};
|
||||
}
|
||||
|
||||
//> sz::string email_concat_stringzilla_exp(sz::string name, sz::string_view domain, sz::string_view tld) {
|
||||
void ConcatEmailSzExp(benchmark::State& state) {
|
||||
sz::string name = "username";
|
||||
sz::string_view domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_stringzilla_exp(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
std::string email_concat_format(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
return std::format("{}@{}.{}", name, domain, tld);
|
||||
}
|
||||
//> std::string email_concat_format(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
void ConcatEmailFormat(benchmark::State& state) {
|
||||
std::string_view name = "username", domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_format(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
std::string email_concat_stream(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
std::stringstream s;
|
||||
s << name << "@" << domain << "." << tld;
|
||||
return s.str();
|
||||
}
|
||||
//> std::string email_concat_stream(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
void ConcatEmailStream(benchmark::State& state) {
|
||||
std::string_view name = "username", domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_stream(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
std::string email_concat_std(std::string name, std::string_view domain, std::string_view tld) {
|
||||
return name.append("@").append(domain).append(".").append(tld);
|
||||
}
|
||||
//> std::string email_concat_std(std::string name, std::string_view domain, std::string_view tld) {
|
||||
void ConcatEmailStd(benchmark::State& state) {
|
||||
std::string name = "username";
|
||||
std::string_view domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_std(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
std::string email_concat_std_expr(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
return +name + "@" + domain + "." + tld;
|
||||
}
|
||||
//> std::string email_concat_std_expr(std::string_view name, std::string_view domain, std::string_view tld) {
|
||||
void ConcatEmailStdExp(benchmark::State& state) {
|
||||
std::string_view name = "username", domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_std_expr(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
stringa email_concat_sim_expr(ssa name, ssa domain, ssa tld) {
|
||||
return name + "@" + domain + "." + tld;
|
||||
}
|
||||
//> stringa email_concat_sim_expr(ssa name, ssa domain, ssa tld) {
|
||||
void ConcatEmailSimExp(benchmark::State& state) {
|
||||
ssa name = "username", domain = "verybigdomain", tld = "tld";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(name);
|
||||
benchmark::DoNotOptimize(domain);
|
||||
benchmark::DoNotOptimize(tld);
|
||||
auto email = email_concat_sim_expr(name, domain, tld);
|
||||
benchmark::DoNotOptimize(email);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Concatenate email ---------")->Repetitions(1);
|
||||
BENCHMARK(ConcatEmailFormat)->Name("Concat email std::format");
|
||||
BENCHMARK(ConcatEmailStream)->Name("Concat email std::stringstream");
|
||||
BENCHMARK(ConcatEmailSzApp) ->Name("Concat email stringzilla append");
|
||||
BENCHMARK(ConcatEmailSzExp) ->Name("Concat email stringzilla concat");
|
||||
BENCHMARK(ConcatEmailStd) ->Name("Concat email std::string append");
|
||||
BENCHMARK(ConcatEmailStdExp)->Name("Concat email std::string by strexpr");
|
||||
BENCHMARK(ConcatEmailSimExp)->Name("Concat email stringa");
|
||||
|
||||
void ConcatStdToStd(benchmark::State& state) {
|
||||
std::string s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
std::string str = s1 + std::to_string(i) + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToStd(benchmark::State& state) {
|
||||
std::string s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
std::string str = +s1 + i + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSim(benchmark::State& state) {
|
||||
stra s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
stringa str = s1 + i + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimConcat(benchmark::State& state) {
|
||||
stra s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
stringa str = e_concat("", s1, i, " end");
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Concatenate string + Number + \"Literal\" ---------")->Repetitions(1);
|
||||
BENCHMARK(ConcatStdToStd) ->Name("Concat std::string and number by std to std::string");
|
||||
BENCHMARK(ConcatSimToStd) ->Name("Concat std::string and number by StrExpr to std::string");
|
||||
BENCHMARK(ConcatSimToSim) ->Name("Concat stringa and number by StrExpr to simstr::stringa");
|
||||
BENCHMARK(ConcatSimToSimConcat) ->Name("Concat stringa and number by e_concat to simstr::stringa");
|
||||
|
||||
void ConcatStdToFmtHex(benchmark::State& state) {
|
||||
// We use a short string so that the longest result is 15 characters and fits in the std::string SSO buffer.
|
||||
std::string s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// It is not worked for char8_t, char16_t, char32_t :(
|
||||
std::string str = s1 + std::format("{:#x}", i) + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatAllFmtToHex(benchmark::State& state) {
|
||||
// We use a short string so that the longest result is 15 characters and fits in the std::string SSO buffer.
|
||||
std::string s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// It is not worked for char8_t, char16_t, char32_t :(
|
||||
std::string str = std::format("{}{:#x} end", s1, i);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
void ConcatStdToCharsHex(benchmark::State& state) {
|
||||
// We use a short string so that the longest result is 15 characters and fits in the std::string SSO buffer.
|
||||
std::string s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// it worked only for char :(
|
||||
char buf[40];
|
||||
size_t len = std::to_chars(buf, buf + std::size(buf), i, 16).ptr - buf;
|
||||
std::string str = s1 + "0x" + std::string(buf, len) + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToStdHex(benchmark::State& state) {
|
||||
// We use a short string so that the longest result is 15 characters and fits in the std::string SSO buffer.
|
||||
std::string s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// Can work for all types of symbols
|
||||
std::string str = +s1 + i / 1_f16 + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimHex(benchmark::State& state) {
|
||||
// stringa SSO buffer is 23, but we use a short string to compare under the same conditions
|
||||
stra s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// Can work for all types of symbols
|
||||
stringa str = s1 + i / 1_f16 + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimHexC(benchmark::State& state) {
|
||||
// stringa SSO buffer is 23, but we use a short string to compare under the same conditions
|
||||
stra s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
// Can work for all types of symbols
|
||||
stringa str = e_concat("", s1, i / 1_f16, " end");
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimHexS(benchmark::State& state) {
|
||||
// stringa SSO buffer is 23, but we use a short string to compare under the same conditions
|
||||
stra s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
stringa str = e_subst("{}{} end", s1, i / 1_f16);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimHexVS(benchmark::State& state) {
|
||||
// stringa SSO buffer is 23, but we use a short string to compare under the same conditions
|
||||
stra s1 = "art ";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
stringa str = e_vsubst("{}{} end"_ss, s1, i / 1_f16);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Concatenate string + Hex Number + \"Literal\" ---------")->Repetitions(1);
|
||||
BENCHMARK(ConcatStdToFmtHex) ->Name("Concat std::string and format hex number and literal to std::string");
|
||||
BENCHMARK(ConcatAllFmtToHex) ->Name("std::format std::string and hex number by literal to std::string");
|
||||
BENCHMARK(ConcatStdToCharsHex) ->Name("Concat std::string and std::to_chars and string to std::string");
|
||||
BENCHMARK(ConcatSimToStdHex) ->Name("Concat std::string and hex number and literal by StrExpr to std::string");
|
||||
BENCHMARK(ConcatSimToSimHex) ->Name("Concat stringa and hex number and literal by StrExpr to simstr::stringa");
|
||||
BENCHMARK(ConcatSimToSimHexC) ->Name("Concat stringa and hex number and literal by e_concat to simstr::stringa");
|
||||
BENCHMARK(ConcatSimToSimHexS) ->Name("Subst stringa and hex number by e_subst literal to simstr::stringa");
|
||||
BENCHMARK(ConcatSimToSimHexVS) ->Name("Subst stringa and hex number by e_vsubst stra to simstr::stringa");
|
||||
|
||||
void ConcatSimToSimOct(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
stringa str = "abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SubstSimToSimOct(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
stringa str = e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VSubstSimToSimOct(benchmark::State& state) {
|
||||
ssa pattern = "abcdefghihklmopqr {} end";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
stringa str = e_vsubst(pattern, i / 0x8a010_fmt);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormatStdToStdOct(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
std::string str = std::format("abcdefghihklmopqr {:#010o} end", i);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VFormatStdToStdOct(benchmark::State& state) {
|
||||
std::string_view pattern = "abcdefghihklmopqr {:#010o} end";
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
std::string str = std::vformat(pattern, std::make_format_args(i));
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StreamStdToStdOct(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
std::stringstream strm;
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end";
|
||||
std::string str = strm.str();
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FmtFormatComp(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
std::string str = fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FmtFormat(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
for (unsigned i = 1; i <= 100'000; i *= 10) {
|
||||
std::string str = fmt::format("abcdefghihklmopqr {:#010o} end", i);
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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)");
|
||||
BENCHMARK(VSubstSimToSimOct) ->Name("e_vsubst(pattern, i / 0x8a010_fmt)");
|
||||
BENCHMARK(FmtFormatComp) ->Name("fmt::format(FMT_COMPILE(\"abcdefghihklmopqr {:#010o} end\"), i)");
|
||||
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) {
|
||||
std::string s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
std::string str = s1 + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToStdS(benchmark::State& state) {
|
||||
std::string s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
std::string str = +s1 + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConcatSimToSimS(benchmark::State& state) {
|
||||
stra s1 = "start ";
|
||||
for (auto _: state) {
|
||||
for (int i = 1; i <= 100'000; i *= 10) {
|
||||
benchmark::DoNotOptimize(s1);
|
||||
stringa str = s1 + " end";
|
||||
benchmark::DoNotOptimize(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Concatenate string + \"Literal\" ---------")->Repetitions(1);
|
||||
BENCHMARK(ConcatStdToStdS) ->Name("Concat std::string by std to std::string");
|
||||
BENCHMARK(ConcatSimToStdS) ->Name("Concat std::string by StrExpr to std::string");
|
||||
BENCHMARK(ConcatSimToSimS) ->Name("Concat stringa by StrExpr to stringa");
|
||||
|
||||
size_t find_pos_str(std::string_view src, std::string_view name) {
|
||||
// before C++26 we can not concatenate string and string_view...
|
||||
return src.find("\n- "s + std::string{name} + " -\n");
|
||||
}
|
||||
|
||||
size_t find_pos_exp(ssa src, ssa name) {
|
||||
return src.find(std::string{"\n- " + name + " -\n"});
|
||||
}
|
||||
|
||||
size_t find_pos_sim(ssa src, ssa name) {
|
||||
return src.find(lstringa<200>{"\n- " + name + " -\n"});
|
||||
}
|
||||
|
||||
size_t find_pos_sz(sz::string_view src, sz::string_view name) {
|
||||
return src.find(sz::string{"\n- "}.append(name).append(" -\n"));
|
||||
}
|
||||
|
||||
//> size_t find_pos_str(std::string_view src, std::string_view name) {
|
||||
void FindConcatThreeStr(benchmark::State& state) {
|
||||
std::string_view src = "sdfsdf\n- testtesttesttesttesttesttestte -\nsfrgdgfsg";
|
||||
std::string_view fnd = "testtesttesttesttesttesttestte";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(src);
|
||||
benchmark::DoNotOptimize(fnd);
|
||||
size_t pos = find_pos_str(src, fnd);
|
||||
benchmark::DoNotOptimize(pos);
|
||||
#ifdef CHECK_RESULT
|
||||
if (pos != 6) {
|
||||
state.SkipWithError("fail");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
//> size_t find_pos_exp(ssa src, ssa name) {
|
||||
void FindConcatThreeExp(benchmark::State& state) {
|
||||
std::string_view src = "sdfsdf\n- testtesttesttesttesttesttestte -\nsfrgdgfsg";
|
||||
std::string_view fnd = "testtesttesttesttesttesttestte";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(src);
|
||||
benchmark::DoNotOptimize(fnd);
|
||||
size_t pos = find_pos_exp(src, fnd);
|
||||
benchmark::DoNotOptimize(pos);
|
||||
#ifdef CHECK_RESULT
|
||||
if (pos != 6) {
|
||||
state.SkipWithError("fail");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
//> size_t find_pos_sim(ssa src, ssa name) {
|
||||
void FindConcatThreeSim(benchmark::State& state) {
|
||||
ssa src = "sdfsdf\n- testtesttesttesttesttesttestte -\nsfrgdgfsg";
|
||||
ssa fnd = "testtesttesttesttesttesttestte";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(src);
|
||||
benchmark::DoNotOptimize(fnd);
|
||||
size_t pos = find_pos_sim(src, fnd);
|
||||
benchmark::DoNotOptimize(pos);
|
||||
#ifdef CHECK_RESULT
|
||||
if (pos != 6) {
|
||||
state.SkipWithError("fail");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
//> size_t find_pos_sz(sz::string_view src, sz::string_view name) {
|
||||
void FindConcatThreeSz(benchmark::State& state) {
|
||||
sz::string_view src = "sdfsdf\n- testtesttesttesttesttesttestte -\nsfrgdgfsg";
|
||||
sz::string_view fnd = "testtesttesttesttesttesttestte";
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(src);
|
||||
benchmark::DoNotOptimize(fnd);
|
||||
size_t pos = find_pos_sz(src, fnd);
|
||||
benchmark::DoNotOptimize(pos);
|
||||
#ifdef CHECK_RESULT
|
||||
if (pos != 6) {
|
||||
state.SkipWithError("fail");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
BENCHMARK(__)->Name("----- Find three concatenated string in string_view -----")->Repetitions(1);
|
||||
BENCHMARK(FindConcatThreeStr)->Name("Find concat three std::string");
|
||||
BENCHMARK(FindConcatThreeExp)->Name("Find concat three strexpr");
|
||||
BENCHMARK(FindConcatThreeSim)->Name("Find concat three simstr");
|
||||
BENCHMARK(FindConcatThreeSz) ->Name("Find concat three stringzilla string");
|
||||
|
||||
std::string buildTypeNameStr(std::string_view type_name, size_t prec, size_t scale) {
|
||||
std::string res{type_name};
|
||||
if (prec) {
|
||||
res += "(" + std::to_string(prec);
|
||||
if (scale) {
|
||||
res += "," + std::to_string(scale);
|
||||
}
|
||||
res += ")";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string buildTypeNameExp(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
|
||||
stringa buildTypeNameSim(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
|
||||
//> std::string buildTypeNameStr(std::string_view type_name, size_t prec, size_t scale) {
|
||||
void BuildTypeNameStr(benchmark::State& state) {
|
||||
std::string_view type_name = "numeric";
|
||||
size_t prec = state.range(0), scale = prec / 2;
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(type_name);
|
||||
benchmark::DoNotOptimize(prec);
|
||||
benchmark::DoNotOptimize(scale);
|
||||
std::string res = buildTypeNameStr(type_name, prec, scale);
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
//> std::string buildTypeNameExp(ssa type_name, size_t prec, size_t scale) {
|
||||
void BuildTypeNameExp(benchmark::State& state) {
|
||||
std::string_view type_name = "numeric";
|
||||
size_t prec = state.range(0), scale = prec / 2;
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(type_name);
|
||||
benchmark::DoNotOptimize(prec);
|
||||
benchmark::DoNotOptimize(scale);
|
||||
std::string res = buildTypeNameExp(type_name, prec, scale);
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
//> stringa buildTypeNameSim(ssa type_name, size_t prec, size_t scale) {
|
||||
void BuildTypeNameSim(benchmark::State& state) {
|
||||
ssa type_name = "numeric";
|
||||
size_t prec = state.range(0), scale = prec / 2;
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(type_name);
|
||||
benchmark::DoNotOptimize(prec);
|
||||
benchmark::DoNotOptimize(scale);
|
||||
stringa res = buildTypeNameSim(type_name, prec, scale);
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Build Type Name ---------")->Repetitions(1);
|
||||
BENCHMARK(BuildTypeNameStr) ->Name("BuildTypeNameStr 0")->Arg(0);
|
||||
BENCHMARK(BuildTypeNameExp) ->Name("BuildTypeNameExp 0")->Arg(0);
|
||||
BENCHMARK(BuildTypeNameSim) ->Name("BuildTypeNameSim 0")->Arg(0);
|
||||
BENCHMARK(BuildTypeNameStr) ->Name("BuildTypeNameStr 10")->Arg(10);
|
||||
BENCHMARK(BuildTypeNameExp) ->Name("BuildTypeNameExp 10")->Arg(10);
|
||||
BENCHMARK(BuildTypeNameSim) ->Name("BuildTypeNameSim 10")->Arg(10);
|
||||
|
||||
std::string make_str_str(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
auto str_replace = [](std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
std::string result;
|
||||
for (size_t offset = 0; ;) {
|
||||
size_t pos = from.find(pattern, offset);
|
||||
if (pos == std::string::npos) {
|
||||
result += from.substr(offset);
|
||||
break;
|
||||
}
|
||||
result += from.substr(offset, pos - offset);
|
||||
result += repl;
|
||||
offset = pos + pattern.length();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
return "<" + str_replace(from, pattern, repl) + ">";
|
||||
}
|
||||
|
||||
std::string make_str_exp(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
return "<" + e_repl(from, pattern, repl) + ">";
|
||||
}
|
||||
|
||||
//> std::string make_str_str(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
void ReplaceStr(benchmark::State& state) {
|
||||
std::string_view from = "testitestitestitesti", what = "te", repl = "--+--";
|
||||
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(from);
|
||||
benchmark::DoNotOptimize(what);
|
||||
benchmark::DoNotOptimize(repl);
|
||||
std::string res = make_str_str(from, what, repl);
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
//> std::string make_str_exp(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
void ReplaceExp(benchmark::State& state) {
|
||||
std::string_view from = "testitestitestitesti", what = "te", repl = "--+--";
|
||||
|
||||
for (auto _: state) {
|
||||
benchmark::DoNotOptimize(from);
|
||||
benchmark::DoNotOptimize(what);
|
||||
benchmark::DoNotOptimize(repl);
|
||||
std::string res = make_str_exp(from, what, repl);
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Replace string by copy -----")->Repetitions(1);
|
||||
BENCHMARK(ReplaceStr)->Name("Concat with replace str");
|
||||
BENCHMARK(ReplaceExp)->Name("Concat with replace exp");
|
||||
|
||||
template<typename T>
|
||||
void CreateEmpty(benchmark::State& state) {
|
||||
|
|
@ -113,6 +790,7 @@ void Find(benchmark::State& state) {
|
|||
}
|
||||
}
|
||||
BENCHMARK(__)->Name("----- Find 9 symbols text in end of 99 symbols text ---------")->Repetitions(1);
|
||||
BENCHMARK(Find<sz::string>)->Name("sz::string::find;");
|
||||
BENCHMARK(Find<std::string>) ->Name("std::string::find;");
|
||||
BENCHMARK(Find<std::string_view>) ->Name("std::string_view::find;");
|
||||
BENCHMARK(Find<ssa>) ->Name("ssa::find;");
|
||||
|
|
@ -175,9 +853,6 @@ void ToIntStr0(benchmark::State& state, const std::string& s, int c) {
|
|||
}
|
||||
|
||||
void ToIntFromChars10(benchmark::State& state, const std::string_view& s, int c) {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
state.SkipWithError("not implemented");
|
||||
#else
|
||||
for (auto _: state) {
|
||||
int res = 0;
|
||||
std::from_chars(s.data(), s.data() + s.size(), res, 10);
|
||||
|
|
@ -189,13 +864,9 @@ void ToIntFromChars10(benchmark::State& state, const std::string_view& s, int c)
|
|||
#endif
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ToIntFromChars16(benchmark::State& state, const std::string_view& s, int c) {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
state.SkipWithError("not implemented");
|
||||
#else
|
||||
for (auto _: state) {
|
||||
int res = 0;
|
||||
std::from_chars(s.data(), s.data() + s.size(), res, 16);
|
||||
|
|
@ -207,13 +878,12 @@ void ToIntFromChars16(benchmark::State& state, const std::string_view& s, int c)
|
|||
#endif
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ToIntSimStr10(benchmark::State& state, T t, int c) {
|
||||
for (auto _: state) {
|
||||
int res = std::get<0>(t. template to_int<int, true, 10, false, false>());
|
||||
int res = t. template to_int<int, true, 10, false, false>().value;
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
|
|
@ -228,7 +898,7 @@ void ToIntSimStr10(benchmark::State& state, T t, int c) {
|
|||
template<typename T>
|
||||
void ToIntSimStr16(benchmark::State& state, T t, int c) {
|
||||
for (auto _: state) {
|
||||
int res = std::get<0>(t. template to_int<int, true, 16, false, false>());
|
||||
int res = t. template to_int<int, true, 16, false, false>().value;
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
|
|
@ -243,7 +913,7 @@ void ToIntSimStr16(benchmark::State& state, T t, int c) {
|
|||
template<typename T>
|
||||
void ToIntSimStr0(benchmark::State& state, T t, int c) {
|
||||
for (auto _: state) {
|
||||
int res = std::get<0>(t. template to_int<int>());
|
||||
int res = t. template to_int<int>().value;
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
|
|
@ -257,7 +927,7 @@ void ToIntSimStr0(benchmark::State& state, T t, int c) {
|
|||
|
||||
void ToIntNoOverflow(benchmark::State& state, ssa t, int c) {
|
||||
for (auto _: state) {
|
||||
int res = std::get<0>(t.to_int<int, false>());
|
||||
int res = t.to_int<int, false>().value;
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
|
|
@ -268,7 +938,6 @@ void ToIntNoOverflow(benchmark::State& state, ssa t, int c) {
|
|||
benchmark::DoNotOptimize(t);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Convert to int '1234567' ---------")->Repetitions(1);
|
||||
BENCHMARK_CAPTURE(ToIntStr10, , std::string{"123456789"}, 123456789) ->Name("std::string s = \"123456789\"; int res = std::strtol(s.c_str(), 0, 10);");
|
||||
BENCHMARK_CAPTURE(ToIntFromChars10, , std::string_view{"123456789"}, 123456789) ->Name("std::string_view s = \"123456789\"; std::from_chars(s.data(), s.data() + s.size(), res, 10);");
|
||||
|
|
@ -286,6 +955,68 @@ BENCHMARK_CAPTURE(ToIntStr0, , std::string{" 123456789"}, 123456789)
|
|||
BENCHMARK_CAPTURE(ToIntSimStr0, , stringa{" 123456789"}, 123456789) ->Name("stringa s = \" 123456789\"; int res = s.to_int<int>; // Check overflow");
|
||||
BENCHMARK_CAPTURE(ToIntNoOverflow, , ssa{" 123456789"}, 123456789) ->Name("ssa s = \" 123456789\"; int res = s.to_int<int, false>; // No check overflow");
|
||||
|
||||
void ToDoubleStr(benchmark::State& state, const std::string& s, double c) {
|
||||
for (auto _: state) {
|
||||
char* ptr = nullptr;
|
||||
double res = std::strtod(s.c_str(), &ptr);
|
||||
if (ptr == s.c_str()) {
|
||||
state.SkipWithError("not equal");
|
||||
}
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename K = char>
|
||||
void ToDoubleFromChars(benchmark::State& state, const std::string_view& s, double c) {
|
||||
for (auto _: state) {
|
||||
double res = 0;
|
||||
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) {
|
||||
state.SkipWithError("not equal");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
benchmark::DoNotOptimize(res);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void ToDoubleSimStr(benchmark::State& state, T t, double c) {
|
||||
for (auto _: state) {
|
||||
auto r = t.template to_double<false>();
|
||||
if (!r) {
|
||||
state.SkipWithError("not equal");
|
||||
}
|
||||
double res = *r;
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != c) {
|
||||
state.SkipWithError("not equal");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
benchmark::DoNotOptimize(res);
|
||||
benchmark::DoNotOptimize(t);
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Convert to double '1234.567e10' ---------")->Repetitions(1);
|
||||
BENCHMARK_CAPTURE(ToDoubleStr, , std::string{"1234.567e10"}, 1234.567e10) ->Name("std::string s = \"1234.567e10\"; double res = std::strtod(s.c_str(), nullptr);");
|
||||
BENCHMARK_CAPTURE(ToDoubleFromChars, , std::string_view{"1234.567e10"}, 1234.567e10) ->Name("std::string_view s = \"1234.567e10\"; std::from_chars(s.data(), s.data() + s.size(), res);");
|
||||
BENCHMARK_CAPTURE(ToDoubleSimStr, , ssa{"1234.567e10"}, 1234.567e10) ->Name("ssa s = \"1234.567e10\"; double res = *s.to_double()");
|
||||
|
||||
void AppendStreamConstLiteral(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
std::string result;
|
||||
|
|
@ -1245,7 +1976,7 @@ void ReplaceAllLongerSimStringExpr(benchmark::State& state) {
|
|||
lstringa<2048> big_source{Count, source}, big_sample{Count, sample};
|
||||
|
||||
for (auto _: state) {
|
||||
stringa result = e_repl(big_source.to_str(), "bb", "----");
|
||||
stringa result = e_repl(big_source, "bb", "----");
|
||||
|
||||
#ifdef CHECK_RESULT
|
||||
if (result.to_str() != big_sample) {
|
||||
|
|
@ -1811,7 +2542,7 @@ void BuildFuncNameSimStr(benchmark::State& state) {
|
|||
stringa res = f.f.build_full_name();
|
||||
benchmark::DoNotOptimize(res);
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != stra{f.check}) {
|
||||
if (res != ssa{f.check}) {
|
||||
std::cout << res << "\n";
|
||||
state.SkipWithError("not equal");
|
||||
break;
|
||||
|
|
@ -1828,7 +2559,7 @@ void BuildFuncNameSimStr1(benchmark::State& state) {
|
|||
stringa res = f.f.build_full_name1();
|
||||
benchmark::DoNotOptimize(res);
|
||||
#ifdef CHECK_RESULT
|
||||
if (res != stra{f.check}) {
|
||||
if (res != ssa{f.check}) {
|
||||
std::cout << res << "\n";
|
||||
state.SkipWithError("not equal");
|
||||
break;
|
||||
|
|
@ -1896,8 +2627,65 @@ BENCHMARK(BuildFuncNameStream) ->Name("Build func full name std::stream;
|
|||
BENCHMARK(BuildFuncNameSimStr) ->Name("Build func full name stringa;");
|
||||
BENCHMARK(BuildFuncNameSimStr1) ->Name("Build func full name stringa 1;");
|
||||
|
||||
void UpperCaseStd(benchmark::State& state) {
|
||||
static const auto& loc = std::locale("en_US.utf8");
|
||||
|
||||
for (auto _: state) {
|
||||
std::wstring test = L"TestПриветTest";
|
||||
benchmark::DoNotOptimize(test);
|
||||
|
||||
std::transform(test.begin(), test.end(), test.begin(), [](wchar_t s) {
|
||||
return std::toupper(s, loc);
|
||||
});
|
||||
|
||||
benchmark::DoNotOptimize(test);
|
||||
#ifdef CHECK_RESULT
|
||||
if (test != L"TESTПРИВЕТTEST") {
|
||||
state.SkipWithError("Bad upper case");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void UpperCaseSim(benchmark::State& state) {
|
||||
for (auto _: state) {
|
||||
lstringw<15> test = L"TestПриветTest";
|
||||
benchmark::DoNotOptimize(test);
|
||||
|
||||
test.upper();
|
||||
|
||||
benchmark::DoNotOptimize(test);
|
||||
#ifdef CHECK_RESULT
|
||||
if (test != L"TESTПРИВЕТTEST") {
|
||||
state.SkipWithError("Bad upper case");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(__)->Name("----- Make Upper ---------")->Repetitions(1);
|
||||
BENCHMARK(UpperCaseStd)->Name("To upper case std::wstring");
|
||||
BENCHMARK(UpperCaseSim)->Name("To upper case lstringw<15>");
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
char arg1[] = "--benchmark_repetitions=10", arg2[] = "--benchmark_report_aggregates_only=true";
|
||||
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"
|
||||
<< "Compiler " << CXX_COMPILER_ID << " " << CXX_COMPILER_VERSION
|
||||
#ifdef _LIBCPP_VERSION
|
||||
<< ", use libc++"
|
||||
#endif
|
||||
<< std::endl;
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
EM_ASM({ console.log(navigator.userAgent); });
|
||||
if (argc == 2 && stra{argv[1]} == "-sync") {
|
||||
do_sync = true;
|
||||
argc = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
char arg1[] = "--benchmark_repetitions=4", arg2[] = "--benchmark_report_aggregates_only=true";
|
||||
char* my_params[] = {argv[0], arg1, arg2};
|
||||
if (argc < 2) {
|
||||
argc = 3;
|
||||
|
|
@ -1908,5 +2696,10 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
::benchmark::Shutdown();
|
||||
#ifdef EMSCRIPTEN
|
||||
std::cout << "Done!\n";
|
||||
EM_ASM({ on_done(); });
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,37 @@
|
|||
- Concat stringa and number by StrExpr to simstr::stringa
|
||||
stringa в отличии от std::string,
|
||||
вмещает в SSO 23 символа вместо 15, поэтому
|
||||
в конце теста std::string приходится аллоцировать память,
|
||||
а в stringa весь тест входит в SSO.
|
||||
Unlike std::string, stringa
|
||||
holds 23 characters in SSO instead of 15, so
|
||||
at the end of the std::string test, memory has to be allocated,
|
||||
while in stringa , the entire test is included in SSO.
|
||||
|
||||
- Concat email stringzilla concat
|
||||
В stringzilla тоже есть конкатенация строковыми выражениями, но не
|
||||
так удобна и развита, как в simstr.
|
||||
Stringzilla also has concatenation by expression templates,
|
||||
but it's not as convenient or advanced as simstr.
|
||||
|
||||
- Find concat three simstr
|
||||
Если результат конкатенации меньше 207 символов,
|
||||
он собирается в буфере на стеке, без аллокации и деалокации.
|
||||
If the concatenation result is less than 207 characters,
|
||||
it is collected in a stack-based buffer, without allocation or deallocation.
|
||||
|
||||
- sz::string::find;
|
||||
stringzilla более заточена на поиск больших строк в больших строках.
|
||||
stringzilla is more focused on searching large strings within large strings.
|
||||
|
||||
- Concat with replace exp
|
||||
В simstr строковое выражение для замены подстрок
|
||||
есть "из коробки".
|
||||
simstr has a string expression for replacing substrings out of the box.
|
||||
|
||||
- std::string e;
|
||||
Пустые строки, ничего необычного.
|
||||
Empty lines, nothing unusual.
|
||||
|
||||
- std::string_view e;
|
||||
- ssa e;
|
||||
|
|
@ -10,80 +42,111 @@
|
|||
- std::string e = "Test text";
|
||||
Короткий литерал помещается во внутренний буфер std::string,
|
||||
время тратится только на копирование 10 байтов.
|
||||
The short literal is placed in the internal std::string buffer;
|
||||
time is spent only copying 10 bytes.
|
||||
|
||||
- std::string_view e = "Test text";
|
||||
И string_view, и ssa - по сути одно и то же:
|
||||
указатель на текст и его длина.
|
||||
Both string_view and ssa are essentially the same thing:
|
||||
a pointer to text and its length.
|
||||
|
||||
- ssa e = "Test text";
|
||||
- stringa e = "Test text";
|
||||
stringa при инициализации константным литералом так же
|
||||
сохраняет только указатель на текст и его длину.
|
||||
When initialized with a constant literal, stringa also stores
|
||||
only a pointer to the text and its length.
|
||||
|
||||
- lstringa<20> e = "Test text";
|
||||
Внутреннего буфера хватает для размещения символов,
|
||||
время уходит только на копирование байтов.
|
||||
The internal buffer is sufficient to accommodate characters;
|
||||
time is spent only on copying bytes.
|
||||
|
||||
- lstringa<40> e = "Test text";
|
||||
- std::string e = "123456789012345678901234567890";
|
||||
Вот тут уже литерал не помещается во внутренний буфер,
|
||||
возникает аллокация и копирование 30-и байтов.
|
||||
Но как же отстает аллокация под Windows от Linux'а, 20 vs 70 ns...
|
||||
|
||||
Here, the literal doesn't fit into the internal buffer,
|
||||
and 30 bytes are allocated and copied.
|
||||
But how much slower is allocation under Windows than under Linux, 20 ns vs. 70 ns...
|
||||
|
||||
- std::string_view e = "123456789012345678901234567890";
|
||||
string_view и ssa по прежнему ничего не делают, кроме
|
||||
запоминания указателя на текст и его размера.
|
||||
string_view and ssa still do nothing except
|
||||
remember the pointer to the text and its size.
|
||||
|
||||
- ssa e = "123456789012345678901234567890";
|
||||
- stringa e = "123456789012345678901234567890";
|
||||
stringa на константных литералах не отстает!
|
||||
stringa doesn't lag behind on constant literals!
|
||||
|
||||
- lstringa<20> e = "123456789012345678901234567890";
|
||||
lstringa<20> может вместить в себя до 23 символов,
|
||||
Очевидно, что для 30-и символов уже нужна аллокация.
|
||||
Obviously, 30 characters already require allocation.
|
||||
|
||||
- lstringa<40> e = "123456789012345678901234567890";
|
||||
А в lstringa<40> влезает до 47 символов, так что просто
|
||||
копируется 30 байтов.
|
||||
And lstringa<40> can hold up to 47 characters, so 30
|
||||
bytes are simply copied.
|
||||
|
||||
- std::string e = "Test text"; auto c{e};
|
||||
Строка в пределах SSO, так что просто копирует байты.
|
||||
The string is within the SSO, so it just copies the bytes.
|
||||
|
||||
- std::string_view e = "Test text"; auto c{e};
|
||||
- ssa e = "Test text"; auto c{e};
|
||||
ssa и string_view не владеют строкой, копируется
|
||||
только информация о строке.
|
||||
ssa and string_view don't own the string; only the
|
||||
string information is copied.
|
||||
|
||||
- stringa e = "Test text"; auto c{e};
|
||||
Копирование stringa происходит быстро,
|
||||
особенно если она инициализирована литералом.
|
||||
Copying a stringa is fast,
|
||||
especially if it is initialized with a literal.
|
||||
|
||||
- lstringa<20> e = "Test text"; auto c{e};
|
||||
В обоих случаях хватает внутреннего буфера.
|
||||
In both cases, the internal buffer is sufficient.
|
||||
|
||||
- lstringa<40> e = "Test text"; auto c{e};
|
||||
Только копируются байты.
|
||||
Only bytes are copied.
|
||||
|
||||
- std::string e = "123456789012345678901234567890"; auto c{e};
|
||||
Копирования длинной строки вызывает аллокацию,
|
||||
SSO уже не хватает. И снова как же отстаёт аллокация под Windows...
|
||||
Copying a long string causes allocations,
|
||||
SSO is no longer sufficient. And again, how allocation lags under Windows...
|
||||
|
||||
- std::string_view e = "123456789012345678901234567890"; auto c{e};
|
||||
- ssa e = "123456789012345678901234567890"; auto c{e};
|
||||
- stringa e = "123456789012345678901234567890"; auto c{e};
|
||||
А вот у stringa копирование литерала не зависит от его длины,
|
||||
сравни с предыдущим бенчмарком.
|
||||
But with stringa, literal copying doesn't depend on its length,
|
||||
compare with the previous benchmark.
|
||||
|
||||
- lstringa<20> e = "123456789012345678901234567890"; auto c{e};
|
||||
Не влезает, аллокация.
|
||||
Doesn't fit, allocation.
|
||||
|
||||
- lstringa<40> e = "123456789012345678901234567890"; auto c{e};
|
||||
Уложили во внутренний буфер.
|
||||
Placed in the internal buffer.
|
||||
|
||||
- std::string::find;
|
||||
Здесь "победила дружба", у всех типов по колонке примерно одинаково.
|
||||
Однако, Windows и Linux явно в разных весовых категориях.
|
||||
Here, "friendship wins," with all types scoring roughly equally.
|
||||
However, Windows and Linux are clearly in different weight classes.
|
||||
|
||||
- std::string_view::find;
|
||||
- ssa::find;
|
||||
|
|
@ -94,10 +157,14 @@ SSO уже не хватает. И снова как же отстаёт алл
|
|||
- std::string copy{str_with_len_N};/16
|
||||
Явно виден скачок, где заканчивается SSO и начинается аллокация.
|
||||
Обратите внимание, что WASM - 32-битный, и там размер
|
||||
SSO у std::string меньше, насколько я помню, 11 символов + 0.
|
||||
SSO у std::string меньше, 10 символов + 0.
|
||||
The jump where SSO ends and allocation begins is clearly visible.
|
||||
Note that WASM is 32-bit, and the size of the SSO for std::string is
|
||||
smaller, as far as I remember: 11 characters + 0.
|
||||
|
||||
- std::string copy{str_with_len_N};/23
|
||||
Дальше просто добавляется время на копирование байтов.
|
||||
Then the time for copying bytes is simply added.
|
||||
|
||||
- std::string copy{str_with_len_N};/24
|
||||
- std::string copy{str_with_len_N};/32
|
||||
|
|
@ -109,23 +176,33 @@ SSO у std::string меньше, насколько я помню, 11 симво
|
|||
- std::string copy{str_with_len_N};/2048
|
||||
- std::string copy{str_with_len_N};/4096
|
||||
Чем длиннее строка, тем дольше создаётся копия.
|
||||
The longer the string, the longer it takes to create a copy.
|
||||
|
||||
- stringa copy{str_with_len_N};/15
|
||||
Здесь stringa инициализируется не литералом,
|
||||
а значит, должна сама хранить символы.
|
||||
Here, stringa is not initialized with a literal,
|
||||
meaning it must store characters itself.
|
||||
|
||||
- stringa copy{str_with_len_N};/16
|
||||
Под WASM SSO у stringa составляет 15 символов. Кроме того,
|
||||
собиралось без поддержки потоков, поэтому возможно атомарный
|
||||
собиралось без поддержки потоков, поэтому атомарный
|
||||
инкремент заменён на обычный, судя по времени.
|
||||
Under WASM, stringa has a 15-character SSO. Furthermore,
|
||||
it was built without thread support, so the atomic
|
||||
increment was replaced with a regular one, judging by the time.
|
||||
|
||||
- stringa copy{str_with_len_N};/23
|
||||
SSO в stringa до 23 символов, и даже 23
|
||||
копируются быстрее, чем 15 в std::string.
|
||||
SSO in stringa is up to 23 characters, and even 23
|
||||
copies faster than 15 in std::string.
|
||||
|
||||
- stringa copy{str_with_len_N};/24
|
||||
Всё, не влезаем в SSO, а значит, используем shared буфер.
|
||||
Добавляется время на атомарный инкремент счётчика.
|
||||
That's it, we're not using SSO, so we're using a shared buffer.
|
||||
Time is added for the atomic counter increment.
|
||||
|
||||
- stringa copy{str_with_len_N};/32
|
||||
- stringa copy{str_with_len_N};/64
|
||||
|
|
@ -137,15 +214,20 @@ SSO в stringa до 23 символов, и даже 23
|
|||
- stringa copy{str_with_len_N};/4096
|
||||
И как видно, кроме инкремента нет накладных расходов,
|
||||
время копирования не зависит от длины строки.
|
||||
And as you can see, there are no overhead costs other than the
|
||||
increment; copying time does not depend on the string length.
|
||||
|
||||
- lstringa<16> copy{str_with_len_N};/15
|
||||
lstringa<16> использует SSO до 23 символов.
|
||||
А в WASM 32-битная архитектура, SSO до 19 символов.
|
||||
lstringa<16> uses SSO up to 23 characters.
|
||||
WASM has a 32-bit architecture, so SSO is up to 19 characters.
|
||||
|
||||
- lstringa<16> copy{str_with_len_N};/16
|
||||
- lstringa<16> copy{str_with_len_N};/23
|
||||
- lstringa<16> copy{str_with_len_N};/24
|
||||
И после начинает вести себя при копировании, как std::string.
|
||||
And then it starts to behave like std::string when copied.
|
||||
|
||||
- lstringa<16> copy{str_with_len_N};/32
|
||||
- lstringa<16> copy{str_with_len_N};/64
|
||||
|
|
@ -158,6 +240,8 @@ lstringa<16> использует SSO до 23 символов.
|
|||
- lstringa<512> copy{str_with_len_N};/8
|
||||
А вот lstringa<512> имеет гораздо больший внутренний
|
||||
буфер и копирует символы без аллокации.
|
||||
But lstringa<512> has a much larger internal
|
||||
buffer and copies characters without allocation.
|
||||
|
||||
- lstringa<512> copy{str_with_len_N};/16
|
||||
- lstringa<512> copy{str_with_len_N};/32
|
||||
|
|
@ -167,9 +251,12 @@ lstringa<16> использует SSO до 23 символов.
|
|||
- lstringa<512> copy{str_with_len_N};/512
|
||||
Даже 512 символов копируются быстрее, чем
|
||||
одна аллокация или атомарный инкремент.
|
||||
Even 512 characters are copied faster than a single
|
||||
allocation or atomic increment.
|
||||
|
||||
- lstringa<512> copy{str_with_len_N};/1024
|
||||
А дальше уже как у всех
|
||||
А дальше уже как у всех.
|
||||
And then it's like everyone else.
|
||||
|
||||
- lstringa<512> copy{str_with_len_N};/2048
|
||||
- lstringa<512> copy{str_with_len_N};/4096
|
||||
|
|
@ -180,19 +267,28 @@ lstringa<16> использует SSO до 23 символов.
|
|||
поведения "std::from_chars", но он к сожалению очень ограничен
|
||||
по возможностям. Здесь я попытался произвести тесты, близкие по
|
||||
логике к работе std::from_chars
|
||||
In simstr, a string fragment is sufficient for conversion to a number;
|
||||
there's no need for null termination. The closest analog to this behavior
|
||||
is "std::from_chars," but unfortunately, it is very limited in its capabilities.
|
||||
Here, I attempted to run tests that are similar in logic to std::from_chars.
|
||||
|
||||
- std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);
|
||||
from_chars требует точного указания основания счисления,
|
||||
не допускает знаков плюс, пробелов, префиксов 0x и т.п.
|
||||
from_chars requires an exact radix specification and does not allow plus
|
||||
signs, spaces, 0x prefixes, etc.
|
||||
|
||||
- stringa s = "123456789"; int res = s.to_int<int, true, 10, false>
|
||||
Здесь для to_int заданы такие же ограничения - проверять переполнение,
|
||||
десятичная система, без лидирующих пробелов и знака плюс
|
||||
Here, to_int has the same restrictions: check for overflow,
|
||||
decimal system, no leading spaces, and no plus sign.
|
||||
|
||||
- ssa s = "123456789"; int res = s.to_int<int, true, 10, false>
|
||||
- lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>
|
||||
- std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);
|
||||
Всё то же, только для 16ричной системы
|
||||
Everything is the same, only for the hexadecimal system
|
||||
|
||||
- std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);
|
||||
- stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>
|
||||
|
|
@ -200,6 +296,7 @@ from_chars требует точного указания основания с
|
|||
- lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>
|
||||
- std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);
|
||||
А здесь уже парсинг произвольного числа.
|
||||
And here we have parsing of an arbitrary number.
|
||||
|
||||
- stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow
|
||||
- ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow
|
||||
|
|
@ -209,6 +306,8 @@ from_chars требует точного указания основания с
|
|||
- lstringa<128> str; ... str += "abbaabbaabbaabba";
|
||||
Чем больше внутренний буфер, тем меньше раз требуется
|
||||
аллокация, тем быстрее результат.
|
||||
The larger the internal buffer, the fewer allocations are
|
||||
required, and the faster the result.
|
||||
|
||||
- lstringa<512> str; ... str += "abbaabbaabbaabba";
|
||||
- lstringa<1024> str; ... str += "abbaabbaabbaabba";
|
||||
|
|
@ -236,20 +335,28 @@ from_chars требует точного указания основания с
|
|||
- std::string str = std::format("test = {} times", k);
|
||||
- lstringa<8> str; str.format("test = {} times", k);
|
||||
В simstr format с первого раза не помещается в такую строку без аллокации.
|
||||
In simstr format, the first time it doesn't fit into such a
|
||||
string without allocation.
|
||||
|
||||
- lstringa<32> str; str.format("test = {} times", k);
|
||||
А в такую помещается. Используйте сразу буфера подходящего размера.
|
||||
And it fits in this one. Use buffers of the appropriate size right away.
|
||||
|
||||
- lstringa<8> str = "test = " + k + " times";
|
||||
Результат не помещается в SSO, возникает аллокация.
|
||||
The result does not fit into SSO, an allocation occurs.
|
||||
|
||||
- lstringa<32> str = "test = " + k + " times";
|
||||
А здесь и ниже - результат укладывается в SSO.
|
||||
Ещё раз - используйте сразу буфера подходящего размера.
|
||||
And here and below, the result fits within SSO.
|
||||
Once again, use appropriately sized buffers from the start.
|
||||
|
||||
- stringa str = "test = " + k + " times";
|
||||
Под WASM размер SSO 15 символов, что явно не хватает для размещения
|
||||
результата, отсюда и такое время.
|
||||
Under WASM, the SSO size is 15 characters, which is clearly not
|
||||
enough to accommodate the result, hence the long time.
|
||||
|
||||
- std::string::find + substr + std::strtol
|
||||
- ssa::splitter + ssa::as_int
|
||||
|
|
@ -258,9 +365,14 @@ from_chars требует точного указания основания с
|
|||
Это наивная реализация, которая неверно отработает на
|
||||
таких заменах, как 'a'->'b' и 'b'->'a'. Но если замены не конфликтуют,
|
||||
то работает быстро.
|
||||
This is a naive implementation that will fail to handle substitutions
|
||||
such as 'a'->'b' and 'b'->'a'. But if the substitutions don't conflict,
|
||||
it works quickly.
|
||||
|
||||
- replace symbols with std::string find_first_of + replace
|
||||
Дальше уже правильные реализации, не зависящие от конфликтующих замен.
|
||||
Further, there are correct implementations that do not depend on
|
||||
conflicting replacements.
|
||||
|
||||
- replace symbols with std::string_view find_first_of + copy
|
||||
- replace runtime symbols with string expressions and without remembering all search results
|
||||
|
|
@ -278,6 +390,8 @@ from_chars требует точного указания основания с
|
|||
- replace bb to ---- in 64 std::string
|
||||
Тут проверяется тяжелый случай - замена подстроки на более
|
||||
длинную. Обычная реализация несколько раз передвигает хвост.
|
||||
This checks for a difficult case: replacing a substring with a longer
|
||||
one. The standard implementation moves the tail several times.
|
||||
|
||||
- replace bb to ---- in 64 lstringa<8>
|
||||
- replace bb to ---- in 64 str by init stringa
|
||||
|
|
@ -292,11 +406,13 @@ from_chars требует точного указания основания с
|
|||
- replace bb to ---- in 1024 str by init stringa
|
||||
- replace bb to ---- in 2048 std::string
|
||||
Чем длиннее строка, тем больше замедляется std::string
|
||||
The longer the string, the slower std::string becomes.
|
||||
|
||||
- replace bb to ---- in 2048 lstringa<8>
|
||||
- replace bb to ---- in 2048 str by init stringa
|
||||
- replace bb to -- in 64 std::string
|
||||
Идеальный случай замены - на подстроку такой же длины
|
||||
The ideal case of replacement is with a substring of the same length.
|
||||
|
||||
- replace bb to -- in 64 lstringa<8>
|
||||
- replace bb to -- in 64 by init stringa
|
||||
|
|
@ -315,37 +431,55 @@ from_chars требует точного указания основания с
|
|||
- hashStrMapA<size_t> emplace & find stringa;
|
||||
Вставляем в hashStrMapA 10000 stringa длиной от 30 до 50
|
||||
символов, а потом ищем их в ней
|
||||
We insert 10,000 strings of length from 30 to 50 characters into
|
||||
hashStrMapA, and then search for them in it.
|
||||
|
||||
- std::unordered_map<std::string, size_t> emplace & find std::string;
|
||||
То же самое c std::string и std::unordered_map
|
||||
Same thing with std::string and std::unordered_map
|
||||
|
||||
- hashStrMapA<size_t> emplace & find ssa;
|
||||
Теперь вставляем stringa, а ищем ssa
|
||||
Now we insert stringa and search for ssa
|
||||
|
||||
- std::unordered_map<std::string, size_t> emplace & find std::string_view;
|
||||
Вставляем std::string, а ищем std::string_view
|
||||
We insert std::string and look for std::string_view
|
||||
|
||||
- Build func full name std::string;
|
||||
Обыденная задача, подобные часто могут встретится в работе:
|
||||
По неким данным сгенерировать текст. В этом случае по данным
|
||||
о неких функциях сформировать их полное имя с типами параметров и
|
||||
возвращаемого значения. Алгоритм на std::string.
|
||||
A common task, similar to this one, can often be encountered in work:
|
||||
Generate text from given data. In this case, using data
|
||||
on certain functions, generate their full names with parameter types and
|
||||
return values. The algorithm uses std::string.
|
||||
|
||||
- Build func full name std::string 1;
|
||||
Почти тот же алгоритм, но несколько последовательных
|
||||
+= к строке заменены на одно += + + +.
|
||||
Almost the same algorithm, but several consecutive
|
||||
+= to a string are replaced with a single += + + +.
|
||||
|
||||
- Build func full name std::stream;
|
||||
Строим имя функции через std::ostringstream и <<
|
||||
We construct the function name through std::ostringstream and <<
|
||||
|
||||
- Build func full name stringa;
|
||||
Реализация на simstr строках и строковых выражениях.
|
||||
Инфа о параметрах добавляется в текущую строку
|
||||
Implementation using simstr strings and string expressions.
|
||||
Parameter information is appended to the current line.
|
||||
|
||||
- Build func full name stringa 1;
|
||||
Реализация на simstr строках и строковых выражениях.
|
||||
Инфа о параметрах добавляется во временную строку, а потом
|
||||
разом добавляется в текущую строку. Позволяет операции в цикле
|
||||
записать в одну строку, но чуть проигрывает по времени выполнения.
|
||||
Implementation using simstr strings and string expressions.
|
||||
Parameter information is added to a temporary string, and then
|
||||
all at once to the current string. This allows loop operations
|
||||
to be written in a single string, but is slightly slower in execution time.
|
||||
|
||||
- Пусто
|
||||
|
|
|
|||
|
|
@ -0,0 +1,247 @@
|
|||
<!doctype html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SimStr Benchmarks</title>
|
||||
<style>
|
||||
body {
|
||||
margin: auto;
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px black;
|
||||
text-align: right;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
table tr:nth-child(odd) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
table tr:nth-child(even) {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
table th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tooltip a:any-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tooltip a:link {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tooltip a:visited {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tooltip a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
table tr:hover td {
|
||||
background-color: lightcyan;
|
||||
}
|
||||
|
||||
div.header {
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
canvas {
|
||||
max-width: 2000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.benchset {
|
||||
max-width: 960px;
|
||||
padding: 1px;
|
||||
margin: 5px auto;
|
||||
border-radius: 3px;
|
||||
background-color: gainsboro;
|
||||
}
|
||||
|
||||
.benchset h4 {
|
||||
text-align: left;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.test_platforms {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.test_platforms ul {
|
||||
display: table;
|
||||
}
|
||||
|
||||
.test_platforms li {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.test_platforms li:before {
|
||||
content: "\2022";
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
|
||||
.test_platforms span.tooltip {
|
||||
padding-left: 20px;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
span.platform {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.info {
|
||||
border-radius: 3px;
|
||||
border: solid 1px lightgrey;
|
||||
background-color: beige;
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.code {
|
||||
font-family: 'Cascadia Code', Consolas, 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
background-color: beige;
|
||||
color: black;
|
||||
text-align: left;
|
||||
border-radius: 6px;
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 35px;
|
||||
right: 0;
|
||||
white-space: pre;
|
||||
border: 1px solid darkgray;
|
||||
box-shadow: 4px 4px 8px 0px rgba(34, 60, 80, 0.2);
|
||||
transform: translate(50%);
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
h4 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#output {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 50px;
|
||||
right: 10px;
|
||||
bottom: 60%;
|
||||
margin: 0 auto;
|
||||
border: 0;
|
||||
display: block;
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-family: 'Cascadia Code', 'Consolas', 'Lucida Console', Monaco, monospace;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#results {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 42%;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
margin: 0 auto;
|
||||
border: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.head {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.head h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.head span {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="head">
|
||||
<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>
|
||||
<textarea id="output"></textarea>
|
||||
</div>
|
||||
<div id="results"></div>
|
||||
<script type='text/javascript'>
|
||||
var outputElement = document.getElementById('output');
|
||||
var resultEl = document.getElementById('results');
|
||||
if (outputElement) outputElement.value = ''; // clear browser cache
|
||||
var Module = {
|
||||
print(...args) {
|
||||
console.log(...args);
|
||||
try {
|
||||
var text = args.join(' ')
|
||||
var m = text.match(/^--+ +(.+?) +-+\/repeats/);
|
||||
if (m) {
|
||||
add_benchset(m[1]);
|
||||
} else {
|
||||
var im = text.indexOf("_mean ");
|
||||
if (im != -1) {
|
||||
add_benchmark(text.substr(0, im), text.match(/ ([^ ]+?) ns/)[1]);
|
||||
}
|
||||
}
|
||||
outputElement.value += text + "\n";
|
||||
outputElement.scrollTop = outputElement.scrollHeight;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
var sync = new URLSearchParams(window.location.search).get('sync');
|
||||
if (sync)
|
||||
Module.arguments = ["-sync"];
|
||||
|
||||
function on_done() {
|
||||
resultEl.scrollTop = 0;
|
||||
}
|
||||
function escapeHtml(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
function add_benchset(bs_name) {
|
||||
resultEl.insertAdjacentHTML("beforeend", `<div class="benchset"><h4>${escapeHtml(bs_name)}</h4><table width="100%"><thead><tr><th>Benchmark name</th><th width="8%">Time(ns)</th></tr></thead><tbody></tbody></table></div>`);
|
||||
resultEl.scrollTop = resultEl.scrollHeight;
|
||||
}
|
||||
function add_benchmark(name, result) {
|
||||
resultEl.querySelector("div:last-child table tbody").insertAdjacentHTML("beforeend", `<tr><td>${escapeHtml(name)}</td><td>${result}</td></tr>`);
|
||||
resultEl.scrollTop = resultEl.scrollHeight;
|
||||
}
|
||||
</script>
|
||||
{{{ SCRIPT }}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -265,6 +265,7 @@
|
|||
}
|
||||
});
|
||||
</script>
|
||||
</head><body><div class="header"><h2>SimStr benchmarks results</h2>
|
||||
</head><body><div class="header"><h2>simstr benchmarks results</h2>
|
||||
<div style="font-size:16pt;margin:20px;text-align:center"><a href="https://github.com/orefkov/simstr">simstr</a> is a powerful and convenient library for productive work with strings in C++.</div>
|
||||
<span>All times in ns.</span>
|
||||
<span><a href="https://github.com/orefkov/simstr/blob/main/bench/bench_str.cpp">Source for benchmarks</a></span>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include <fstream>
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
using namespace simstr;
|
||||
|
||||
|
|
@ -13,8 +14,10 @@ using results_vector = std::vector<result_info>;
|
|||
|
||||
bool extract_cpu_info(ssa text, ssa& res) {
|
||||
// Найдём, где начинается "Run on ", потом где за ним начинается "\n---"
|
||||
// Find where "Run on" begins, then where after it "\n---" begins
|
||||
size_t start = text.find("Run on "), end = text.find("\n---", start);
|
||||
// Если что-то не нашлось - ошибка
|
||||
// If something was not found - an error
|
||||
if (start == str::npos || end == str::npos) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -25,7 +28,7 @@ bool extract_cpu_info(ssa text, ssa& res) {
|
|||
struct result_info {
|
||||
stringa text_;
|
||||
stringa platform_;
|
||||
ssa current_text_{text_};
|
||||
ssa current_text_ = text_.to_str();
|
||||
ssa cpu_info_;
|
||||
|
||||
result_info(stringa text, stringa platform) : text_(std::move(text)), platform_(std::move(platform)) {
|
||||
|
|
@ -34,7 +37,8 @@ struct result_info {
|
|||
throw std::runtime_error{"Not found cpu info"};
|
||||
}
|
||||
// Текущее положение поставим сразу за cpuinfo и откинем завершающие переводы строк
|
||||
current_text_ = current_text_(cpu_info_.end() - current_text_.begin() + 1).trimmed_right("\n");
|
||||
// We will put the current position immediately after cpuinfo and discard the final line feeds
|
||||
current_text_ = current_text_.get(cpu_info_.end() - current_text_.begin() + 1, to_end).trimmed_right("\n");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -57,14 +61,16 @@ stringa get_file_content(stra filePath) {
|
|||
std::streamsize size = file.tellg();
|
||||
file.seekg(0, std::ios::beg);
|
||||
// Такой тип удобен для передачи потом в stringa
|
||||
// This type is convenient for later passing to stringa
|
||||
lstringsa<0> result;
|
||||
file.read(result.set_size(size), size);
|
||||
result.replace("\r\n", "\n");
|
||||
return result;
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
results_vector get_results_infos() {
|
||||
// Отберём в директории results все файлы с названиями, заканчивающимися на ".txt" и отсортируем их по имени
|
||||
// Select all files in the results directory with names ending in ".txt" and sort them by name
|
||||
const ssa suffix = ".txt", dirForResults = "results/";
|
||||
std::vector<stringa> fileNames;
|
||||
for (const auto& f: std::filesystem::directory_iterator{str_to_path(dirForResults)}) {
|
||||
|
|
@ -88,12 +94,13 @@ results_vector get_results_infos() {
|
|||
for (const auto& f : fileNames) {
|
||||
ssa fileName = f;
|
||||
// В начале имени файла может идти число и дефис, для сортировки, уберём их
|
||||
if (auto delimeter = fileName.find('-'); delimeter != str::npos && delimeter > 0) {
|
||||
if (std::get<1>(fileName(0, delimeter).to_int<unsigned, false, 10, false, false>()) == IntConvertResult::Success) {
|
||||
fileName.remove_prefix(delimeter + 1);
|
||||
// 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.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;
|
||||
|
|
@ -101,7 +108,6 @@ results_vector get_results_infos() {
|
|||
|
||||
void write_header(out_t& out) {
|
||||
out += get_file_content("header.txt");
|
||||
|
||||
}
|
||||
|
||||
void write_platforms_cpu(out_t& out, const results_vector& results) {
|
||||
|
|
@ -111,8 +117,8 @@ 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);
|
||||
out.append_formatted(R"--(
|
||||
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++);
|
||||
script += "'" + e_repl(r.platform_.to_str(), "'", "\\'") + "'" + e_choice(&r == &results.back(), "]", ",");
|
||||
|
|
@ -124,9 +130,19 @@ auto repl_html_symbols(ssa text) {
|
|||
return e_repl_const_symbols(text, '\"', """, '<', "<", '\'', "'", '&', "&");
|
||||
}
|
||||
|
||||
void write_benchset_header(out_t& out, const results_vector& results, ssa benchsetName, unsigned id) {
|
||||
void write_benchset_header(out_t& out, const results_vector& results, ssa benchsetName, unsigned benchSetId) {
|
||||
size_t hash = fnv_hash(benchsetName.symbols(), benchsetName.length());
|
||||
static std::unordered_map<size_t, int> ids;
|
||||
auto [id, _] = ids.try_emplace(hash, 0);
|
||||
if (id->second) {
|
||||
std::cout << "Duplicate hash for " << benchsetName << "\n";
|
||||
}
|
||||
int ii = id->second++;
|
||||
|
||||
size_t width = 40 / results.size();
|
||||
out += "\n\n<div class=\"benchset\" id=\"bs"_ss + id + "\"><h4>" + repl_html_symbols(benchsetName) + "</h4>\n<table><thead><tr><th>Benchmark name</th><th width=\"5%\">Comment</th>";
|
||||
out += "\n\n<div class=\"benchset\" id=\"bs"_ss + benchSetId + "\"><h4><a id=\"bs" + hash + ii + "\" href=\"#bs" +
|
||||
hash + ii + "\">#</a> " + repl_html_symbols(benchsetName) +
|
||||
"</h4>\n<table><thead><tr><th>Benchmark name</th><th width=\"5%\">Comment</th>";
|
||||
for (const auto& r : results) {
|
||||
out += "<th width=\""_ss + width + "%\">" + r.platform_ + "</th>";
|
||||
}
|
||||
|
|
@ -151,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 {
|
||||
|
|
@ -166,58 +182,69 @@ 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));
|
||||
}
|
||||
}
|
||||
return stra::empty_str;
|
||||
}
|
||||
|
||||
void write_one_result(out_t& out, ssa result, ssa line, auto& script_text, bool last) {
|
||||
void write_one_result(out_t& out, ssa result, ssa line, auto& script_text, char delim) {
|
||||
out += "<td class=\"benchmarkresult\">" + result + "</td>";
|
||||
script_text += e_choice(result[0] == 'N', "NaN", result) + e_choice(last, "]", ",");
|
||||
script_text += e_choice(result[0] == 'N', "NaN", result) + delim;
|
||||
}
|
||||
|
||||
ssa extract_source_for_benchmark(ssa benchName, ssa sourceText) {
|
||||
static hashStrMapA<stringa> textes;
|
||||
std::pair<ssa, size_t> extract_source_for_benchmark(ssa benchName, ssa sourceText) {
|
||||
static hashStrMapA<std::pair<stringa, size_t>> textes;
|
||||
static auto lines_pos = [&]() {
|
||||
std::map<size_t, size_t> l = {{0, 0}};
|
||||
size_t line = 0;
|
||||
sourceText.for_all_finded([&](size_t pos){
|
||||
l.emplace(pos, ++line);
|
||||
}, "\n");
|
||||
return l;
|
||||
}();
|
||||
|
||||
size_t delim = benchName.find_last('/');
|
||||
if (delim != str::npos && std::get<1>(benchName(delim + 1).to_int<unsigned, false, 10, false, false>()) == 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);
|
||||
auto [it, not_exist] = textes.try_emplace(benchName, stringa{}, 0);
|
||||
if (not_exist) {
|
||||
// Ищем имя функции для этого бенчмарка
|
||||
// Looking for the name of the function for this benchmark
|
||||
size_t start = sourceText.find(lstringa<128>{"->Name(\"" + e_repl(benchName, "\"", "\\\"") + "\")"});
|
||||
if (start == str::npos) {
|
||||
std::cerr << "Can not found benchmark function name for " << benchName << std::endl;
|
||||
return stra::empty_str;
|
||||
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;
|
||||
return {stra::empty_str, 0};
|
||||
}
|
||||
start++;
|
||||
size_t end = sourceText.find_first_of(")<,", start);
|
||||
ssa funcName = sourceText.from_to(start, end);
|
||||
auto [func_it, not_exist] = textes.try_emplace(funcName);
|
||||
auto [func_it, not_exist] = textes.try_emplace(funcName, stringa{}, 0);
|
||||
if (not_exist) {
|
||||
// Теперь ищем саму эту функцию
|
||||
// Now we look for this function itself
|
||||
start = sourceText.find(lstringa<128>{funcName + "(benchmark::State"});
|
||||
if (start == str::npos) {
|
||||
std::cerr << "Can not found source function " << funcName << " for benchmark " << benchName << std::endl;
|
||||
return stra::empty_str;
|
||||
return {stra::empty_str, 0};
|
||||
}
|
||||
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++;
|
||||
}
|
||||
size_t end = -1;
|
||||
// Проверим, возможно там есть переход на другую функцию через //>
|
||||
// Let's check, maybe there is a transition to another function via //>
|
||||
ssa prevLine = sourceText.from_to(sourceText.find_last('\n', start - 1) + 1, start);
|
||||
if (prevLine.starts_with("//> ")) {
|
||||
prevLine.remove_prefix(4);
|
||||
|
|
@ -233,19 +260,26 @@ ssa extract_source_for_benchmark(ssa benchName, ssa sourceText) {
|
|||
std::cerr << "Not found end of " << prevLine;
|
||||
throw std::runtime_error{"Not found end of func"};
|
||||
}
|
||||
lstringa<2048> text = expr_replaced<u8s>{sourceText.from_to(beginLine, end + indent.length() + 1), indent, "\n"};
|
||||
func_it->second = repl_html_symbols(text(1));
|
||||
lstringa<2048> text{sourceText.from_to(beginLine, end + indent.length() + 1), indent, "\n"};
|
||||
func_it->second.first = repl_html_symbols(text.get(1, to_end));
|
||||
} else {
|
||||
end = sourceText.find("\n}\n", start);
|
||||
func_it->second = repl_html_symbols(sourceText.from_to(start, end + 2));
|
||||
func_it->second.first = repl_html_symbols(sourceText.from_to(start, end + 2));
|
||||
}
|
||||
func_it->second.second = lines_pos.lower_bound(start)->second;
|
||||
}
|
||||
it->second = func_it->second;
|
||||
}
|
||||
return it->second;
|
||||
return {it->second.first, it->second.second};
|
||||
}
|
||||
|
||||
void write_benchmarks(out_t& out, const results_vector& results, ssa sourceText, ssa commentsText) {
|
||||
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"};
|
||||
}
|
||||
|
||||
std::vector<Splitter<u8s>> splitters;
|
||||
splitters.reserve(results.size());
|
||||
|
||||
|
|
@ -258,18 +292,19 @@ 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);
|
||||
auto source = extract_source_for_benchmark(benchName, sourceText);
|
||||
benchName = extract_name_result(line, result).prefix(rm);
|
||||
auto [source, line_num] = extract_source_for_benchmark(benchName, sourceText);
|
||||
auto comment = extract_comment(commentsText, benchName);
|
||||
// Нужно вывести название бенча и коммент
|
||||
out += "\n<tr><td class=\"benchmarkname\"><span class=\"tooltip\">" +
|
||||
repl_html_symbols(benchName) +
|
||||
"<span class=\"tooltiptext code\">" +
|
||||
// Need to display title and comment
|
||||
out += "\n<tr><td class=\"benchmarkname\"><span class=\"tooltip\"><a target=\"blank\" href=\"https://github.com/orefkov/simstr/blob/rel"
|
||||
+ releaseVersion + "/bench/bench_str.cpp#L" + line_num + "\">" + repl_html_symbols(benchName) +
|
||||
"</a><span class=\"tooltiptext code\">" +
|
||||
source + "</span></span></td><td>" +
|
||||
e_if(!comment.is_empty(), "<span class=\"tooltip info\"> >> <span class=\"tooltiptext\">" + comment + "</span></span>") +
|
||||
"</td>";
|
||||
script_text += e_if(needCommaForTests, "},") + "\n{name:'" + e_repl(benchName.to_str(), "'", "\\'") + "',data:[";
|
||||
write_one_result(out, result, line, script_text, result.size() == 1);
|
||||
script_text += e_if(needCommaForTests, "},") + "\n{name:'" + e_repl(benchName, "'", "\\'") + "',data:[";
|
||||
write_one_result(out, result, line, script_text, result.size() == 1 ? ']' : ',');
|
||||
|
||||
for (unsigned idx = 1; idx < results.size(); idx++) {
|
||||
if (splitters[idx].is_done()) {
|
||||
|
|
@ -277,37 +312,40 @@ 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;
|
||||
result = stra::empty_str;
|
||||
}
|
||||
}
|
||||
write_one_result(out, result, line, script_text, idx == results.size() - 1);
|
||||
write_one_result(out, result, line, script_text, idx == results.size() - 1 ? ']' : ',');
|
||||
}
|
||||
out += "</tr>";
|
||||
needCommaForTests = true;
|
||||
continue;
|
||||
} else if (line.starts_with("--") && !line.ends_with("---")) {
|
||||
// Начинается новый набор бенчмарков
|
||||
// Starts a new set of benchmarks
|
||||
if (needFooter) {
|
||||
write_benchset_footer(out, script_text);
|
||||
}
|
||||
benchName = extract_name_result(line, result);
|
||||
// Из названия набора надо удалить начальные и конечные ---
|
||||
// From the name of the set we need to remove the beginning and end ---
|
||||
benchName = benchName.from_to(benchName.find(' ') + 1, benchName.find_last(' ')).trimmed();
|
||||
write_benchset_header(out, results, benchName, ++benchSetId);
|
||||
needFooter = true;
|
||||
needCommaForTests = false;
|
||||
script_text = "bench_sets['" + e_repl(benchName.to_str(), "'", "\\'") + "'] = {id:'bs" + benchSetId +"', tests:[";
|
||||
script_text = "bench_sets['" + e_repl(benchName, "'", "\\'") + "'] = {id:'bs" + benchSetId +"', tests:[";
|
||||
}
|
||||
// Эти строки надо пропустить во всех файлах
|
||||
// These lines must be skipped in all files
|
||||
for (unsigned idx = 1; idx < results.size(); idx++) {
|
||||
if (splitters[idx].is_done()) {
|
||||
std::cerr << "Not expected end of file for " << results[idx].platform_ << std::endl;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,19 @@ table th {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.tooltip a:any-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
.tooltip a:link {
|
||||
color: black;
|
||||
}
|
||||
.tooltip a:visited {
|
||||
color: black;
|
||||
}
|
||||
.tooltip a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
table tr:hover td {
|
||||
background-color: lightcyan;
|
||||
}
|
||||
|
|
|
|||
2049
bench/results.html
2049
bench/results.html
File diff suppressed because it is too large
Load Diff
|
|
@ -1,778 +0,0 @@
|
|||
2025-08-06T14:11:08+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.49, 0.86, 0.76
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e;_mean 1.13 ns 1.13 ns 10
|
||||
std::string e;_median 1.13 ns 1.13 ns 10
|
||||
std::string e;_stddev 0.014 ns 0.014 ns 10
|
||||
std::string e;_cv 1.23 % 1.23 % 10
|
||||
std::string_view e;_mean 0.372 ns 0.372 ns 10
|
||||
std::string_view e;_median 0.373 ns 0.373 ns 10
|
||||
std::string_view e;_stddev 0.007 ns 0.007 ns 10
|
||||
std::string_view e;_cv 1.77 % 1.77 % 10
|
||||
ssa e;_mean 0.375 ns 0.375 ns 10
|
||||
ssa e;_median 0.372 ns 0.372 ns 10
|
||||
ssa e;_stddev 0.012 ns 0.012 ns 10
|
||||
ssa e;_cv 3.21 % 3.21 % 10
|
||||
stringa e;_mean 0.757 ns 0.757 ns 10
|
||||
stringa e;_median 0.753 ns 0.753 ns 10
|
||||
stringa e;_stddev 0.011 ns 0.011 ns 10
|
||||
stringa e;_cv 1.45 % 1.45 % 10
|
||||
lstringa<20> e;_mean 1.16 ns 1.16 ns 10
|
||||
lstringa<20> e;_median 1.16 ns 1.16 ns 10
|
||||
lstringa<20> e;_stddev 0.029 ns 0.029 ns 10
|
||||
lstringa<20> e;_cv 2.46 % 2.46 % 10
|
||||
lstringa<40> e;_mean 1.14 ns 1.14 ns 10
|
||||
lstringa<40> e;_median 1.14 ns 1.14 ns 10
|
||||
lstringa<40> e;_stddev 0.013 ns 0.013 ns 10
|
||||
lstringa<40> e;_cv 1.14 % 1.14 % 10
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text";_mean 1.88 ns 1.88 ns 10
|
||||
std::string e = "Test text";_median 1.88 ns 1.88 ns 10
|
||||
std::string e = "Test text";_stddev 0.017 ns 0.017 ns 10
|
||||
std::string e = "Test text";_cv 0.91 % 0.91 % 10
|
||||
std::string_view e = "Test text";_mean 0.746 ns 0.746 ns 10
|
||||
std::string_view e = "Test text";_median 0.748 ns 0.748 ns 10
|
||||
std::string_view e = "Test text";_stddev 0.008 ns 0.008 ns 10
|
||||
std::string_view e = "Test text";_cv 1.04 % 1.04 % 10
|
||||
ssa e = "Test text";_mean 0.377 ns 0.377 ns 10
|
||||
ssa e = "Test text";_median 0.373 ns 0.373 ns 10
|
||||
ssa e = "Test text";_stddev 0.017 ns 0.017 ns 10
|
||||
ssa e = "Test text";_cv 4.49 % 4.49 % 10
|
||||
stringa e = "Test text";_mean 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text";_median 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text";_stddev 0.016 ns 0.016 ns 10
|
||||
stringa e = "Test text";_cv 1.42 % 1.42 % 10
|
||||
lstringa<20> e = "Test text";_mean 1.89 ns 1.89 ns 10
|
||||
lstringa<20> e = "Test text";_median 1.90 ns 1.90 ns 10
|
||||
lstringa<20> e = "Test text";_stddev 0.030 ns 0.030 ns 10
|
||||
lstringa<20> e = "Test text";_cv 1.61 % 1.61 % 10
|
||||
lstringa<40> e = "Test text";_mean 1.90 ns 1.90 ns 10
|
||||
lstringa<40> e = "Test text";_median 1.90 ns 1.90 ns 10
|
||||
lstringa<40> e = "Test text";_stddev 0.024 ns 0.024 ns 10
|
||||
lstringa<40> e = "Test text";_cv 1.27 % 1.27 % 10
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 19.5 ns 19.5 ns 10
|
||||
std::string e = "123456789012345678901234567890";_median 19.5 ns 19.5 ns 10
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.423 ns 0.423 ns 10
|
||||
std::string e = "123456789012345678901234567890";_cv 2.17 % 2.17 % 10
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.758 ns 0.758 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.761 ns 0.761 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.012 ns 0.012 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.56 % 1.56 % 10
|
||||
ssa e = "123456789012345678901234567890";_mean 0.376 ns 0.376 ns 10
|
||||
ssa e = "123456789012345678901234567890";_median 0.375 ns 0.375 ns 10
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.009 ns 0.009 ns 10
|
||||
ssa e = "123456789012345678901234567890";_cv 2.36 % 2.36 % 10
|
||||
stringa e = "123456789012345678901234567890";_mean 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890";_median 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.015 ns 0.015 ns 10
|
||||
stringa e = "123456789012345678901234567890";_cv 1.32 % 1.32 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 20.5 ns 20.5 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 20.6 ns 20.6 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.419 ns 0.419 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 2.05 % 2.05 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 1.90 ns 1.90 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 1.90 ns 1.90 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.020 ns 0.020 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.06 % 1.06 % 10
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 5.73 ns 5.73 ns 10
|
||||
std::string e = "Test text"; auto c{e};_median 5.73 ns 5.73 ns 10
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.039 ns 0.039 ns 10
|
||||
std::string e = "Test text"; auto c{e};_cv 0.69 % 0.69 % 10
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.381 ns 0.381 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.383 ns 0.383 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.011 ns 0.011 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_cv 2.78 % 2.78 % 10
|
||||
ssa e = "Test text"; auto c{e};_mean 0.376 ns 0.376 ns 10
|
||||
ssa e = "Test text"; auto c{e};_median 0.376 ns 0.376 ns 10
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.005 ns 0.005 ns 10
|
||||
ssa e = "Test text"; auto c{e};_cv 1.44 % 1.44 % 10
|
||||
stringa e = "Test text"; auto c{e};_mean 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text"; auto c{e};_median 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.018 ns 0.018 ns 10
|
||||
stringa e = "Test text"; auto c{e};_cv 1.57 % 1.57 % 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 5.00 ns 5.00 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 4.97 ns 4.97 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.196 ns 0.196 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 3.92 % 3.92 % 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 4.62 ns 4.62 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 4.60 ns 4.60 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.087 ns 0.087 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.88 % 1.88 % 10
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 19.8 ns 19.8 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 19.7 ns 19.7 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.324 ns 0.324 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 1.64 % 1.64 % 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.763 ns 0.763 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.762 ns 0.762 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.010 ns 0.010 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.34 % 1.34 % 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.373 ns 0.373 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.374 ns 0.374 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.005 ns 0.005 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.34 % 1.34 % 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 1.14 ns 1.14 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.032 ns 0.032 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 2.85 % 2.85 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 20.2 ns 20.2 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 20.2 ns 20.2 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.221 ns 0.221 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 1.10 % 1.10 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 4.68 ns 4.68 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 4.61 ns 4.61 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.202 ns 0.202 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 4.32 % 4.32 % 10
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find;_mean 7.73 ns 7.73 ns 10
|
||||
std::string::find;_median 7.71 ns 7.71 ns 10
|
||||
std::string::find;_stddev 0.128 ns 0.128 ns 10
|
||||
std::string::find;_cv 1.66 % 1.66 % 10
|
||||
std::string_view::find;_mean 7.25 ns 7.25 ns 10
|
||||
std::string_view::find;_median 7.28 ns 7.28 ns 10
|
||||
std::string_view::find;_stddev 0.083 ns 0.083 ns 10
|
||||
std::string_view::find;_cv 1.15 % 1.15 % 10
|
||||
ssa::find;_mean 6.91 ns 6.91 ns 10
|
||||
ssa::find;_median 6.93 ns 6.93 ns 10
|
||||
ssa::find;_stddev 0.115 ns 0.115 ns 10
|
||||
ssa::find;_cv 1.66 % 1.66 % 10
|
||||
stringa::find;_mean 8.10 ns 8.10 ns 10
|
||||
stringa::find;_median 8.07 ns 8.08 ns 10
|
||||
stringa::find;_stddev 0.122 ns 0.122 ns 10
|
||||
stringa::find;_cv 1.51 % 1.51 % 10
|
||||
lstringa<20>::find;_mean 6.91 ns 6.91 ns 10
|
||||
lstringa<20>::find;_median 6.91 ns 6.91 ns 10
|
||||
lstringa<20>::find;_stddev 0.154 ns 0.154 ns 10
|
||||
lstringa<20>::find;_cv 2.23 % 2.23 % 10
|
||||
lstringa<40>::find;_mean 6.92 ns 6.92 ns 10
|
||||
lstringa<40>::find;_median 6.93 ns 6.93 ns 10
|
||||
lstringa<40>::find;_stddev 0.172 ns 0.172 ns 10
|
||||
lstringa<40>::find;_cv 2.49 % 2.49 % 10
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string copy{str_with_len_N};/15_mean 5.87 ns 5.87 ns 10
|
||||
std::string copy{str_with_len_N};/15_median 5.87 ns 5.87 ns 10
|
||||
std::string copy{str_with_len_N};/15_stddev 0.085 ns 0.085 ns 10
|
||||
std::string copy{str_with_len_N};/15_cv 1.44 % 1.44 % 10
|
||||
std::string copy{str_with_len_N};/16_mean 23.5 ns 23.5 ns 10
|
||||
std::string copy{str_with_len_N};/16_median 23.4 ns 23.4 ns 10
|
||||
std::string copy{str_with_len_N};/16_stddev 0.447 ns 0.447 ns 10
|
||||
std::string copy{str_with_len_N};/16_cv 1.91 % 1.91 % 10
|
||||
std::string copy{str_with_len_N};/23_mean 23.6 ns 23.6 ns 10
|
||||
std::string copy{str_with_len_N};/23_median 23.4 ns 23.4 ns 10
|
||||
std::string copy{str_with_len_N};/23_stddev 0.709 ns 0.709 ns 10
|
||||
std::string copy{str_with_len_N};/23_cv 3.00 % 3.00 % 10
|
||||
std::string copy{str_with_len_N};/24_mean 23.7 ns 23.7 ns 10
|
||||
std::string copy{str_with_len_N};/24_median 23.3 ns 23.3 ns 10
|
||||
std::string copy{str_with_len_N};/24_stddev 1.24 ns 1.24 ns 10
|
||||
std::string copy{str_with_len_N};/24_cv 5.26 % 5.26 % 10
|
||||
std::string copy{str_with_len_N};/32_mean 23.1 ns 23.1 ns 10
|
||||
std::string copy{str_with_len_N};/32_median 23.3 ns 23.3 ns 10
|
||||
std::string copy{str_with_len_N};/32_stddev 0.601 ns 0.601 ns 10
|
||||
std::string copy{str_with_len_N};/32_cv 2.60 % 2.60 % 10
|
||||
std::string copy{str_with_len_N};/64_mean 23.1 ns 23.1 ns 10
|
||||
std::string copy{str_with_len_N};/64_median 23.1 ns 23.1 ns 10
|
||||
std::string copy{str_with_len_N};/64_stddev 0.397 ns 0.397 ns 10
|
||||
std::string copy{str_with_len_N};/64_cv 1.72 % 1.72 % 10
|
||||
std::string copy{str_with_len_N};/128_mean 25.4 ns 25.4 ns 10
|
||||
std::string copy{str_with_len_N};/128_median 25.2 ns 25.2 ns 10
|
||||
std::string copy{str_with_len_N};/128_stddev 0.566 ns 0.566 ns 10
|
||||
std::string copy{str_with_len_N};/128_cv 2.23 % 2.23 % 10
|
||||
std::string copy{str_with_len_N};/256_mean 25.5 ns 25.5 ns 10
|
||||
std::string copy{str_with_len_N};/256_median 25.5 ns 25.5 ns 10
|
||||
std::string copy{str_with_len_N};/256_stddev 0.397 ns 0.397 ns 10
|
||||
std::string copy{str_with_len_N};/256_cv 1.55 % 1.55 % 10
|
||||
std::string copy{str_with_len_N};/512_mean 30.4 ns 30.4 ns 10
|
||||
std::string copy{str_with_len_N};/512_median 30.2 ns 30.2 ns 10
|
||||
std::string copy{str_with_len_N};/512_stddev 0.955 ns 0.955 ns 10
|
||||
std::string copy{str_with_len_N};/512_cv 3.14 % 3.14 % 10
|
||||
std::string copy{str_with_len_N};/1024_mean 39.0 ns 39.0 ns 10
|
||||
std::string copy{str_with_len_N};/1024_median 39.0 ns 39.0 ns 10
|
||||
std::string copy{str_with_len_N};/1024_stddev 0.363 ns 0.363 ns 10
|
||||
std::string copy{str_with_len_N};/1024_cv 0.93 % 0.93 % 10
|
||||
std::string copy{str_with_len_N};/2048_mean 111 ns 111 ns 10
|
||||
std::string copy{str_with_len_N};/2048_median 110 ns 110 ns 10
|
||||
std::string copy{str_with_len_N};/2048_stddev 5.75 ns 5.75 ns 10
|
||||
std::string copy{str_with_len_N};/2048_cv 5.17 % 5.17 % 10
|
||||
std::string copy{str_with_len_N};/4096_mean 142 ns 142 ns 10
|
||||
std::string copy{str_with_len_N};/4096_median 144 ns 144 ns 10
|
||||
std::string copy{str_with_len_N};/4096_stddev 7.30 ns 7.30 ns 10
|
||||
std::string copy{str_with_len_N};/4096_cv 5.14 % 5.14 % 10
|
||||
stringa copy{str_with_len_N};/15_mean 1.13 ns 1.13 ns 10
|
||||
stringa copy{str_with_len_N};/15_median 1.12 ns 1.12 ns 10
|
||||
stringa copy{str_with_len_N};/15_stddev 0.046 ns 0.046 ns 10
|
||||
stringa copy{str_with_len_N};/15_cv 4.10 % 4.10 % 10
|
||||
stringa copy{str_with_len_N};/16_mean 1.12 ns 1.12 ns 10
|
||||
stringa copy{str_with_len_N};/16_median 1.12 ns 1.12 ns 10
|
||||
stringa copy{str_with_len_N};/16_stddev 0.023 ns 0.023 ns 10
|
||||
stringa copy{str_with_len_N};/16_cv 2.04 % 2.04 % 10
|
||||
stringa copy{str_with_len_N};/23_mean 1.12 ns 1.12 ns 10
|
||||
stringa copy{str_with_len_N};/23_median 1.11 ns 1.11 ns 10
|
||||
stringa copy{str_with_len_N};/23_stddev 0.012 ns 0.012 ns 10
|
||||
stringa copy{str_with_len_N};/23_cv 1.08 % 1.08 % 10
|
||||
stringa copy{str_with_len_N};/24_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/24_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/24_stddev 0.071 ns 0.071 ns 10
|
||||
stringa copy{str_with_len_N};/24_cv 0.43 % 0.43 % 10
|
||||
stringa copy{str_with_len_N};/32_mean 16.4 ns 16.4 ns 10
|
||||
stringa copy{str_with_len_N};/32_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/32_stddev 0.212 ns 0.212 ns 10
|
||||
stringa copy{str_with_len_N};/32_cv 1.29 % 1.29 % 10
|
||||
stringa copy{str_with_len_N};/64_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/64_median 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/64_stddev 0.086 ns 0.086 ns 10
|
||||
stringa copy{str_with_len_N};/64_cv 0.53 % 0.53 % 10
|
||||
stringa copy{str_with_len_N};/128_mean 16.6 ns 16.6 ns 10
|
||||
stringa copy{str_with_len_N};/128_median 16.6 ns 16.6 ns 10
|
||||
stringa copy{str_with_len_N};/128_stddev 0.091 ns 0.091 ns 10
|
||||
stringa copy{str_with_len_N};/128_cv 0.55 % 0.55 % 10
|
||||
stringa copy{str_with_len_N};/256_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/256_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/256_stddev 0.105 ns 0.105 ns 10
|
||||
stringa copy{str_with_len_N};/256_cv 0.64 % 0.64 % 10
|
||||
stringa copy{str_with_len_N};/512_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/512_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/512_stddev 0.098 ns 0.098 ns 10
|
||||
stringa copy{str_with_len_N};/512_cv 0.60 % 0.60 % 10
|
||||
stringa copy{str_with_len_N};/1024_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/1024_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.082 ns 0.082 ns 10
|
||||
stringa copy{str_with_len_N};/1024_cv 0.50 % 0.50 % 10
|
||||
stringa copy{str_with_len_N};/2048_mean 16.4 ns 16.4 ns 10
|
||||
stringa copy{str_with_len_N};/2048_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.092 ns 0.092 ns 10
|
||||
stringa copy{str_with_len_N};/2048_cv 0.56 % 0.56 % 10
|
||||
stringa copy{str_with_len_N};/4096_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/4096_median 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.291 ns 0.291 ns 10
|
||||
stringa copy{str_with_len_N};/4096_cv 1.78 % 1.78 % 10
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 5.11 ns 5.11 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_median 5.11 ns 5.11 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.073 ns 0.073 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.43 % 1.43 % 10
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 5.12 ns 5.12 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_median 5.11 ns 5.11 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.074 ns 0.074 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.45 % 1.45 % 10
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 5.20 ns 5.20 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_median 5.19 ns 5.19 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.155 ns 0.155 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 2.98 % 2.98 % 10
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 24.3 ns 24.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_median 23.8 ns 23.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 1.58 ns 1.58 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 6.48 % 6.48 % 10
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 23.9 ns 23.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_median 23.7 ns 23.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.521 ns 0.521 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 2.18 % 2.18 % 10
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 25.8 ns 25.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_median 25.7 ns 25.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.580 ns 0.580 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 2.25 % 2.25 % 10
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 26.3 ns 26.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_median 26.1 ns 26.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.487 ns 0.487 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 1.85 % 1.85 % 10
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 27.7 ns 27.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_median 27.6 ns 27.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 0.382 ns 0.382 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 1.38 % 1.38 % 10
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 30.6 ns 30.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_median 30.6 ns 30.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 0.535 ns 0.535 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 1.75 % 1.75 % 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 85.9 ns 85.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 85.5 ns 85.5 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 5.05 ns 5.05 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 5.88 % 5.88 % 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 99.2 ns 99.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 95.0 ns 95.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 8.28 ns 8.28 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 8.34 % 8.34 % 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 118 ns 118 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 117 ns 117 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 5.73 ns 5.73 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 4.86 % 4.86 % 10
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 4.96 ns 4.96 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_median 4.97 ns 4.97 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.127 ns 0.127 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 2.57 % 2.57 % 10
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 4.95 ns 4.95 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_median 4.95 ns 4.95 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.037 ns 0.037 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 0.75 % 0.75 % 10
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 4.91 ns 4.91 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_median 4.87 ns 4.87 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.057 ns 0.057 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 1.17 % 1.17 % 10
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 4.92 ns 4.92 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_median 4.92 ns 4.92 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.070 ns 0.070 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.42 % 1.42 % 10
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 4.61 ns 4.61 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_median 4.60 ns 4.60 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.052 ns 0.052 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.12 % 1.12 % 10
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 6.14 ns 6.14 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_median 6.12 ns 6.12 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.137 ns 0.137 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 2.23 % 2.23 % 10
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 6.50 ns 6.50 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_median 6.48 ns 6.48 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.131 ns 0.131 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 2.02 % 2.02 % 10
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 8.19 ns 8.19 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_median 8.09 ns 8.09 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.353 ns 0.353 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 4.30 % 4.30 % 10
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 10.4 ns 10.4 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_median 10.5 ns 10.5 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.320 ns 0.320 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 3.07 % 3.07 % 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 87.0 ns 87.0 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 87.7 ns 87.7 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 4.05 ns 4.05 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 4.65 % 4.65 % 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 103 ns 103 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 104 ns 104 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 7.85 ns 7.85 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 7.64 % 7.64 % 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 118 ns 118 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 118 ns 118 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 2.48 ns 2.48 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 2.10 % 2.10 % 10
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 27.5 ns 27.5 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 27.5 ns 27.5 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.506 ns 0.506 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.84 % 1.84 % 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 15.2 ns 15.2 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 15.2 ns 15.2 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.228 ns 0.228 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 1.50 % 1.50 % 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.7 ns 13.7 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.7 ns 13.7 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.303 ns 0.303 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.21 % 2.21 % 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.2 ns 13.2 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.2 ns 13.2 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.187 ns 0.187 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.41 % 1.41 % 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 12.8 ns 12.8 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 12.7 ns 12.7 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.256 ns 0.256 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.00 % 2.00 % 10
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 24.2 ns 24.2 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 24.1 ns 24.1 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.548 ns 0.548 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 2.27 % 2.27 % 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 9.80 ns 9.80 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 9.83 ns 9.83 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.180 ns 0.180 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.84 % 1.84 % 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 11.8 ns 11.8 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 11.8 ns 11.8 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.179 ns 0.179 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.52 % 1.52 % 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 11.6 ns 11.6 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 11.6 ns 11.6 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.327 ns 0.327 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.83 % 2.83 % 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 11.5 ns 11.5 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 11.5 ns 11.5 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.224 ns 0.224 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.95 % 1.95 % 10
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 29.1 ns 29.1 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 29.1 ns 29.1 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.554 ns 0.554 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 1.91 % 1.91 % 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 22.1 ns 22.1 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 22.0 ns 22.0 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.224 ns 0.224 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 1.01 % 1.01 % 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 15.8 ns 15.8 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 15.8 ns 15.8 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.195 ns 0.195 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.24 % 1.24 % 10
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 1384 ns 1384 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 1388 ns 1388 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 36.8 ns 36.8 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.66 % 2.66 % 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 368 ns 368 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 372 ns 372 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 10.2 ns 10.2 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.78 % 2.78 % 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 370 ns 370 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 371 ns 371 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 7.32 ns 7.32 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 1.98 % 1.98 % 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 254 ns 254 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 254 ns 254 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 7.63 ns 7.63 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 3.01 % 3.01 % 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 232 ns 232 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 230 ns 230 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 7.81 ns 7.81 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 3.37 % 3.37 % 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 140 ns 140 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 139 ns 139 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 2.35 ns 2.35 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.68 % 1.68 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 1390 ns 1390 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 1373 ns 1373 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 61.6 ns 61.6 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 4.43 % 4.43 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 1298 ns 1298 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 1303 ns 1303 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 25.4 ns 25.4 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.95 % 1.95 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 425 ns 425 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 428 ns 428 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 8.18 ns 8.18 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.92 % 1.92 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 367 ns 367 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 362 ns 362 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 13.0 ns 13.0 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.55 % 3.55 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 323 ns 323 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 319 ns 319 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 11.6 ns 11.6 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.58 % 3.58 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 241 ns 241 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 241 ns 241 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 4.24 ns 4.24 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.76 % 1.76 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 73908 ns 73908 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 73853 ns 73853 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 761 ns 761 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 1.03 % 1.03 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 77722 ns 77722 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 77751 ns 77751 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1085 ns 1085 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.40 % 1.40 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 21112 ns 21112 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 20934 ns 20934 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 636 ns 636 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.01 % 3.01 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16124 ns 16124 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16155 ns 16155 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 368 ns 368 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.28 % 2.28 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16129 ns 16129 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16093 ns 16093 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 441 ns 441 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.74 % 2.74 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16145 ns 16145 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16117 ns 16118 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 500 ns 500 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.10 % 3.10 % 10
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 1393 ns 1393 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 1394 ns 1394 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 17.5 ns 17.5 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 1.25 % 1.25 % 10
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 1412 ns 1412 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_median 1403 ns 1403 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 31.2 ns 31.2 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 2.21 % 2.21 % 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 513 ns 513 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 513 ns 513 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 11.8 ns 11.8 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 2.30 % 2.30 % 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 443 ns 443 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 443 ns 443 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 9.72 ns 9.72 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 2.20 % 2.20 % 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 395 ns 395 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 395 ns 395 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 10.6 ns 10.6 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 2.67 % 2.67 % 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 312 ns 312 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 312 ns 312 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 4.76 ns 4.76 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 1.52 % 1.52 % 10
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 3133 ns 3133 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_median 3110 ns 3110 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 97.9 ns 97.9 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 3.12 % 3.12 % 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 486 ns 486 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 486 ns 486 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 8.54 ns 8.55 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.76 % 1.76 % 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 1424 ns 1424 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 1411 ns 1411 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 30.7 ns 30.7 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 2.16 % 2.16 % 10
|
||||
std::string str = std::format("test = {} times", k);_mean 1184 ns 1184 ns 10
|
||||
std::string str = std::format("test = {} times", k);_median 1176 ns 1176 ns 10
|
||||
std::string str = std::format("test = {} times", k);_stddev 26.6 ns 26.6 ns 10
|
||||
std::string str = std::format("test = {} times", k);_cv 2.25 % 2.25 % 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 1412 ns 1412 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 1396 ns 1396 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 46.3 ns 46.3 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 3.28 % 3.28 % 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 997 ns 997 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 996 ns 996 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 19.7 ns 19.7 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 1.98 % 1.98 % 10
|
||||
lstringa<8> str = "test = " + k + " times";_mean 323 ns 323 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_median 322 ns 322 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 12.6 ns 12.6 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_cv 3.92 % 3.92 % 10
|
||||
lstringa<32> str = "test = " + k + " times";_mean 157 ns 157 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_median 158 ns 158 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 2.50 ns 2.50 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_cv 1.59 % 1.59 % 10
|
||||
stringa str = "test = " + k + " times";_mean 152 ns 152 ns 10
|
||||
stringa str = "test = " + k + " times";_median 151 ns 151 ns 10
|
||||
stringa str = "test = " + k + " times";_stddev 3.32 ns 3.32 ns 10
|
||||
stringa str = "test = " + k + " times";_cv 2.18 % 2.18 % 10
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find + substr + std::strtol_mean 268 ns 268 ns 10
|
||||
std::string::find + substr + std::strtol_median 266 ns 266 ns 10
|
||||
std::string::find + substr + std::strtol_stddev 8.11 ns 8.11 ns 10
|
||||
std::string::find + substr + std::strtol_cv 3.03 % 3.03 % 10
|
||||
ssa::splitter + ssa::as_int_mean 161 ns 161 ns 10
|
||||
ssa::splitter + ssa::as_int_median 161 ns 161 ns 10
|
||||
ssa::splitter + ssa::as_int_stddev 2.57 ns 2.57 ns 10
|
||||
ssa::splitter + ssa::as_int_cv 1.59 % 1.59 % 10
|
||||
ssa::splitf + functor_mean 180 ns 180 ns 10
|
||||
ssa::splitf + functor_median 180 ns 180 ns 10
|
||||
ssa::splitf + functor_stddev 3.96 ns 3.96 ns 10
|
||||
ssa::splitf + functor_cv 2.20 % 2.20 % 10
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 859 ns 859 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 863 ns 863 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 15.1 ns 15.1 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 1.76 % 1.76 % 10
|
||||
replace symbols with std::string find_first_of + replace_mean 2541 ns 2541 ns 10
|
||||
replace symbols with std::string find_first_of + replace_median 2536 ns 2536 ns 10
|
||||
replace symbols with std::string find_first_of + replace_stddev 46.5 ns 46.5 ns 10
|
||||
replace symbols with std::string find_first_of + replace_cv 1.83 % 1.83 % 10
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2719 ns 2719 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_median 2686 ns 2686 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 132 ns 132 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_cv 4.86 % 4.86 % 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1253 ns 1253 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1248 ns 1248 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 19.8 ns 19.8 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 1.58 % 1.58 % 10
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1026 ns 1026 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1007 ns 1007 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 52.6 ns 52.6 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 5.13 % 5.13 % 10
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1150 ns 1150 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_median 1150 ns 1150 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 13.8 ns 13.8 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_cv 1.20 % 1.20 % 10
|
||||
replace const symbols with string expressions and memorization of all search results_mean 897 ns 897 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_median 892 ns 892 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 16.3 ns 16.3 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_cv 1.82 % 1.82 % 10
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 165 ns 165 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 165 ns 165 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 2.38 ns 2.38 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.44 % 1.44 % 10
|
||||
Short replace symbols with std::string find_first_of + replace_mean 312 ns 312 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_median 312 ns 312 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 4.94 ns 4.94 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.58 % 1.58 % 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 338 ns 338 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 339 ns 339 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 4.87 ns 4.87 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 1.44 % 1.44 % 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 165 ns 165 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 166 ns 166 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 2.88 ns 2.88 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.74 % 1.74 % 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 188 ns 188 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 185 ns 185 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 5.08 ns 5.08 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 2.71 % 2.71 % 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 146 ns 146 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 145 ns 145 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 4.26 ns 4.26 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 2.93 % 2.93 % 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 150 ns 150 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 148 ns 148 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 6.96 ns 6.96 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 4.65 % 4.65 % 10
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to ---- in std::string|64_mean 161 ns 161 ns 10
|
||||
replace bb to ---- in std::string|64_median 162 ns 162 ns 10
|
||||
replace bb to ---- in std::string|64_stddev 3.66 ns 3.66 ns 10
|
||||
replace bb to ---- in std::string|64_cv 2.27 % 2.27 % 10
|
||||
replace bb to ---- in std::string|256_mean 541 ns 541 ns 10
|
||||
replace bb to ---- in std::string|256_median 543 ns 543 ns 10
|
||||
replace bb to ---- in std::string|256_stddev 7.23 ns 7.23 ns 10
|
||||
replace bb to ---- in std::string|256_cv 1.33 % 1.33 % 10
|
||||
replace bb to ---- in std::string|512_mean 1075 ns 1075 ns 10
|
||||
replace bb to ---- in std::string|512_median 1065 ns 1065 ns 10
|
||||
replace bb to ---- in std::string|512_stddev 29.7 ns 29.7 ns 10
|
||||
replace bb to ---- in std::string|512_cv 2.77 % 2.77 % 10
|
||||
replace bb to ---- in std::string|1024_mean 2344 ns 2344 ns 10
|
||||
replace bb to ---- in std::string|1024_median 2329 ns 2329 ns 10
|
||||
replace bb to ---- in std::string|1024_stddev 107 ns 107 ns 10
|
||||
replace bb to ---- in std::string|1024_cv 4.57 % 4.57 % 10
|
||||
replace bb to ---- in std::string|2048_mean 6366 ns 6366 ns 10
|
||||
replace bb to ---- in std::string|2048_median 6592 ns 6592 ns 10
|
||||
replace bb to ---- in std::string|2048_stddev 444 ns 444 ns 10
|
||||
replace bb to ---- in std::string|2048_cv 6.97 % 6.97 % 10
|
||||
replace bb to ---- in lstringa<8>|64_mean 145 ns 145 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_median 144 ns 144 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_stddev 3.85 ns 3.85 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.66 % 2.66 % 10
|
||||
replace bb to ---- in lstringa<8>|256_mean 438 ns 438 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_median 438 ns 438 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_stddev 7.46 ns 7.46 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_cv 1.70 % 1.70 % 10
|
||||
replace bb to ---- in lstringa<8>|512_mean 824 ns 824 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_median 820 ns 820 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_stddev 29.8 ns 29.8 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_cv 3.62 % 3.62 % 10
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1662 ns 1662 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_median 1661 ns 1661 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 28.8 ns 28.8 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.73 % 1.73 % 10
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3108 ns 3108 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_median 3101 ns 3101 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 44.7 ns 44.7 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_cv 1.44 % 1.44 % 10
|
||||
replace bb to ---- by init stringa|64_mean 116 ns 116 ns 10
|
||||
replace bb to ---- by init stringa|64_median 116 ns 116 ns 10
|
||||
replace bb to ---- by init stringa|64_stddev 4.03 ns 4.03 ns 10
|
||||
replace bb to ---- by init stringa|64_cv 3.46 % 3.46 % 10
|
||||
replace bb to ---- by init stringa|256_mean 389 ns 389 ns 10
|
||||
replace bb to ---- by init stringa|256_median 387 ns 387 ns 10
|
||||
replace bb to ---- by init stringa|256_stddev 8.05 ns 8.05 ns 10
|
||||
replace bb to ---- by init stringa|256_cv 2.07 % 2.07 % 10
|
||||
replace bb to ---- by init stringa|512_mean 797 ns 797 ns 10
|
||||
replace bb to ---- by init stringa|512_median 794 ns 794 ns 10
|
||||
replace bb to ---- by init stringa|512_stddev 18.1 ns 18.1 ns 10
|
||||
replace bb to ---- by init stringa|512_cv 2.27 % 2.27 % 10
|
||||
replace bb to ---- by init stringa|1024_mean 1629 ns 1629 ns 10
|
||||
replace bb to ---- by init stringa|1024_median 1606 ns 1606 ns 10
|
||||
replace bb to ---- by init stringa|1024_stddev 68.9 ns 68.9 ns 10
|
||||
replace bb to ---- by init stringa|1024_cv 4.23 % 4.23 % 10
|
||||
replace bb to ---- by init stringa|2048_mean 3125 ns 3125 ns 10
|
||||
replace bb to ---- by init stringa|2048_median 3104 ns 3104 ns 10
|
||||
replace bb to ---- by init stringa|2048_stddev 76.1 ns 76.1 ns 10
|
||||
replace bb to ---- by init stringa|2048_cv 2.43 % 2.43 % 10
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to -- in std::string|64_mean 129 ns 129 ns 10
|
||||
replace bb to -- in std::string|64_median 128 ns 128 ns 10
|
||||
replace bb to -- in std::string|64_stddev 2.39 ns 2.39 ns 10
|
||||
replace bb to -- in std::string|64_cv 1.85 % 1.85 % 10
|
||||
replace bb to -- in std::string|256_mean 404 ns 404 ns 10
|
||||
replace bb to -- in std::string|256_median 404 ns 404 ns 10
|
||||
replace bb to -- in std::string|256_stddev 8.73 ns 8.73 ns 10
|
||||
replace bb to -- in std::string|256_cv 2.16 % 2.16 % 10
|
||||
replace bb to -- in std::string|512_mean 815 ns 815 ns 10
|
||||
replace bb to -- in std::string|512_median 818 ns 818 ns 10
|
||||
replace bb to -- in std::string|512_stddev 13.4 ns 13.4 ns 10
|
||||
replace bb to -- in std::string|512_cv 1.65 % 1.65 % 10
|
||||
replace bb to -- in std::string|1024_mean 1489 ns 1489 ns 10
|
||||
replace bb to -- in std::string|1024_median 1486 ns 1486 ns 10
|
||||
replace bb to -- in std::string|1024_stddev 31.5 ns 31.5 ns 10
|
||||
replace bb to -- in std::string|1024_cv 2.12 % 2.12 % 10
|
||||
replace bb to -- in std::string|2048_mean 3100 ns 3100 ns 10
|
||||
replace bb to -- in std::string|2048_median 3097 ns 3097 ns 10
|
||||
replace bb to -- in std::string|2048_stddev 70.1 ns 70.1 ns 10
|
||||
replace bb to -- in std::string|2048_cv 2.26 % 2.26 % 10
|
||||
replace bb to -- in lstringa<8>|64_mean 101 ns 101 ns 10
|
||||
replace bb to -- in lstringa<8>|64_median 102 ns 102 ns 10
|
||||
replace bb to -- in lstringa<8>|64_stddev 1.73 ns 1.73 ns 10
|
||||
replace bb to -- in lstringa<8>|64_cv 1.70 % 1.70 % 10
|
||||
replace bb to -- in lstringa<8>|256_mean 302 ns 302 ns 10
|
||||
replace bb to -- in lstringa<8>|256_median 301 ns 301 ns 10
|
||||
replace bb to -- in lstringa<8>|256_stddev 8.49 ns 8.49 ns 10
|
||||
replace bb to -- in lstringa<8>|256_cv 2.81 % 2.81 % 10
|
||||
replace bb to -- in lstringa<8>|512_mean 579 ns 579 ns 10
|
||||
replace bb to -- in lstringa<8>|512_median 562 ns 562 ns 10
|
||||
replace bb to -- in lstringa<8>|512_stddev 51.0 ns 51.0 ns 10
|
||||
replace bb to -- in lstringa<8>|512_cv 8.81 % 8.81 % 10
|
||||
replace bb to -- in lstringa<8>|1024_mean 1181 ns 1181 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_median 1166 ns 1166 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_stddev 58.8 ns 58.8 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_cv 4.98 % 4.98 % 10
|
||||
replace bb to -- in lstringa<8>|2048_mean 2181 ns 2181 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_median 2186 ns 2186 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_stddev 42.1 ns 42.1 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.93 % 1.93 % 10
|
||||
replace bb to -- by init stringa|64_mean 82.9 ns 82.9 ns 10
|
||||
replace bb to -- by init stringa|64_median 82.6 ns 82.6 ns 10
|
||||
replace bb to -- by init stringa|64_stddev 1.53 ns 1.53 ns 10
|
||||
replace bb to -- by init stringa|64_cv 1.84 % 1.84 % 10
|
||||
replace bb to -- by init stringa|256_mean 219 ns 219 ns 10
|
||||
replace bb to -- by init stringa|256_median 218 ns 218 ns 10
|
||||
replace bb to -- by init stringa|256_stddev 2.33 ns 2.33 ns 10
|
||||
replace bb to -- by init stringa|256_cv 1.07 % 1.07 % 10
|
||||
replace bb to -- by init stringa|512_mean 447 ns 447 ns 10
|
||||
replace bb to -- by init stringa|512_median 448 ns 448 ns 10
|
||||
replace bb to -- by init stringa|512_stddev 5.79 ns 5.79 ns 10
|
||||
replace bb to -- by init stringa|512_cv 1.30 % 1.30 % 10
|
||||
replace bb to -- by init stringa|1024_mean 880 ns 880 ns 10
|
||||
replace bb to -- by init stringa|1024_median 877 ns 877 ns 10
|
||||
replace bb to -- by init stringa|1024_stddev 19.6 ns 19.6 ns 10
|
||||
replace bb to -- by init stringa|1024_cv 2.23 % 2.23 % 10
|
||||
replace bb to -- by init stringa|2048_mean 1654 ns 1654 ns 10
|
||||
replace bb to -- by init stringa|2048_median 1647 ns 1647 ns 10
|
||||
replace bb to -- by init stringa|2048_stddev 38.5 ns 38.5 ns 10
|
||||
replace bb to -- by init stringa|2048_cv 2.33 % 2.33 % 10
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3718900 ns 3718917 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3693440 ns 3693461 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 53764 ns 53763 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 1.45 % 1.45 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3691442 ns 3691453 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3673099 ns 3673111 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 139694 ns 139694 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 3.78 % 3.78 % 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3719844 ns 3719860 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3711079 ns 3711094 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 26128 ns 26129 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 0.70 % 0.70 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4115786 ns 4115803 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4138618 ns 4138635 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 84101 ns 84103 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 2.04 % 2.04 % 10
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Build func full name std::string;_mean 733 ns 733 ns 10
|
||||
Build func full name std::string;_median 733 ns 733 ns 10
|
||||
Build func full name std::string;_stddev 10.6 ns 10.6 ns 10
|
||||
Build func full name std::string;_cv 1.44 % 1.44 % 10
|
||||
Build func full name std::string 1;_mean 837 ns 837 ns 10
|
||||
Build func full name std::string 1;_median 832 ns 832 ns 10
|
||||
Build func full name std::string 1;_stddev 20.2 ns 20.2 ns 10
|
||||
Build func full name std::string 1;_cv 2.41 % 2.41 % 10
|
||||
Build func full name std::stream;_mean 2608 ns 2608 ns 10
|
||||
Build func full name std::stream;_median 2618 ns 2618 ns 10
|
||||
Build func full name std::stream;_stddev 46.4 ns 46.4 ns 10
|
||||
Build func full name std::stream;_cv 1.78 % 1.78 % 10
|
||||
Build func full name stringa;_mean 512 ns 512 ns 10
|
||||
Build func full name stringa;_median 509 ns 509 ns 10
|
||||
Build func full name stringa;_stddev 7.69 ns 7.69 ns 10
|
||||
Build func full name stringa;_cv 1.50 % 1.50 % 10
|
||||
Build func full name stringa 1;_mean 657 ns 657 ns 10
|
||||
Build func full name stringa 1;_median 656 ns 656 ns 10
|
||||
Build func full name stringa 1;_stddev 11.9 ns 11.9 ns 10
|
||||
Build func full name stringa 1;_cv 1.80 % 1.80 % 10
|
||||
|
|
@ -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
|
||||
2026-03-22T13:18:22+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.20, 0.67, 0.53
|
||||
***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 167 ns 167 ns 4
|
||||
Concat email std::format_median 166 ns 166 ns 4
|
||||
Concat email std::format_stddev 2.04 ns 2.04 ns 4
|
||||
Concat email std::format_cv 1.22 % 1.22 % 4
|
||||
Concat email std::stringstream_mean 379 ns 379 ns 4
|
||||
Concat email std::stringstream_median 379 ns 379 ns 4
|
||||
Concat email std::stringstream_stddev 2.80 ns 2.80 ns 4
|
||||
Concat email std::stringstream_cv 0.74 % 0.74 % 4
|
||||
Concat email stringzilla append_mean 143 ns 143 ns 4
|
||||
Concat email stringzilla append_median 142 ns 142 ns 4
|
||||
Concat email stringzilla append_stddev 4.40 ns 4.40 ns 4
|
||||
Concat email stringzilla append_cv 3.07 % 3.07 % 4
|
||||
Concat email stringzilla concat_mean 54.6 ns 54.6 ns 4
|
||||
Concat email stringzilla concat_median 54.3 ns 54.3 ns 4
|
||||
Concat email stringzilla concat_stddev 1.36 ns 1.36 ns 4
|
||||
Concat email stringzilla concat_cv 2.50 % 2.50 % 4
|
||||
Concat email std::string append_mean 73.9 ns 73.9 ns 4
|
||||
Concat email std::string append_median 74.2 ns 74.2 ns 4
|
||||
Concat email std::string append_stddev 0.919 ns 0.919 ns 4
|
||||
Concat email std::string append_cv 1.24 % 1.24 % 4
|
||||
Concat email std::string by strexpr_mean 46.8 ns 46.8 ns 4
|
||||
Concat email std::string by strexpr_median 47.4 ns 47.4 ns 4
|
||||
Concat email std::string by strexpr_stddev 1.39 ns 1.39 ns 4
|
||||
Concat email std::string by strexpr_cv 2.96 % 2.96 % 4
|
||||
Concat email stringa_mean 39.1 ns 39.1 ns 4
|
||||
Concat email stringa_median 38.9 ns 38.9 ns 4
|
||||
Concat email stringa_stddev 0.543 ns 0.543 ns 4
|
||||
Concat email stringa_cv 1.39 % 1.39 % 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 223 ns 223 ns 4
|
||||
Concat std::string and number by std to std::string_median 223 ns 223 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 3.04 ns 3.04 ns 4
|
||||
Concat std::string and number by std to std::string_cv 1.36 % 1.36 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 105 ns 105 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 106 ns 106 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 2.70 ns 2.70 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 2.56 % 2.56 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 64.9 ns 64.9 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 64.8 ns 64.8 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 0.353 ns 0.353 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 0.54 % 0.54 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 72.3 ns 72.3 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 71.9 ns 71.9 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 1.59 ns 1.59 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 2.20 % 2.20 % 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 696 ns 696 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 699 ns 699 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 9.35 ns 9.34 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 1.34 % 1.34 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 828 ns 828 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 827 ns 827 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 25.8 ns 25.8 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 3.11 % 3.11 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 210 ns 210 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 210 ns 210 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 3.35 ns 3.35 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.60 % 1.60 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 134 ns 134 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 134 ns 134 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 1.42 ns 1.42 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 1.06 % 1.06 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 117 ns 117 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 118 ns 118 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 0.602 ns 0.602 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 0.51 % 0.51 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 128 ns 128 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 126 ns 126 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 4.95 ns 4.95 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 3.87 % 3.87 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 193 ns 193 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 187 ns 187 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 13.1 ns 13.1 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 6.78 % 6.78 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 333 ns 333 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 324 ns 324 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 29.5 ns 29.5 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 8.88 % 8.88 % 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 271 ns 271 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 271 ns 271 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 1.20 ns 1.20 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 0.44 % 0.44 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 357 ns 357 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 357 ns 357 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 1.91 ns 1.91 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 0.54 % 0.54 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 621 ns 621 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 607 ns 607 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 47.0 ns 47.0 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 7.56 % 7.56 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 723 ns 723 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 722 ns 722 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 12.0 ns 12.0 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 1.66 % 1.66 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 842 ns 842 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 840 ns 840 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 27.2 ns 27.2 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 3.22 % 3.22 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 1017 ns 1017 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 1011 ns 1011 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 11.7 ns 11.7 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.15 % 1.15 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 999 ns 999 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 994 ns 994 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 24.6 ns 24.6 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 2.46 % 2.46 % 4
|
||||
std::format with std::formatted_size_mean 1867 ns 1867 ns 4
|
||||
std::format with std::formatted_size_median 1881 ns 1881 ns 4
|
||||
std::format with std::formatted_size_stddev 33.7 ns 33.7 ns 4
|
||||
std::format with std::formatted_size_cv 1.80 % 1.80 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 2074 ns 2074 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 2074 ns 2074 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 6.88 ns 6.87 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 0.33 % 0.33 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 51.7 ns 51.7 ns 4
|
||||
Concat std::string by std to std::string_median 51.6 ns 51.6 ns 4
|
||||
Concat std::string by std to std::string_stddev 0.623 ns 0.623 ns 4
|
||||
Concat std::string by std to std::string_cv 1.21 % 1.21 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 36.9 ns 36.9 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 36.8 ns 36.8 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 0.272 ns 0.272 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 0.74 % 0.74 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 31.6 ns 31.6 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 31.8 ns 31.8 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 0.842 ns 0.842 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 2.66 % 2.66 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 112 ns 112 ns 4
|
||||
Find concat three std::string_median 112 ns 112 ns 4
|
||||
Find concat three std::string_stddev 2.70 ns 2.70 ns 4
|
||||
Find concat three std::string_cv 2.41 % 2.41 % 4
|
||||
Find concat three strexpr_mean 52.4 ns 52.4 ns 4
|
||||
Find concat three strexpr_median 52.6 ns 52.6 ns 4
|
||||
Find concat three strexpr_stddev 2.35 ns 2.35 ns 4
|
||||
Find concat three strexpr_cv 4.48 % 4.48 % 4
|
||||
Find concat three simstr_mean 18.9 ns 18.9 ns 4
|
||||
Find concat three simstr_median 18.8 ns 18.8 ns 4
|
||||
Find concat three simstr_stddev 0.278 ns 0.278 ns 4
|
||||
Find concat three simstr_cv 1.47 % 1.47 % 4
|
||||
Find concat three stringzilla string_mean 153 ns 153 ns 4
|
||||
Find concat three stringzilla string_median 153 ns 153 ns 4
|
||||
Find concat three stringzilla string_stddev 1.37 ns 1.37 ns 4
|
||||
Find concat three stringzilla string_cv 0.90 % 0.90 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 7.58 ns 7.58 ns 4
|
||||
BuildTypeNameStr 0/0_median 7.65 ns 7.65 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.170 ns 0.170 ns 4
|
||||
BuildTypeNameStr 0/0_cv 2.25 % 2.25 % 4
|
||||
BuildTypeNameExp 0/0_mean 6.94 ns 6.94 ns 4
|
||||
BuildTypeNameExp 0/0_median 6.94 ns 6.94 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.141 ns 0.141 ns 4
|
||||
BuildTypeNameExp 0/0_cv 2.03 % 2.03 % 4
|
||||
BuildTypeNameSim 0/0_mean 5.03 ns 5.03 ns 4
|
||||
BuildTypeNameSim 0/0_median 5.02 ns 5.02 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.096 ns 0.096 ns 4
|
||||
BuildTypeNameSim 0/0_cv 1.91 % 1.91 % 4
|
||||
BuildTypeNameStr 10/10_mean 59.1 ns 59.1 ns 4
|
||||
BuildTypeNameStr 10/10_median 59.0 ns 59.0 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 2.58 ns 2.58 ns 4
|
||||
BuildTypeNameStr 10/10_cv 4.37 % 4.37 % 4
|
||||
BuildTypeNameExp 10/10_mean 31.0 ns 31.0 ns 4
|
||||
BuildTypeNameExp 10/10_median 31.1 ns 31.1 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 0.361 ns 0.361 ns 4
|
||||
BuildTypeNameExp 10/10_cv 1.16 % 1.16 % 4
|
||||
BuildTypeNameSim 10/10_mean 23.4 ns 23.4 ns 4
|
||||
BuildTypeNameSim 10/10_median 23.5 ns 23.5 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 0.470 ns 0.470 ns 4
|
||||
BuildTypeNameSim 10/10_cv 2.01 % 2.01 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 210 ns 210 ns 4
|
||||
Concat with replace str_median 209 ns 209 ns 4
|
||||
Concat with replace str_stddev 4.51 ns 4.51 ns 4
|
||||
Concat with replace str_cv 2.14 % 2.14 % 4
|
||||
Concat with replace exp_mean 154 ns 154 ns 4
|
||||
Concat with replace exp_median 154 ns 154 ns 4
|
||||
Concat with replace exp_stddev 1.87 ns 1.87 ns 4
|
||||
Concat with replace exp_cv 1.22 % 1.22 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 1.13 ns 1.13 ns 4
|
||||
std::string e;_median 1.14 ns 1.14 ns 4
|
||||
std::string e;_stddev 0.019 ns 0.019 ns 4
|
||||
std::string e;_cv 1.68 % 1.68 % 4
|
||||
std::string_view e;_mean 0.377 ns 0.377 ns 4
|
||||
std::string_view e;_median 0.377 ns 0.377 ns 4
|
||||
std::string_view e;_stddev 0.006 ns 0.006 ns 4
|
||||
std::string_view e;_cv 1.57 % 1.57 % 4
|
||||
ssa e;_mean 0.372 ns 0.372 ns 4
|
||||
ssa e;_median 0.371 ns 0.371 ns 4
|
||||
ssa e;_stddev 0.005 ns 0.005 ns 4
|
||||
ssa e;_cv 1.34 % 1.34 % 4
|
||||
stringa e;_mean 0.763 ns 0.763 ns 4
|
||||
stringa e;_median 0.759 ns 0.759 ns 4
|
||||
stringa e;_stddev 0.012 ns 0.012 ns 4
|
||||
stringa e;_cv 1.61 % 1.61 % 4
|
||||
lstringa<20> e;_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<20> e;_median 1.13 ns 1.13 ns 4
|
||||
lstringa<20> e;_stddev 0.015 ns 0.015 ns 4
|
||||
lstringa<20> e;_cv 1.36 % 1.36 % 4
|
||||
lstringa<40> e;_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<40> e;_median 1.12 ns 1.12 ns 4
|
||||
lstringa<40> e;_stddev 0.026 ns 0.026 ns 4
|
||||
lstringa<40> e;_cv 2.27 % 2.27 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 1.87 ns 1.87 ns 4
|
||||
std::string e = "Test text";_median 1.87 ns 1.87 ns 4
|
||||
std::string e = "Test text";_stddev 0.027 ns 0.027 ns 4
|
||||
std::string e = "Test text";_cv 1.46 % 1.46 % 4
|
||||
std::string_view e = "Test text";_mean 0.761 ns 0.761 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.36 % 1.36 % 4
|
||||
ssa e = "Test text";_mean 0.382 ns 0.382 ns 4
|
||||
ssa e = "Test text";_median 0.382 ns 0.382 ns 4
|
||||
ssa e = "Test text";_stddev 0.005 ns 0.005 ns 4
|
||||
ssa e = "Test text";_cv 1.41 % 1.41 % 4
|
||||
stringa e = "Test text";_mean 1.15 ns 1.15 ns 4
|
||||
stringa e = "Test text";_median 1.14 ns 1.14 ns 4
|
||||
stringa e = "Test text";_stddev 0.029 ns 0.029 ns 4
|
||||
stringa e = "Test text";_cv 2.50 % 2.50 % 4
|
||||
lstringa<20> e = "Test text";_mean 1.90 ns 1.90 ns 4
|
||||
lstringa<20> e = "Test text";_median 1.90 ns 1.90 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.045 ns 0.045 ns 4
|
||||
lstringa<20> e = "Test text";_cv 2.37 % 2.36 % 4
|
||||
lstringa<40> e = "Test text";_mean 1.88 ns 1.88 ns 4
|
||||
lstringa<40> e = "Test text";_median 1.87 ns 1.87 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.046 ns 0.046 ns 4
|
||||
lstringa<40> e = "Test text";_cv 2.46 % 2.46 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 19.5 ns 19.5 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 19.3 ns 19.3 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.398 ns 0.398 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 2.04 % 2.04 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.763 ns 0.763 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.764 ns 0.764 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.008 ns 0.008 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.10 % 1.10 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 0.375 ns 0.375 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 0.374 ns 0.374 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.005 ns 0.005 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 1.45 % 1.45 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 1.14 ns 1.14 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 1.13 ns 1.13 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.024 ns 0.024 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 2.13 % 2.13 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 18.0 ns 18.0 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 18.0 ns 18.0 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.581 ns 0.581 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 3.22 % 3.22 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 2.68 ns 2.68 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 2.67 ns 2.67 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.020 ns 0.020 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 0.73 % 0.73 % 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 5.77 ns 5.77 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 5.75 ns 5.75 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.095 ns 0.095 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 1.64 % 1.64 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.388 ns 0.388 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.379 ns 0.379 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.022 ns 0.022 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 5.79 % 5.79 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 0.380 ns 0.380 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 0.382 ns 0.382 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.005 ns 0.005 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 1.43 % 1.43 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 1.12 ns 1.12 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 1.12 ns 1.12 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.016 ns 0.016 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 1.46 % 1.46 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 1.13 ns 1.13 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.024 ns 0.024 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 2.13 % 2.13 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.014 ns 0.014 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.19 % 1.19 % 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 20.2 ns 20.2 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 20.2 ns 20.2 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.353 ns 0.353 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 1.75 % 1.75 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.758 ns 0.758 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.754 ns 0.755 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.009 ns 0.009 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.19 % 1.19 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.374 ns 0.374 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.374 ns 0.374 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.002 ns 0.002 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 0.58 % 0.59 % 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.014 ns 0.014 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.23 % 1.23 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 19.1 ns 19.1 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 19.1 ns 19.1 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.086 ns 0.086 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 0.45 % 0.45 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 4.98 ns 4.98 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 5.03 ns 5.03 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.146 ns 0.146 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 2.94 % 2.94 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 95.9 ns 95.9 ns 4
|
||||
sz::string::find;_median 95.8 ns 95.8 ns 4
|
||||
sz::string::find;_stddev 1.48 ns 1.48 ns 4
|
||||
sz::string::find;_cv 1.54 % 1.54 % 4
|
||||
std::string::find;_mean 7.34 ns 7.34 ns 4
|
||||
std::string::find;_median 7.33 ns 7.33 ns 4
|
||||
std::string::find;_stddev 0.128 ns 0.128 ns 4
|
||||
std::string::find;_cv 1.75 % 1.75 % 4
|
||||
std::string_view::find;_mean 7.81 ns 7.81 ns 4
|
||||
std::string_view::find;_median 7.78 ns 7.78 ns 4
|
||||
std::string_view::find;_stddev 0.124 ns 0.124 ns 4
|
||||
std::string_view::find;_cv 1.59 % 1.59 % 4
|
||||
ssa::find;_mean 7.37 ns 7.37 ns 4
|
||||
ssa::find;_median 7.37 ns 7.37 ns 4
|
||||
ssa::find;_stddev 0.149 ns 0.149 ns 4
|
||||
ssa::find;_cv 2.02 % 2.02 % 4
|
||||
stringa::find;_mean 8.14 ns 8.14 ns 4
|
||||
stringa::find;_median 8.14 ns 8.14 ns 4
|
||||
stringa::find;_stddev 0.027 ns 0.027 ns 4
|
||||
stringa::find;_cv 0.33 % 0.33 % 4
|
||||
lstringa<20>::find;_mean 6.94 ns 6.94 ns 4
|
||||
lstringa<20>::find;_median 6.90 ns 6.90 ns 4
|
||||
lstringa<20>::find;_stddev 0.118 ns 0.118 ns 4
|
||||
lstringa<20>::find;_cv 1.70 % 1.70 % 4
|
||||
lstringa<40>::find;_mean 6.93 ns 6.93 ns 4
|
||||
lstringa<40>::find;_median 6.92 ns 6.92 ns 4
|
||||
lstringa<40>::find;_stddev 0.091 ns 0.091 ns 4
|
||||
lstringa<40>::find;_cv 1.31 % 1.31 % 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 5.78 ns 5.78 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 5.78 ns 5.78 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 0.153 ns 0.153 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 2.64 % 2.64 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 24.5 ns 24.5 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 24.6 ns 24.6 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 1.08 ns 1.08 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 4.42 % 4.42 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 28.5 ns 28.5 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 28.6 ns 28.6 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 0.346 ns 0.346 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 1.21 % 1.21 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 23.3 ns 23.3 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 23.3 ns 23.3 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 0.222 ns 0.222 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 0.95 % 0.95 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 23.2 ns 23.2 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 23.3 ns 23.3 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 0.377 ns 0.377 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 1.62 % 1.62 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 23.3 ns 23.3 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 23.3 ns 23.3 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 0.320 ns 0.320 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 1.37 % 1.37 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 24.9 ns 24.9 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 24.9 ns 24.9 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 0.584 ns 0.584 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 2.34 % 2.34 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 26.0 ns 26.0 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 25.3 ns 25.3 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 1.69 ns 1.69 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 6.53 % 6.53 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 29.4 ns 29.4 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 29.5 ns 29.5 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 0.683 ns 0.683 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 2.32 % 2.32 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 47.7 ns 47.7 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 47.8 ns 47.8 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 0.457 ns 0.457 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 0.96 % 0.96 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 125 ns 125 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 125 ns 125 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 3.96 ns 3.96 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 3.17 % 3.17 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 152 ns 152 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 154 ns 154 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 4.76 ns 4.76 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 3.13 % 3.13 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 1.12 ns 1.12 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 1.12 ns 1.12 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.013 ns 0.013 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 1.17 % 1.17 % 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.12 ns 1.12 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.021 ns 0.021 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.88 % 1.88 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 1.12 ns 1.12 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 1.12 ns 1.12 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.019 ns 0.019 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 1.67 % 1.67 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.135 ns 0.135 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 0.82 % 0.82 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.180 ns 0.180 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 1.10 % 1.10 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 16.3 ns 16.3 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.113 ns 0.113 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 0.69 % 0.69 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.085 ns 0.085 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 0.52 % 0.52 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.068 ns 0.068 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.42 % 0.42 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.072 ns 0.072 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 0.44 % 0.44 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.069 ns 0.069 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 0.42 % 0.42 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.041 ns 0.041 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.25 % 0.25 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.080 ns 0.080 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 0.49 % 0.49 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 1.13 ns 1.13 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.024 ns 0.024 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 2.09 % 2.09 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 5.10 ns 5.10 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 5.10 ns 5.10 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.076 ns 0.076 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.49 % 1.49 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 5.16 ns 5.16 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 5.14 ns 5.14 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.062 ns 0.062 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.21 % 1.21 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 21.9 ns 21.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 22.0 ns 22.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 0.377 ns 0.377 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 1.72 % 1.72 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 22.1 ns 22.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 22.0 ns 22.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.310 ns 0.310 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 1.41 % 1.41 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 23.4 ns 23.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 23.3 ns 23.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.348 ns 0.348 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 1.49 % 1.49 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 24.5 ns 24.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 24.6 ns 24.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.410 ns 0.410 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 1.67 % 1.67 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 25.4 ns 25.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 25.4 ns 25.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 0.347 ns 0.347 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 28.6 ns 28.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 28.6 ns 28.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 0.490 ns 0.490 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 1.71 % 1.71 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 98.9 ns 98.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 97.3 ns 97.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 5.56 ns 5.56 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 5.62 % 5.62 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 103 ns 103 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 103 ns 103 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 1.53 ns 1.53 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 1.48 % 1.48 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 122 ns 122 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 121 ns 121 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 5.22 ns 5.22 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 4.29 % 4.29 % 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.13 ns 1.13 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.011 ns 0.011 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 0.95 % 0.95 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 5.00 ns 5.00 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 5.05 ns 5.05 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.126 ns 0.126 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 2.52 % 2.52 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 4.92 ns 4.92 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 4.87 ns 4.87 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.113 ns 0.113 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 2.30 % 2.30 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 29.6 ns 29.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 29.5 ns 29.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.353 ns 0.353 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.19 % 1.19 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 29.6 ns 29.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 29.6 ns 29.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.133 ns 0.133 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 0.45 % 0.45 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 30.2 ns 30.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 30.2 ns 30.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.095 ns 0.095 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 0.31 % 0.31 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 30.5 ns 30.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 30.5 ns 30.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.108 ns 0.108 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 0.35 % 0.35 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 21.7 ns 21.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 21.7 ns 21.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.257 ns 0.257 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.19 % 1.19 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 24.7 ns 24.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 24.6 ns 24.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.267 ns 0.267 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.08 % 1.08 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 96.9 ns 96.9 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 96.8 ns 96.8 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 1.87 ns 1.87 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 1.93 % 1.93 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 106 ns 106 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 107 ns 107 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 2.33 ns 2.33 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.20 % 2.20 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 123 ns 123 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 123 ns 123 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 1.45 ns 1.45 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 1.19 % 1.19 % 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 26.9 ns 26.9 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 26.9 ns 26.9 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.215 ns 0.215 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 0.80 % 0.80 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 14.9 ns 14.9 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 14.9 ns 14.9 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.293 ns 0.293 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 1.97 % 1.97 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.36 ns 9.36 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.36 ns 9.36 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.047 ns 0.047 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.50 % 0.50 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.52 ns 9.52 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.50 ns 9.50 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.079 ns 0.079 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.83 % 0.83 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.61 ns 9.61 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.59 ns 9.59 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.146 ns 0.146 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.52 % 1.52 % 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.5 ns 24.5 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 24.4 ns 24.4 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.615 ns 0.615 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 2.51 % 2.51 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 9.59 ns 9.59 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 9.63 ns 9.63 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.166 ns 0.166 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.73 % 1.73 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 8.04 ns 8.04 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 8.04 ns 8.04 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.114 ns 0.114 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.41 % 1.41 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.57 ns 7.57 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.52 ns 7.52 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.139 ns 0.139 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.84 % 1.84 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.82 ns 7.82 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.82 ns 7.82 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.025 ns 0.025 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 0.32 % 0.32 % 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.2 ns 29.2 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 29.1 ns 29.1 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 1.09 ns 1.09 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 3.74 % 3.74 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 11.0 ns 11.0 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 11.0 ns 11.0 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.152 ns 0.152 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 1.39 % 1.39 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 13.3 ns 13.3 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.137 ns 0.137 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.03 % 1.03 % 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 66.6 ns 66.6 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 66.0 ns 66.0 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 1.62 ns 1.62 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 2.43 % 2.43 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 24.5 ns 24.5 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 24.5 ns 24.5 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 0.348 ns 0.348 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 1.42 % 1.42 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 26.8 ns 26.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 26.8 ns 26.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.384 ns 0.384 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 1.43 % 1.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 1424 ns 1424 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 1429 ns 1429 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 35.2 ns 35.2 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.47 % 2.47 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 445 ns 445 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 446 ns 446 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 7.09 ns 7.08 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 1.59 % 1.59 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 388 ns 388 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 388 ns 388 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 3.37 ns 3.37 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 0.87 % 0.87 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 276 ns 276 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 278 ns 278 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 7.15 ns 7.15 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 2.59 % 2.59 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 219 ns 219 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 224 ns 224 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 11.1 ns 11.1 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 5.04 % 5.04 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 137 ns 137 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 137 ns 137 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 0.634 ns 0.634 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 0.46 % 0.46 % 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 1426 ns 1426 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 1428 ns 1428 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 39.2 ns 39.2 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 2.75 % 2.75 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 1288 ns 1288 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 1289 ns 1289 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 12.9 ns 12.9 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.01 % 1.01 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 426 ns 426 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 426 ns 426 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 5.08 ns 5.08 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.19 % 1.19 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 340 ns 340 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 346 ns 346 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 14.2 ns 14.2 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 4.17 % 4.17 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 313 ns 313 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 314 ns 314 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 11.6 ns 11.6 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.71 % 3.71 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 217 ns 217 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 218 ns 218 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 6.95 ns 6.95 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.21 % 3.21 % 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 75809 ns 75810 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 75636 ns 75637 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 1270 ns 1270 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 1.68 % 1.68 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 73098 ns 73098 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 73402 ns 73402 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1487 ns 1487 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.03 % 2.03 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 19767 ns 19767 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 19715 ns 19715 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 326 ns 326 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.65 % 1.65 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17379 ns 17379 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17356 ns 17356 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 164 ns 164 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 0.94 % 0.94 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16895 ns 16895 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16961 ns 16961 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 186 ns 186 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.10 % 1.10 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17082 ns 17082 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17027 ns 17027 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 244 ns 244 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.43 % 1.43 % 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 1469 ns 1469 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 1481 ns 1481 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 31.4 ns 31.4 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.14 % 2.14 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 1415 ns 1415 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 1404 ns 1404 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 26.0 ns 26.0 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.84 % 1.84 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 527 ns 527 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 525 ns 525 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 8.07 ns 8.07 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 1.53 % 1.53 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 465 ns 465 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 469 ns 469 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 22.5 ns 22.5 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 4.85 % 4.85 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 408 ns 408 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 415 ns 415 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 20.7 ns 20.7 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 5.06 % 5.06 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 309 ns 309 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 310 ns 310 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 3.18 ns 3.18 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 1.03 % 1.03 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 3067 ns 3067 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 3055 ns 3055 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 47.1 ns 47.1 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 1.54 % 1.54 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 457 ns 457 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 457 ns 457 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 4.69 ns 4.69 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.03 % 1.03 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 1393 ns 1393 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 1390 ns 1390 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 25.7 ns 25.6 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.84 % 1.84 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 1140 ns 1140 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 1150 ns 1150 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 32.3 ns 32.3 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 2.83 % 2.83 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 1356 ns 1356 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 1349 ns 1349 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 39.1 ns 39.1 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.88 % 2.88 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1002 ns 1003 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1005 ns 1005 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 24.7 ns 24.7 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 2.46 % 2.46 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 262 ns 262 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 261 ns 261 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 3.40 ns 3.40 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 1.30 % 1.30 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 126 ns 126 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 126 ns 126 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 0.511 ns 0.511 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 0.40 % 0.40 % 4
|
||||
stringa str = "test = " + k + " times";_mean 124 ns 124 ns 4
|
||||
stringa str = "test = " + k + " times";_median 124 ns 124 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 3.39 ns 3.39 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 2.74 % 2.74 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 270 ns 270 ns 4
|
||||
std::string::find + substr + std::strtol_median 268 ns 268 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 7.54 ns 7.54 ns 4
|
||||
std::string::find + substr + std::strtol_cv 2.79 % 2.79 % 4
|
||||
ssa::splitter + ssa::as_int_mean 156 ns 156 ns 4
|
||||
ssa::splitter + ssa::as_int_median 156 ns 156 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 1.99 ns 1.99 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 1.28 % 1.28 % 4
|
||||
ssa::splitf + functor_mean 207 ns 207 ns 4
|
||||
ssa::splitf + functor_median 207 ns 207 ns 4
|
||||
ssa::splitf + functor_stddev 2.33 ns 2.33 ns 4
|
||||
ssa::splitf + functor_cv 1.12 % 1.12 % 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 844 ns 844 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 846 ns 846 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 8.40 ns 8.40 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 1.00 % 1.00 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 2647 ns 2647 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 2649 ns 2649 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 41.4 ns 41.4 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 1.56 % 1.56 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 1123 ns 1123 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 1119 ns 1119 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 27.0 ns 27.0 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 2.40 % 2.40 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1273 ns 1273 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1269 ns 1269 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 42.9 ns 42.9 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 3.37 % 3.37 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1067 ns 1067 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1068 ns 1068 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 9.03 ns 9.03 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 0.85 % 0.85 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1029 ns 1029 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 1021 ns 1021 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 24.0 ns 24.0 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 2.33 % 2.33 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 887 ns 887 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 884 ns 884 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 19.8 ns 19.8 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 2.23 % 2.23 % 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 166 ns 166 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 166 ns 166 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 1.88 ns 1.88 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.13 % 1.13 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 334 ns 334 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 334 ns 334 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 5.22 ns 5.23 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.57 % 1.57 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 154 ns 154 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 152 ns 152 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 4.50 ns 4.50 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 2.92 % 2.92 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 169 ns 169 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 169 ns 169 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 2.26 ns 2.26 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.34 % 1.34 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 201 ns 201 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 200 ns 200 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 2.87 ns 2.87 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 1.43 % 1.43 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 130 ns 130 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 131 ns 131 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 2.75 ns 2.75 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 2.12 % 2.12 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 145 ns 145 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 145 ns 145 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 1.24 ns 1.24 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 0.85 % 0.85 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 151 ns 151 ns 4
|
||||
replace bb to ---- in std::string|64_median 150 ns 150 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 2.03 ns 2.03 ns 4
|
||||
replace bb to ---- in std::string|64_cv 1.34 % 1.34 % 4
|
||||
replace bb to ---- in std::string|256_mean 603 ns 603 ns 4
|
||||
replace bb to ---- in std::string|256_median 600 ns 600 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 7.38 ns 7.38 ns 4
|
||||
replace bb to ---- in std::string|256_cv 1.22 % 1.22 % 4
|
||||
replace bb to ---- in std::string|512_mean 1060 ns 1060 ns 4
|
||||
replace bb to ---- in std::string|512_median 1058 ns 1058 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 32.9 ns 32.9 ns 4
|
||||
replace bb to ---- in std::string|512_cv 3.10 % 3.10 % 4
|
||||
replace bb to ---- in std::string|1024_mean 2332 ns 2332 ns 4
|
||||
replace bb to ---- in std::string|1024_median 2323 ns 2323 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 156 ns 156 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 6.71 % 6.71 % 4
|
||||
replace bb to ---- in std::string|2048_mean 5851 ns 5851 ns 4
|
||||
replace bb to ---- in std::string|2048_median 5742 ns 5742 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 405 ns 405 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 6.92 % 6.92 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 127 ns 127 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 126 ns 126 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 1.74 ns 1.74 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 1.37 % 1.37 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 442 ns 442 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 439 ns 439 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 9.86 ns 9.86 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 2.23 % 2.23 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 831 ns 831 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 832 ns 832 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 13.7 ns 13.7 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 1.65 % 1.65 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1698 ns 1698 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 1696 ns 1696 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 26.9 ns 26.9 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.59 % 1.59 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3256 ns 3256 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 3280 ns 3280 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 73.1 ns 73.1 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 2.25 % 2.25 % 4
|
||||
replace bb to ---- by init stringa|64_mean 91.5 ns 91.5 ns 4
|
||||
replace bb to ---- by init stringa|64_median 91.9 ns 91.9 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 3.42 ns 3.42 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 3.74 % 3.74 % 4
|
||||
replace bb to ---- by init stringa|256_mean 306 ns 306 ns 4
|
||||
replace bb to ---- by init stringa|256_median 305 ns 305 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 7.25 ns 7.25 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 2.37 % 2.37 % 4
|
||||
replace bb to ---- by init stringa|512_mean 718 ns 718 ns 4
|
||||
replace bb to ---- by init stringa|512_median 719 ns 719 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 7.71 ns 7.71 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 1.07 % 1.07 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 1629 ns 1629 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 1626 ns 1626 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 21.1 ns 21.1 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 1.30 % 1.30 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 3400 ns 3400 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 3411 ns 3411 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 57.0 ns 57.0 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 1.68 % 1.68 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 114 ns 114 ns 4
|
||||
replace bb to -- in std::string|64_median 113 ns 113 ns 4
|
||||
replace bb to -- in std::string|64_stddev 3.00 ns 3.00 ns 4
|
||||
replace bb to -- in std::string|64_cv 2.62 % 2.62 % 4
|
||||
replace bb to -- in std::string|256_mean 390 ns 390 ns 4
|
||||
replace bb to -- in std::string|256_median 391 ns 391 ns 4
|
||||
replace bb to -- in std::string|256_stddev 6.46 ns 6.46 ns 4
|
||||
replace bb to -- in std::string|256_cv 1.66 % 1.66 % 4
|
||||
replace bb to -- in std::string|512_mean 743 ns 743 ns 4
|
||||
replace bb to -- in std::string|512_median 741 ns 741 ns 4
|
||||
replace bb to -- in std::string|512_stddev 7.17 ns 7.17 ns 4
|
||||
replace bb to -- in std::string|512_cv 0.97 % 0.97 % 4
|
||||
replace bb to -- in std::string|1024_mean 1477 ns 1477 ns 4
|
||||
replace bb to -- in std::string|1024_median 1477 ns 1477 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 22.5 ns 22.5 ns 4
|
||||
replace bb to -- in std::string|1024_cv 1.52 % 1.52 % 4
|
||||
replace bb to -- in std::string|2048_mean 2929 ns 2929 ns 4
|
||||
replace bb to -- in std::string|2048_median 2932 ns 2932 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 32.1 ns 32.1 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.09 % 1.09 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 89.2 ns 89.2 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 88.6 ns 88.6 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 1.62 ns 1.62 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 1.82 % 1.82 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 295 ns 295 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 296 ns 296 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 5.80 ns 5.80 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 1.97 % 1.97 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 553 ns 553 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 547 ns 547 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 15.1 ns 14.9 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 2.72 % 2.69 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 1122 ns 1122 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 1112 ns 1112 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 33.2 ns 33.2 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 2.96 % 2.96 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 2088 ns 2088 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 2076 ns 2076 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 33.4 ns 33.4 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.60 % 1.60 % 4
|
||||
replace bb to -- by init stringa|64_mean 73.9 ns 73.9 ns 4
|
||||
replace bb to -- by init stringa|64_median 74.1 ns 74.1 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 1.95 ns 1.95 ns 4
|
||||
replace bb to -- by init stringa|64_cv 2.63 % 2.63 % 4
|
||||
replace bb to -- by init stringa|256_mean 240 ns 240 ns 4
|
||||
replace bb to -- by init stringa|256_median 240 ns 240 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 3.28 ns 3.28 ns 4
|
||||
replace bb to -- by init stringa|256_cv 1.37 % 1.37 % 4
|
||||
replace bb to -- by init stringa|512_mean 434 ns 434 ns 4
|
||||
replace bb to -- by init stringa|512_median 434 ns 434 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 4.69 ns 4.69 ns 4
|
||||
replace bb to -- by init stringa|512_cv 1.08 % 1.08 % 4
|
||||
replace bb to -- by init stringa|1024_mean 898 ns 898 ns 4
|
||||
replace bb to -- by init stringa|1024_median 897 ns 897 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 22.5 ns 22.5 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 2.51 % 2.51 % 4
|
||||
replace bb to -- by init stringa|2048_mean 1709 ns 1709 ns 4
|
||||
replace bb to -- by init stringa|2048_median 1711 ns 1711 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 28.4 ns 28.4 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 1.66 % 1.66 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3754473 ns 3754484 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3770505 ns 3770516 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 44910 ns 44913 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 1.20 % 1.20 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3584569 ns 3584594 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3584871 ns 3584864 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 54232 ns 54206 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 1.51 % 1.51 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3718652 ns 3718652 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3722300 ns 3722310 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 63421 ns 63405 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.71 % 1.71 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4196609 ns 4196628 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4205044 ns 4205067 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 39442 ns 39443 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 0.94 % 0.94 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 673 ns 673 ns 4
|
||||
Build func full name std::string;_median 673 ns 673 ns 4
|
||||
Build func full name std::string;_stddev 6.64 ns 6.64 ns 4
|
||||
Build func full name std::string;_cv 0.99 % 0.99 % 4
|
||||
Build func full name std::string 1;_mean 768 ns 768 ns 4
|
||||
Build func full name std::string 1;_median 770 ns 770 ns 4
|
||||
Build func full name std::string 1;_stddev 19.1 ns 19.1 ns 4
|
||||
Build func full name std::string 1;_cv 2.49 % 2.49 % 4
|
||||
Build func full name std::stream;_mean 3165 ns 3165 ns 4
|
||||
Build func full name std::stream;_median 3169 ns 3169 ns 4
|
||||
Build func full name std::stream;_stddev 34.1 ns 34.1 ns 4
|
||||
Build func full name std::stream;_cv 1.08 % 1.08 % 4
|
||||
Build func full name stringa;_mean 472 ns 472 ns 4
|
||||
Build func full name stringa;_median 474 ns 474 ns 4
|
||||
Build func full name stringa;_stddev 10.3 ns 10.3 ns 4
|
||||
Build func full name stringa;_cv 2.18 % 2.18 % 4
|
||||
Build func full name stringa 1;_mean 616 ns 616 ns 4
|
||||
Build func full name stringa 1;_median 600 ns 600 ns 4
|
||||
Build func full name stringa 1;_stddev 37.3 ns 37.3 ns 4
|
||||
Build func full name stringa 1;_cv 6.06 % 6.06 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 162 ns 162 ns 4
|
||||
To upper case std::wstring_median 161 ns 161 ns 4
|
||||
To upper case std::wstring_stddev 3.72 ns 3.72 ns 4
|
||||
To upper case std::wstring_cv 2.29 % 2.29 % 4
|
||||
To upper case lstringw<15>_mean 43.7 ns 43.7 ns 4
|
||||
To upper case lstringw<15>_median 42.9 ns 42.9 ns 4
|
||||
To upper case lstringw<15>_stddev 1.64 ns 1.64 ns 4
|
||||
To upper case lstringw<15>_cv 3.75 % 3.75 % 4
|
||||
|
|
@ -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
|
||||
|
|
@ -1,778 +0,0 @@
|
|||
2025-08-06T13:47:54+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.00, 0.00, 0.00
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e;_mean 1.19 ns 1.19 ns 10
|
||||
std::string e;_median 1.17 ns 1.17 ns 10
|
||||
std::string e;_stddev 0.087 ns 0.087 ns 10
|
||||
std::string e;_cv 7.32 % 7.32 % 10
|
||||
std::string_view e;_mean 0.759 ns 0.759 ns 10
|
||||
std::string_view e;_median 0.740 ns 0.740 ns 10
|
||||
std::string_view e;_stddev 0.033 ns 0.033 ns 10
|
||||
std::string_view e;_cv 4.40 % 4.40 % 10
|
||||
ssa e;_mean 0.185 ns 0.185 ns 10
|
||||
ssa e;_median 0.185 ns 0.185 ns 10
|
||||
ssa e;_stddev 0.004 ns 0.004 ns 10
|
||||
ssa e;_cv 2.05 % 2.05 % 10
|
||||
stringa e;_mean 0.759 ns 0.759 ns 10
|
||||
stringa e;_median 0.756 ns 0.756 ns 10
|
||||
stringa e;_stddev 0.027 ns 0.027 ns 10
|
||||
stringa e;_cv 3.57 % 3.57 % 10
|
||||
lstringa<20> e;_mean 1.11 ns 1.11 ns 10
|
||||
lstringa<20> e;_median 1.11 ns 1.11 ns 10
|
||||
lstringa<20> e;_stddev 0.017 ns 0.017 ns 10
|
||||
lstringa<20> e;_cv 1.52 % 1.52 % 10
|
||||
lstringa<40> e;_mean 1.13 ns 1.13 ns 10
|
||||
lstringa<40> e;_median 1.14 ns 1.14 ns 10
|
||||
lstringa<40> e;_stddev 0.025 ns 0.025 ns 10
|
||||
lstringa<40> e;_cv 2.19 % 2.19 % 10
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text";_mean 1.88 ns 1.88 ns 10
|
||||
std::string e = "Test text";_median 1.87 ns 1.87 ns 10
|
||||
std::string e = "Test text";_stddev 0.047 ns 0.047 ns 10
|
||||
std::string e = "Test text";_cv 2.47 % 2.47 % 10
|
||||
std::string_view e = "Test text";_mean 0.757 ns 0.757 ns 10
|
||||
std::string_view e = "Test text";_median 0.750 ns 0.750 ns 10
|
||||
std::string_view e = "Test text";_stddev 0.031 ns 0.031 ns 10
|
||||
std::string_view e = "Test text";_cv 4.04 % 4.04 % 10
|
||||
ssa e = "Test text";_mean 0.746 ns 0.746 ns 10
|
||||
ssa e = "Test text";_median 0.739 ns 0.739 ns 10
|
||||
ssa e = "Test text";_stddev 0.016 ns 0.016 ns 10
|
||||
ssa e = "Test text";_cv 2.14 % 2.14 % 10
|
||||
stringa e = "Test text";_mean 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text";_median 1.12 ns 1.12 ns 10
|
||||
stringa e = "Test text";_stddev 0.027 ns 0.027 ns 10
|
||||
stringa e = "Test text";_cv 2.38 % 2.38 % 10
|
||||
lstringa<20> e = "Test text";_mean 1.87 ns 1.87 ns 10
|
||||
lstringa<20> e = "Test text";_median 1.86 ns 1.86 ns 10
|
||||
lstringa<20> e = "Test text";_stddev 0.049 ns 0.049 ns 10
|
||||
lstringa<20> e = "Test text";_cv 2.64 % 2.64 % 10
|
||||
lstringa<40> e = "Test text";_mean 1.91 ns 1.91 ns 10
|
||||
lstringa<40> e = "Test text";_median 1.88 ns 1.88 ns 10
|
||||
lstringa<40> e = "Test text";_stddev 0.082 ns 0.082 ns 10
|
||||
lstringa<40> e = "Test text";_cv 4.30 % 4.30 % 10
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 18.7 ns 18.7 ns 10
|
||||
std::string e = "123456789012345678901234567890";_median 18.5 ns 18.5 ns 10
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.629 ns 0.629 ns 10
|
||||
std::string e = "123456789012345678901234567890";_cv 3.36 % 3.36 % 10
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.751 ns 0.751 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.741 ns 0.741 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.023 ns 0.023 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_cv 3.03 % 3.03 % 10
|
||||
ssa e = "123456789012345678901234567890";_mean 0.754 ns 0.754 ns 10
|
||||
ssa e = "123456789012345678901234567890";_median 0.758 ns 0.758 ns 10
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.021 ns 0.021 ns 10
|
||||
ssa e = "123456789012345678901234567890";_cv 2.79 % 2.79 % 10
|
||||
stringa e = "123456789012345678901234567890";_mean 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890";_median 1.12 ns 1.12 ns 10
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.026 ns 0.026 ns 10
|
||||
stringa e = "123456789012345678901234567890";_cv 2.29 % 2.29 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 19.6 ns 19.6 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 19.3 ns 19.3 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.546 ns 0.546 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 2.78 % 2.78 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 2.59 ns 2.59 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 2.56 ns 2.56 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.055 ns 0.055 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 2.14 % 2.14 % 10
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 4.91 ns 4.91 ns 10
|
||||
std::string e = "Test text"; auto c{e};_median 4.87 ns 4.87 ns 10
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.160 ns 0.160 ns 10
|
||||
std::string e = "Test text"; auto c{e};_cv 3.26 % 3.26 % 10
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.377 ns 0.377 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.375 ns 0.375 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.015 ns 0.015 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_cv 3.90 % 3.90 % 10
|
||||
ssa e = "Test text"; auto c{e};_mean 0.378 ns 0.378 ns 10
|
||||
ssa e = "Test text"; auto c{e};_median 0.372 ns 0.372 ns 10
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.015 ns 0.015 ns 10
|
||||
ssa e = "Test text"; auto c{e};_cv 3.95 % 3.95 % 10
|
||||
stringa e = "Test text"; auto c{e};_mean 1.14 ns 1.14 ns 10
|
||||
stringa e = "Test text"; auto c{e};_median 1.13 ns 1.13 ns 10
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.031 ns 0.031 ns 10
|
||||
stringa e = "Test text"; auto c{e};_cv 2.70 % 2.70 % 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 4.84 ns 4.84 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 4.81 ns 4.81 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.090 ns 0.090 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.85 % 1.85 % 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 4.60 ns 4.60 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 4.54 ns 4.54 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.189 ns 0.189 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 4.10 % 4.10 % 10
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 24.2 ns 24.2 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 24.0 ns 24.0 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.450 ns 0.450 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 1.86 % 1.86 % 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.746 ns 0.746 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.741 ns 0.741 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.021 ns 0.021 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 2.85 % 2.85 % 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.744 ns 0.744 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.741 ns 0.741 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.010 ns 0.010 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.35 % 1.35 % 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 1.13 ns 1.13 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.030 ns 0.030 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 2.63 % 2.63 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 24.4 ns 24.4 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 24.3 ns 24.3 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.796 ns 0.796 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 3.26 % 3.26 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 5.62 ns 5.62 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 5.50 ns 5.50 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.242 ns 0.242 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 4.30 % 4.30 % 10
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find;_mean 7.11 ns 7.11 ns 10
|
||||
std::string::find;_median 7.08 ns 7.08 ns 10
|
||||
std::string::find;_stddev 0.117 ns 0.117 ns 10
|
||||
std::string::find;_cv 1.65 % 1.65 % 10
|
||||
std::string_view::find;_mean 6.43 ns 6.43 ns 10
|
||||
std::string_view::find;_median 6.38 ns 6.38 ns 10
|
||||
std::string_view::find;_stddev 0.242 ns 0.242 ns 10
|
||||
std::string_view::find;_cv 3.76 % 3.76 % 10
|
||||
ssa::find;_mean 6.47 ns 6.47 ns 10
|
||||
ssa::find;_median 6.41 ns 6.41 ns 10
|
||||
ssa::find;_stddev 0.241 ns 0.241 ns 10
|
||||
ssa::find;_cv 3.72 % 3.72 % 10
|
||||
stringa::find;_mean 6.83 ns 6.83 ns 10
|
||||
stringa::find;_median 6.74 ns 6.74 ns 10
|
||||
stringa::find;_stddev 0.269 ns 0.269 ns 10
|
||||
stringa::find;_cv 3.94 % 3.94 % 10
|
||||
lstringa<20>::find;_mean 6.88 ns 6.88 ns 10
|
||||
lstringa<20>::find;_median 6.78 ns 6.78 ns 10
|
||||
lstringa<20>::find;_stddev 0.288 ns 0.288 ns 10
|
||||
lstringa<20>::find;_cv 4.18 % 4.18 % 10
|
||||
lstringa<40>::find;_mean 6.80 ns 6.80 ns 10
|
||||
lstringa<40>::find;_median 6.75 ns 6.75 ns 10
|
||||
lstringa<40>::find;_stddev 0.164 ns 0.164 ns 10
|
||||
lstringa<40>::find;_cv 2.41 % 2.41 % 10
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string copy{str_with_len_N};/15_mean 7.34 ns 7.34 ns 10
|
||||
std::string copy{str_with_len_N};/15_median 7.19 ns 7.19 ns 10
|
||||
std::string copy{str_with_len_N};/15_stddev 0.277 ns 0.277 ns 10
|
||||
std::string copy{str_with_len_N};/15_cv 3.77 % 3.77 % 10
|
||||
std::string copy{str_with_len_N};/16_mean 24.8 ns 24.8 ns 10
|
||||
std::string copy{str_with_len_N};/16_median 24.7 ns 24.8 ns 10
|
||||
std::string copy{str_with_len_N};/16_stddev 0.837 ns 0.837 ns 10
|
||||
std::string copy{str_with_len_N};/16_cv 3.37 % 3.37 % 10
|
||||
std::string copy{str_with_len_N};/23_mean 25.3 ns 25.3 ns 10
|
||||
std::string copy{str_with_len_N};/23_median 25.6 ns 25.6 ns 10
|
||||
std::string copy{str_with_len_N};/23_stddev 0.737 ns 0.737 ns 10
|
||||
std::string copy{str_with_len_N};/23_cv 2.92 % 2.92 % 10
|
||||
std::string copy{str_with_len_N};/24_mean 24.6 ns 24.6 ns 10
|
||||
std::string copy{str_with_len_N};/24_median 24.6 ns 24.6 ns 10
|
||||
std::string copy{str_with_len_N};/24_stddev 0.566 ns 0.566 ns 10
|
||||
std::string copy{str_with_len_N};/24_cv 2.30 % 2.30 % 10
|
||||
std::string copy{str_with_len_N};/32_mean 23.9 ns 23.9 ns 10
|
||||
std::string copy{str_with_len_N};/32_median 23.9 ns 23.9 ns 10
|
||||
std::string copy{str_with_len_N};/32_stddev 0.236 ns 0.236 ns 10
|
||||
std::string copy{str_with_len_N};/32_cv 0.99 % 0.99 % 10
|
||||
std::string copy{str_with_len_N};/64_mean 24.1 ns 24.1 ns 10
|
||||
std::string copy{str_with_len_N};/64_median 23.9 ns 23.9 ns 10
|
||||
std::string copy{str_with_len_N};/64_stddev 0.627 ns 0.627 ns 10
|
||||
std::string copy{str_with_len_N};/64_cv 2.60 % 2.60 % 10
|
||||
std::string copy{str_with_len_N};/128_mean 26.1 ns 26.1 ns 10
|
||||
std::string copy{str_with_len_N};/128_median 26.1 ns 26.1 ns 10
|
||||
std::string copy{str_with_len_N};/128_stddev 0.285 ns 0.285 ns 10
|
||||
std::string copy{str_with_len_N};/128_cv 1.09 % 1.09 % 10
|
||||
std::string copy{str_with_len_N};/256_mean 26.6 ns 26.6 ns 10
|
||||
std::string copy{str_with_len_N};/256_median 26.5 ns 26.5 ns 10
|
||||
std::string copy{str_with_len_N};/256_stddev 0.690 ns 0.690 ns 10
|
||||
std::string copy{str_with_len_N};/256_cv 2.60 % 2.60 % 10
|
||||
std::string copy{str_with_len_N};/512_mean 30.8 ns 30.8 ns 10
|
||||
std::string copy{str_with_len_N};/512_median 30.3 ns 30.3 ns 10
|
||||
std::string copy{str_with_len_N};/512_stddev 1.13 ns 1.13 ns 10
|
||||
std::string copy{str_with_len_N};/512_cv 3.68 % 3.68 % 10
|
||||
std::string copy{str_with_len_N};/1024_mean 41.2 ns 41.2 ns 10
|
||||
std::string copy{str_with_len_N};/1024_median 40.9 ns 40.9 ns 10
|
||||
std::string copy{str_with_len_N};/1024_stddev 1.67 ns 1.67 ns 10
|
||||
std::string copy{str_with_len_N};/1024_cv 4.06 % 4.06 % 10
|
||||
std::string copy{str_with_len_N};/2048_mean 111 ns 111 ns 10
|
||||
std::string copy{str_with_len_N};/2048_median 111 ns 111 ns 10
|
||||
std::string copy{str_with_len_N};/2048_stddev 7.17 ns 7.17 ns 10
|
||||
std::string copy{str_with_len_N};/2048_cv 6.44 % 6.44 % 10
|
||||
std::string copy{str_with_len_N};/4096_mean 139 ns 139 ns 10
|
||||
std::string copy{str_with_len_N};/4096_median 140 ns 140 ns 10
|
||||
std::string copy{str_with_len_N};/4096_stddev 7.50 ns 7.50 ns 10
|
||||
std::string copy{str_with_len_N};/4096_cv 5.41 % 5.41 % 10
|
||||
stringa copy{str_with_len_N};/15_mean 1.11 ns 1.11 ns 10
|
||||
stringa copy{str_with_len_N};/15_median 1.10 ns 1.10 ns 10
|
||||
stringa copy{str_with_len_N};/15_stddev 0.023 ns 0.023 ns 10
|
||||
stringa copy{str_with_len_N};/15_cv 2.05 % 2.05 % 10
|
||||
stringa copy{str_with_len_N};/16_mean 1.12 ns 1.12 ns 10
|
||||
stringa copy{str_with_len_N};/16_median 1.11 ns 1.11 ns 10
|
||||
stringa copy{str_with_len_N};/16_stddev 0.032 ns 0.032 ns 10
|
||||
stringa copy{str_with_len_N};/16_cv 2.87 % 2.87 % 10
|
||||
stringa copy{str_with_len_N};/23_mean 1.11 ns 1.11 ns 10
|
||||
stringa copy{str_with_len_N};/23_median 1.10 ns 1.10 ns 10
|
||||
stringa copy{str_with_len_N};/23_stddev 0.023 ns 0.023 ns 10
|
||||
stringa copy{str_with_len_N};/23_cv 2.11 % 2.11 % 10
|
||||
stringa copy{str_with_len_N};/24_mean 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/24_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/24_stddev 0.541 ns 0.541 ns 10
|
||||
stringa copy{str_with_len_N};/24_cv 3.33 % 3.33 % 10
|
||||
stringa copy{str_with_len_N};/32_mean 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/32_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/32_stddev 0.374 ns 0.374 ns 10
|
||||
stringa copy{str_with_len_N};/32_cv 2.32 % 2.32 % 10
|
||||
stringa copy{str_with_len_N};/64_mean 16.8 ns 16.8 ns 10
|
||||
stringa copy{str_with_len_N};/64_median 16.6 ns 16.6 ns 10
|
||||
stringa copy{str_with_len_N};/64_stddev 0.604 ns 0.604 ns 10
|
||||
stringa copy{str_with_len_N};/64_cv 3.59 % 3.59 % 10
|
||||
stringa copy{str_with_len_N};/128_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/128_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/128_stddev 0.263 ns 0.263 ns 10
|
||||
stringa copy{str_with_len_N};/128_cv 1.62 % 1.62 % 10
|
||||
stringa copy{str_with_len_N};/256_mean 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/256_median 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/256_stddev 0.244 ns 0.244 ns 10
|
||||
stringa copy{str_with_len_N};/256_cv 1.50 % 1.50 % 10
|
||||
stringa copy{str_with_len_N};/512_mean 16.4 ns 16.4 ns 10
|
||||
stringa copy{str_with_len_N};/512_median 16.3 ns 16.3 ns 10
|
||||
stringa copy{str_with_len_N};/512_stddev 0.290 ns 0.290 ns 10
|
||||
stringa copy{str_with_len_N};/512_cv 1.77 % 1.77 % 10
|
||||
stringa copy{str_with_len_N};/1024_mean 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/1024_median 16.1 ns 16.1 ns 10
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.186 ns 0.186 ns 10
|
||||
stringa copy{str_with_len_N};/1024_cv 1.15 % 1.15 % 10
|
||||
stringa copy{str_with_len_N};/2048_mean 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/2048_median 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.171 ns 0.171 ns 10
|
||||
stringa copy{str_with_len_N};/2048_cv 1.06 % 1.06 % 10
|
||||
stringa copy{str_with_len_N};/4096_mean 16.2 ns 16.2 ns 10
|
||||
stringa copy{str_with_len_N};/4096_median 16.1 ns 16.1 ns 10
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.266 ns 0.266 ns 10
|
||||
stringa copy{str_with_len_N};/4096_cv 1.64 % 1.64 % 10
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 4.87 ns 4.87 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_median 4.84 ns 4.84 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.113 ns 0.113 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 2.32 % 2.32 % 10
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 4.83 ns 4.83 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_median 4.82 ns 4.82 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.074 ns 0.074 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.54 % 1.54 % 10
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 4.90 ns 4.90 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_median 4.86 ns 4.86 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.146 ns 0.146 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 2.99 % 2.99 % 10
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 25.0 ns 25.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_median 24.7 ns 24.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 0.875 ns 0.875 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 3.50 % 3.50 % 10
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 25.0 ns 25.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_median 24.8 ns 24.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 1.05 ns 1.05 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 4.20 % 4.20 % 10
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 25.9 ns 25.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_median 25.7 ns 25.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.649 ns 0.649 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 2.51 % 2.51 % 10
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 27.0 ns 27.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_median 26.9 ns 26.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.661 ns 0.661 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 2.45 % 2.45 % 10
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 28.3 ns 28.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_median 27.8 ns 27.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 1.33 ns 1.33 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 4.70 % 4.70 % 10
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 30.7 ns 30.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_median 30.6 ns 30.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 0.663 ns 0.663 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 2.16 % 2.16 % 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 83.7 ns 83.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 83.5 ns 83.5 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 4.33 ns 4.33 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 5.17 % 5.17 % 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 97.7 ns 97.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 96.1 ns 96.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 8.19 ns 8.19 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 8.38 % 8.38 % 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 116 ns 116 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 116 ns 116 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 5.46 ns 5.46 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 4.71 % 4.71 % 10
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 4.99 ns 4.99 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_median 4.86 ns 4.86 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.351 ns 0.351 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 7.03 % 7.03 % 10
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 4.89 ns 4.89 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_median 4.88 ns 4.88 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.134 ns 0.134 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 2.73 % 2.73 % 10
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 4.89 ns 4.89 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_median 4.83 ns 4.83 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.137 ns 0.137 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 2.80 % 2.80 % 10
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 4.85 ns 4.85 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_median 4.82 ns 4.82 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.094 ns 0.094 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.94 % 1.94 % 10
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 4.52 ns 4.52 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_median 4.49 ns 4.49 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.099 ns 0.099 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 2.20 % 2.20 % 10
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 6.15 ns 6.15 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_median 6.08 ns 6.08 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.283 ns 0.283 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 4.61 % 4.61 % 10
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 6.59 ns 6.59 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_median 6.49 ns 6.49 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.309 ns 0.309 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 4.69 % 4.69 % 10
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 8.29 ns 8.29 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_median 8.28 ns 8.28 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.145 ns 0.145 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.75 % 1.75 % 10
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 10.6 ns 10.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_median 10.6 ns 10.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.196 ns 0.196 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.84 % 1.84 % 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 89.0 ns 89.0 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 89.5 ns 89.5 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 4.99 ns 4.99 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 5.60 % 5.60 % 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 101 ns 101 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 99.8 ns 99.8 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 7.23 ns 7.23 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 7.15 % 7.15 % 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 115 ns 115 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 114 ns 114 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 4.47 ns 4.47 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 3.89 % 3.89 % 10
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 27.3 ns 27.3 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 26.8 ns 26.8 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 1.08 ns 1.08 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 3.97 % 3.97 % 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 12.4 ns 12.4 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 12.3 ns 12.3 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.287 ns 0.287 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 2.32 % 2.32 % 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 7.92 ns 7.92 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 7.90 ns 7.90 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.170 ns 0.170 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.15 % 2.15 % 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 7.73 ns 7.73 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 7.70 ns 7.70 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.126 ns 0.126 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.63 % 1.63 % 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 7.73 ns 7.73 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 7.60 ns 7.60 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.343 ns 0.343 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 4.43 % 4.43 % 10
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 24.0 ns 24.0 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 23.9 ns 23.9 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.391 ns 0.391 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 1.63 % 1.63 % 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 14.8 ns 14.8 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 14.7 ns 14.7 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.433 ns 0.433 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 2.93 % 2.93 % 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.55 ns 7.55 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.48 ns 7.48 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.242 ns 0.242 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 3.20 % 3.20 % 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 8.28 ns 8.28 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 8.20 ns 8.20 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.205 ns 0.205 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.48 % 2.48 % 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 8.16 ns 8.16 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 8.11 ns 8.11 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.113 ns 0.113 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.39 % 1.39 % 10
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 29.1 ns 29.1 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 29.6 ns 29.6 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.966 ns 0.966 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 3.32 % 3.32 % 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 16.7 ns 16.7 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 16.8 ns 16.8 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.714 ns 0.714 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 4.27 % 4.27 % 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 14.6 ns 14.6 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 14.6 ns 14.6 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.378 ns 0.378 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 2.59 % 2.59 % 10
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 1439 ns 1439 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 1423 ns 1423 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 55.7 ns 55.7 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 3.87 % 3.87 % 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 369 ns 369 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 366 ns 366 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 13.1 ns 13.1 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 3.56 % 3.56 % 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 372 ns 372 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 366 ns 366 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 17.5 ns 17.5 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 4.69 % 4.69 % 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 258 ns 258 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 255 ns 255 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 10.4 ns 10.4 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 4.02 % 4.02 % 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 241 ns 241 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 237 ns 237 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 9.51 ns 9.51 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 3.96 % 3.96 % 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 140 ns 140 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 139 ns 139 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 1.89 ns 1.89 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.35 % 1.35 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 1399 ns 1399 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 1392 ns 1392 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 21.4 ns 21.4 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 1.53 % 1.53 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 1343 ns 1343 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 1335 ns 1335 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 29.7 ns 29.7 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 2.22 % 2.22 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 429 ns 429 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 425 ns 425 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 11.9 ns 11.9 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.78 % 2.78 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 361 ns 361 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 362 ns 362 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 11.1 ns 11.1 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.07 % 3.07 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 316 ns 316 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 316 ns 316 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 10.4 ns 10.4 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.28 % 3.28 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 256 ns 256 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 254 ns 254 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 7.09 ns 7.09 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.77 % 2.77 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 74700 ns 74701 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 74616 ns 74616 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 1876 ns 1876 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 2.51 % 2.51 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 72474 ns 72474 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 71002 ns 71002 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 3104 ns 3104 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 4.28 % 4.28 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 19642 ns 19642 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 19294 ns 19294 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 924 ns 924 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 4.70 % 4.70 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17774 ns 17774 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17626 ns 17626 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 440 ns 440 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.48 % 2.48 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17565 ns 17565 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17594 ns 17594 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 482 ns 482 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.75 % 2.75 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 18274 ns 18274 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 18226 ns 18226 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 365 ns 365 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.00 % 2.00 % 10
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 1400 ns 1400 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 1371 ns 1371 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 59.5 ns 59.5 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 4.25 % 4.25 % 10
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 1342 ns 1342 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_median 1329 ns 1329 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 40.1 ns 40.1 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 2.99 % 2.99 % 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 598 ns 598 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 591 ns 591 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 32.2 ns 32.2 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 5.39 % 5.39 % 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 500 ns 500 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 496 ns 496 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 13.1 ns 13.1 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 2.61 % 2.61 % 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 462 ns 462 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 462 ns 462 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 20.4 ns 20.4 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 4.42 % 4.42 % 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 431 ns 431 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 440 ns 440 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 31.5 ns 31.5 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 7.31 % 7.31 % 10
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 3419 ns 3419 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_median 3299 ns 3299 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 235 ns 235 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 6.87 % 6.87 % 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 451 ns 451 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 451 ns 451 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 4.99 ns 4.99 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.11 % 1.11 % 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 1509 ns 1509 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 1515 ns 1515 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 26.5 ns 26.5 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.75 % 1.75 % 10
|
||||
std::string str = std::format("test = {} times", k);_mean 1286 ns 1286 ns 10
|
||||
std::string str = std::format("test = {} times", k);_median 1278 ns 1278 ns 10
|
||||
std::string str = std::format("test = {} times", k);_stddev 30.8 ns 30.8 ns 10
|
||||
std::string str = std::format("test = {} times", k);_cv 2.40 % 2.40 % 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 1618 ns 1618 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 1609 ns 1609 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 21.9 ns 21.9 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 1.35 % 1.35 % 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1132 ns 1132 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1127 ns 1127 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 33.3 ns 33.3 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 2.94 % 2.94 % 10
|
||||
lstringa<8> str = "test = " + k + " times";_mean 316 ns 316 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_median 316 ns 316 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 4.81 ns 4.81 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_cv 1.52 % 1.52 % 10
|
||||
lstringa<32> str = "test = " + k + " times";_mean 162 ns 162 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_median 160 ns 160 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 6.29 ns 6.29 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_cv 3.88 % 3.88 % 10
|
||||
stringa str = "test = " + k + " times";_mean 174 ns 174 ns 10
|
||||
stringa str = "test = " + k + " times";_median 173 ns 173 ns 10
|
||||
stringa str = "test = " + k + " times";_stddev 3.60 ns 3.60 ns 10
|
||||
stringa str = "test = " + k + " times";_cv 2.07 % 2.07 % 10
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find + substr + std::strtol_mean 285 ns 285 ns 10
|
||||
std::string::find + substr + std::strtol_median 282 ns 282 ns 10
|
||||
std::string::find + substr + std::strtol_stddev 11.1 ns 11.1 ns 10
|
||||
std::string::find + substr + std::strtol_cv 3.90 % 3.90 % 10
|
||||
ssa::splitter + ssa::as_int_mean 139 ns 139 ns 10
|
||||
ssa::splitter + ssa::as_int_median 139 ns 139 ns 10
|
||||
ssa::splitter + ssa::as_int_stddev 1.89 ns 1.89 ns 10
|
||||
ssa::splitter + ssa::as_int_cv 1.36 % 1.37 % 10
|
||||
ssa::splitf + functor_mean 153 ns 153 ns 10
|
||||
ssa::splitf + functor_median 152 ns 152 ns 10
|
||||
ssa::splitf + functor_stddev 1.34 ns 1.34 ns 10
|
||||
ssa::splitf + functor_cv 0.88 % 0.88 % 10
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 867 ns 867 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 866 ns 866 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 9.68 ns 9.68 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 1.12 % 1.12 % 10
|
||||
replace symbols with std::string find_first_of + replace_mean 2597 ns 2597 ns 10
|
||||
replace symbols with std::string find_first_of + replace_median 2577 ns 2577 ns 10
|
||||
replace symbols with std::string find_first_of + replace_stddev 74.4 ns 74.4 ns 10
|
||||
replace symbols with std::string find_first_of + replace_cv 2.86 % 2.86 % 10
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2671 ns 2671 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_median 2667 ns 2667 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 54.9 ns 54.9 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_cv 2.05 % 2.05 % 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1543 ns 1543 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1549 ns 1549 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 22.7 ns 22.7 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 1.47 % 1.47 % 10
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1181 ns 1181 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1178 ns 1178 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 42.8 ns 42.8 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 3.63 % 3.62 % 10
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1265 ns 1265 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_median 1255 ns 1255 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 18.4 ns 18.4 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_cv 1.45 % 1.45 % 10
|
||||
replace const symbols with string expressions and memorization of all search results_mean 866 ns 866 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_median 858 ns 858 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 16.6 ns 16.6 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_cv 1.91 % 1.91 % 10
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 170 ns 170 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 165 ns 165 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 13.1 ns 13.1 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 7.73 % 7.73 % 10
|
||||
Short replace symbols with std::string find_first_of + replace_mean 348 ns 348 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_median 332 ns 332 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 35.6 ns 35.6 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_cv 10.24 % 10.24 % 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 322 ns 322 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 321 ns 321 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 6.90 ns 6.90 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 2.14 % 2.14 % 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 198 ns 198 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 198 ns 198 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 3.57 ns 3.57 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.81 % 1.81 % 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 192 ns 192 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 192 ns 192 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 4.04 ns 4.04 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 2.10 % 2.10 % 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 165 ns 165 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 165 ns 165 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 3.56 ns 3.56 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 2.17 % 2.17 % 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 153 ns 153 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 153 ns 153 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 2.48 ns 2.48 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 1.62 % 1.62 % 10
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to ---- in std::string|64_mean 162 ns 162 ns 10
|
||||
replace bb to ---- in std::string|64_median 163 ns 163 ns 10
|
||||
replace bb to ---- in std::string|64_stddev 4.04 ns 4.04 ns 10
|
||||
replace bb to ---- in std::string|64_cv 2.49 % 2.49 % 10
|
||||
replace bb to ---- in std::string|256_mean 493 ns 493 ns 10
|
||||
replace bb to ---- in std::string|256_median 493 ns 493 ns 10
|
||||
replace bb to ---- in std::string|256_stddev 8.37 ns 8.37 ns 10
|
||||
replace bb to ---- in std::string|256_cv 1.70 % 1.70 % 10
|
||||
replace bb to ---- in std::string|512_mean 993 ns 993 ns 10
|
||||
replace bb to ---- in std::string|512_median 994 ns 994 ns 10
|
||||
replace bb to ---- in std::string|512_stddev 14.5 ns 14.5 ns 10
|
||||
replace bb to ---- in std::string|512_cv 1.46 % 1.46 % 10
|
||||
replace bb to ---- in std::string|1024_mean 2333 ns 2333 ns 10
|
||||
replace bb to ---- in std::string|1024_median 2320 ns 2320 ns 10
|
||||
replace bb to ---- in std::string|1024_stddev 65.6 ns 65.6 ns 10
|
||||
replace bb to ---- in std::string|1024_cv 2.81 % 2.81 % 10
|
||||
replace bb to ---- in std::string|2048_mean 6359 ns 6359 ns 10
|
||||
replace bb to ---- in std::string|2048_median 6499 ns 6499 ns 10
|
||||
replace bb to ---- in std::string|2048_stddev 455 ns 455 ns 10
|
||||
replace bb to ---- in std::string|2048_cv 7.16 % 7.16 % 10
|
||||
replace bb to ---- in lstringa<8>|64_mean 167 ns 167 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_median 167 ns 167 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_stddev 3.62 ns 3.62 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.17 % 2.17 % 10
|
||||
replace bb to ---- in lstringa<8>|256_mean 495 ns 495 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_median 492 ns 492 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_stddev 10.9 ns 10.9 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_cv 2.20 % 2.20 % 10
|
||||
replace bb to ---- in lstringa<8>|512_mean 922 ns 922 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_median 922 ns 922 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_stddev 23.3 ns 23.3 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.53 % 2.53 % 10
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1862 ns 1862 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_median 1861 ns 1861 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 30.7 ns 30.7 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.65 % 1.65 % 10
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3551 ns 3551 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_median 3539 ns 3539 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 62.8 ns 62.8 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_cv 1.77 % 1.77 % 10
|
||||
replace bb to ---- by init stringa|64_mean 121 ns 121 ns 10
|
||||
replace bb to ---- by init stringa|64_median 122 ns 122 ns 10
|
||||
replace bb to ---- by init stringa|64_stddev 2.81 ns 2.81 ns 10
|
||||
replace bb to ---- by init stringa|64_cv 2.31 % 2.31 % 10
|
||||
replace bb to ---- by init stringa|256_mean 444 ns 444 ns 10
|
||||
replace bb to ---- by init stringa|256_median 444 ns 444 ns 10
|
||||
replace bb to ---- by init stringa|256_stddev 6.27 ns 6.27 ns 10
|
||||
replace bb to ---- by init stringa|256_cv 1.41 % 1.41 % 10
|
||||
replace bb to ---- by init stringa|512_mean 827 ns 827 ns 10
|
||||
replace bb to ---- by init stringa|512_median 825 ns 825 ns 10
|
||||
replace bb to ---- by init stringa|512_stddev 15.8 ns 15.8 ns 10
|
||||
replace bb to ---- by init stringa|512_cv 1.91 % 1.91 % 10
|
||||
replace bb to ---- by init stringa|1024_mean 1637 ns 1637 ns 10
|
||||
replace bb to ---- by init stringa|1024_median 1635 ns 1635 ns 10
|
||||
replace bb to ---- by init stringa|1024_stddev 22.9 ns 22.9 ns 10
|
||||
replace bb to ---- by init stringa|1024_cv 1.40 % 1.40 % 10
|
||||
replace bb to ---- by init stringa|2048_mean 3280 ns 3280 ns 10
|
||||
replace bb to ---- by init stringa|2048_median 3267 ns 3267 ns 10
|
||||
replace bb to ---- by init stringa|2048_stddev 71.3 ns 71.3 ns 10
|
||||
replace bb to ---- by init stringa|2048_cv 2.17 % 2.17 % 10
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to -- in std::string|64_mean 125 ns 125 ns 10
|
||||
replace bb to -- in std::string|64_median 125 ns 125 ns 10
|
||||
replace bb to -- in std::string|64_stddev 2.16 ns 2.16 ns 10
|
||||
replace bb to -- in std::string|64_cv 1.73 % 1.73 % 10
|
||||
replace bb to -- in std::string|256_mean 405 ns 405 ns 10
|
||||
replace bb to -- in std::string|256_median 402 ns 402 ns 10
|
||||
replace bb to -- in std::string|256_stddev 8.63 ns 8.63 ns 10
|
||||
replace bb to -- in std::string|256_cv 2.13 % 2.13 % 10
|
||||
replace bb to -- in std::string|512_mean 780 ns 780 ns 10
|
||||
replace bb to -- in std::string|512_median 777 ns 777 ns 10
|
||||
replace bb to -- in std::string|512_stddev 13.5 ns 13.5 ns 10
|
||||
replace bb to -- in std::string|512_cv 1.73 % 1.73 % 10
|
||||
replace bb to -- in std::string|1024_mean 1446 ns 1446 ns 10
|
||||
replace bb to -- in std::string|1024_median 1452 ns 1452 ns 10
|
||||
replace bb to -- in std::string|1024_stddev 23.9 ns 23.9 ns 10
|
||||
replace bb to -- in std::string|1024_cv 1.65 % 1.65 % 10
|
||||
replace bb to -- in std::string|2048_mean 3138 ns 3138 ns 10
|
||||
replace bb to -- in std::string|2048_median 3133 ns 3133 ns 10
|
||||
replace bb to -- in std::string|2048_stddev 68.1 ns 68.1 ns 10
|
||||
replace bb to -- in std::string|2048_cv 2.17 % 2.17 % 10
|
||||
replace bb to -- in lstringa<8>|64_mean 103 ns 103 ns 10
|
||||
replace bb to -- in lstringa<8>|64_median 103 ns 103 ns 10
|
||||
replace bb to -- in lstringa<8>|64_stddev 3.47 ns 3.47 ns 10
|
||||
replace bb to -- in lstringa<8>|64_cv 3.35 % 3.35 % 10
|
||||
replace bb to -- in lstringa<8>|256_mean 301 ns 301 ns 10
|
||||
replace bb to -- in lstringa<8>|256_median 300 ns 300 ns 10
|
||||
replace bb to -- in lstringa<8>|256_stddev 4.94 ns 4.94 ns 10
|
||||
replace bb to -- in lstringa<8>|256_cv 1.64 % 1.64 % 10
|
||||
replace bb to -- in lstringa<8>|512_mean 548 ns 548 ns 10
|
||||
replace bb to -- in lstringa<8>|512_median 549 ns 549 ns 10
|
||||
replace bb to -- in lstringa<8>|512_stddev 11.5 ns 11.5 ns 10
|
||||
replace bb to -- in lstringa<8>|512_cv 2.10 % 2.10 % 10
|
||||
replace bb to -- in lstringa<8>|1024_mean 1112 ns 1112 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_median 1117 ns 1117 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_stddev 21.9 ns 21.9 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_cv 1.97 % 1.97 % 10
|
||||
replace bb to -- in lstringa<8>|2048_mean 2105 ns 2105 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_median 2088 ns 2088 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_stddev 58.9 ns 58.9 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_cv 2.80 % 2.80 % 10
|
||||
replace bb to -- by init stringa|64_mean 91.4 ns 91.4 ns 10
|
||||
replace bb to -- by init stringa|64_median 91.0 ns 91.0 ns 10
|
||||
replace bb to -- by init stringa|64_stddev 1.74 ns 1.74 ns 10
|
||||
replace bb to -- by init stringa|64_cv 1.90 % 1.90 % 10
|
||||
replace bb to -- by init stringa|256_mean 261 ns 261 ns 10
|
||||
replace bb to -- by init stringa|256_median 258 ns 258 ns 10
|
||||
replace bb to -- by init stringa|256_stddev 7.95 ns 7.95 ns 10
|
||||
replace bb to -- by init stringa|256_cv 3.05 % 3.05 % 10
|
||||
replace bb to -- by init stringa|512_mean 485 ns 485 ns 10
|
||||
replace bb to -- by init stringa|512_median 485 ns 485 ns 10
|
||||
replace bb to -- by init stringa|512_stddev 6.01 ns 6.01 ns 10
|
||||
replace bb to -- by init stringa|512_cv 1.24 % 1.24 % 10
|
||||
replace bb to -- by init stringa|1024_mean 984 ns 984 ns 10
|
||||
replace bb to -- by init stringa|1024_median 976 ns 976 ns 10
|
||||
replace bb to -- by init stringa|1024_stddev 31.5 ns 31.5 ns 10
|
||||
replace bb to -- by init stringa|1024_cv 3.20 % 3.20 % 10
|
||||
replace bb to -- by init stringa|2048_mean 1862 ns 1862 ns 10
|
||||
replace bb to -- by init stringa|2048_median 1872 ns 1872 ns 10
|
||||
replace bb to -- by init stringa|2048_stddev 35.5 ns 35.5 ns 10
|
||||
replace bb to -- by init stringa|2048_cv 1.91 % 1.91 % 10
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3769704 ns 3769718 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3760472 ns 3760485 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 60750 ns 60751 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 1.61 % 1.61 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3652417 ns 3652436 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3645060 ns 3645073 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 82821 ns 82811 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 2.27 % 2.27 % 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3800957 ns 3800973 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3796589 ns 3796604 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 47150 ns 47150 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.24 % 1.24 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4103196 ns 4103210 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4108227 ns 4108241 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 68621 ns 68620 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 1.67 % 1.67 % 10
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Build func full name std::string;_mean 949 ns 949 ns 10
|
||||
Build func full name std::string;_median 945 ns 945 ns 10
|
||||
Build func full name std::string;_stddev 33.5 ns 33.5 ns 10
|
||||
Build func full name std::string;_cv 3.53 % 3.53 % 10
|
||||
Build func full name std::string 1;_mean 1025 ns 1025 ns 10
|
||||
Build func full name std::string 1;_median 1017 ns 1017 ns 10
|
||||
Build func full name std::string 1;_stddev 35.7 ns 35.7 ns 10
|
||||
Build func full name std::string 1;_cv 3.48 % 3.48 % 10
|
||||
Build func full name std::stream;_mean 2654 ns 2654 ns 10
|
||||
Build func full name std::stream;_median 2648 ns 2648 ns 10
|
||||
Build func full name std::stream;_stddev 33.0 ns 33.0 ns 10
|
||||
Build func full name std::stream;_cv 1.24 % 1.24 % 10
|
||||
Build func full name stringa;_mean 500 ns 500 ns 10
|
||||
Build func full name stringa;_median 494 ns 494 ns 10
|
||||
Build func full name stringa;_stddev 16.0 ns 16.0 ns 10
|
||||
Build func full name stringa;_cv 3.20 % 3.20 % 10
|
||||
Build func full name stringa 1;_mean 716 ns 716 ns 10
|
||||
Build func full name stringa 1;_median 712 ns 712 ns 10
|
||||
Build func full name stringa 1;_stddev 20.9 ns 20.9 ns 10
|
||||
Build func full name stringa 1;_cv 2.92 % 2.92 % 10
|
||||
|
|
@ -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 GNU 15.2.0
|
||||
2026-03-22T13:04:50+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.06, 0.09, 0.08
|
||||
***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 160 ns 160 ns 4
|
||||
Concat email std::format_median 162 ns 162 ns 4
|
||||
Concat email std::format_stddev 4.85 ns 4.85 ns 4
|
||||
Concat email std::format_cv 3.03 % 3.03 % 4
|
||||
Concat email std::stringstream_mean 321 ns 321 ns 4
|
||||
Concat email std::stringstream_median 322 ns 322 ns 4
|
||||
Concat email std::stringstream_stddev 3.32 ns 3.32 ns 4
|
||||
Concat email std::stringstream_cv 1.04 % 1.03 % 4
|
||||
Concat email stringzilla append_mean 108 ns 108 ns 4
|
||||
Concat email stringzilla append_median 108 ns 108 ns 4
|
||||
Concat email stringzilla append_stddev 3.84 ns 3.85 ns 4
|
||||
Concat email stringzilla append_cv 3.57 % 3.57 % 4
|
||||
Concat email stringzilla concat_mean 42.8 ns 42.8 ns 4
|
||||
Concat email stringzilla concat_median 42.0 ns 42.0 ns 4
|
||||
Concat email stringzilla concat_stddev 1.96 ns 1.96 ns 4
|
||||
Concat email stringzilla concat_cv 4.57 % 4.57 % 4
|
||||
Concat email std::string append_mean 79.2 ns 79.2 ns 4
|
||||
Concat email std::string append_median 79.1 ns 79.1 ns 4
|
||||
Concat email std::string append_stddev 2.03 ns 2.03 ns 4
|
||||
Concat email std::string append_cv 2.57 % 2.57 % 4
|
||||
Concat email std::string by strexpr_mean 34.4 ns 34.4 ns 4
|
||||
Concat email std::string by strexpr_median 34.7 ns 34.7 ns 4
|
||||
Concat email std::string by strexpr_stddev 0.818 ns 0.818 ns 4
|
||||
Concat email std::string by strexpr_cv 2.38 % 2.38 % 4
|
||||
Concat email stringa_mean 40.7 ns 40.7 ns 4
|
||||
Concat email stringa_median 40.5 ns 40.5 ns 4
|
||||
Concat email stringa_stddev 0.971 ns 0.971 ns 4
|
||||
Concat email stringa_cv 2.38 % 2.38 % 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 214 ns 214 ns 4
|
||||
Concat std::string and number by std to std::string_median 216 ns 216 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 4.91 ns 4.91 ns 4
|
||||
Concat std::string and number by std to std::string_cv 2.30 % 2.30 % 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 101 ns 101 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 2.74 ns 2.74 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 2.69 % 2.69 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 72.3 ns 72.3 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 72.4 ns 72.4 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 1.59 ns 1.59 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 2.21 % 2.21 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 77.7 ns 77.7 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 77.5 ns 77.5 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 2.73 ns 2.73 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 3.52 % 3.52 % 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 728 ns 728 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 732 ns 732 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 19.6 ns 19.6 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 2.68 % 2.68 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 893 ns 893 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 890 ns 890 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 22.3 ns 22.3 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 2.49 % 2.49 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 199 ns 199 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 199 ns 199 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 1.39 ns 1.39 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 0.70 % 0.70 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 125 ns 125 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 126 ns 126 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 1.84 ns 1.84 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 1.47 % 1.47 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 122 ns 122 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 122 ns 122 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 1.10 ns 1.10 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 0.90 % 0.90 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 125 ns 125 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 125 ns 125 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 2.16 ns 2.16 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 1.73 % 1.73 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 172 ns 172 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 171 ns 171 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 4.63 ns 4.63 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 2.69 % 2.69 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 280 ns 280 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 279 ns 279 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 5.80 ns 5.80 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 2.07 % 2.07 % 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 261 ns 261 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 261 ns 261 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 4.51 ns 4.51 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 1.73 % 1.73 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 315 ns 315 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 316 ns 316 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 3.45 ns 3.45 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 1.09 % 1.09 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 593 ns 593 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 587 ns 587 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 13.1 ns 13.1 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 2.21 % 2.21 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 629 ns 629 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 631 ns 631 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 19.2 ns 19.2 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 3.06 % 3.06 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 788 ns 788 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 794 ns 794 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 12.1 ns 12.1 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.54 % 1.54 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 1171 ns 1171 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 1170 ns 1170 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 4.63 ns 4.63 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 0.40 % 0.40 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 1176 ns 1176 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 1174 ns 1174 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 12.9 ns 12.9 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 1.09 % 1.09 % 4
|
||||
std::format with std::formatted_size_mean 2267 ns 2267 ns 4
|
||||
std::format with std::formatted_size_median 2276 ns 2276 ns 4
|
||||
std::format with std::formatted_size_stddev 38.4 ns 38.4 ns 4
|
||||
std::format with std::formatted_size_cv 1.69 % 1.69 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 2021 ns 2021 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 2023 ns 2023 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 41.5 ns 41.5 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 2.05 % 2.05 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 47.9 ns 47.9 ns 4
|
||||
Concat std::string by std to std::string_median 47.9 ns 47.9 ns 4
|
||||
Concat std::string by std to std::string_stddev 0.383 ns 0.383 ns 4
|
||||
Concat std::string by std to std::string_cv 0.80 % 0.80 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 35.3 ns 35.3 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 35.3 ns 35.3 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 0.618 ns 0.618 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 1.75 % 1.75 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 27.4 ns 27.4 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 27.4 ns 27.4 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 0.154 ns 0.153 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 0.56 % 0.56 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 119 ns 119 ns 4
|
||||
Find concat three std::string_median 118 ns 118 ns 4
|
||||
Find concat three std::string_stddev 1.87 ns 1.87 ns 4
|
||||
Find concat three std::string_cv 1.57 % 1.57 % 4
|
||||
Find concat three strexpr_mean 38.2 ns 38.2 ns 4
|
||||
Find concat three strexpr_median 38.2 ns 38.2 ns 4
|
||||
Find concat three strexpr_stddev 0.339 ns 0.339 ns 4
|
||||
Find concat three strexpr_cv 0.89 % 0.89 % 4
|
||||
Find concat three simstr_mean 15.6 ns 15.6 ns 4
|
||||
Find concat three simstr_median 15.6 ns 15.6 ns 4
|
||||
Find concat three simstr_stddev 0.214 ns 0.214 ns 4
|
||||
Find concat three simstr_cv 1.37 % 1.37 % 4
|
||||
Find concat three stringzilla string_mean 125 ns 125 ns 4
|
||||
Find concat three stringzilla string_median 125 ns 125 ns 4
|
||||
Find concat three stringzilla string_stddev 1.18 ns 1.18 ns 4
|
||||
Find concat three stringzilla string_cv 0.94 % 0.94 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 8.65 ns 8.65 ns 4
|
||||
BuildTypeNameStr 0/0_median 8.66 ns 8.66 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.131 ns 0.131 ns 4
|
||||
BuildTypeNameStr 0/0_cv 1.51 % 1.51 % 4
|
||||
BuildTypeNameExp 0/0_mean 6.99 ns 6.99 ns 4
|
||||
BuildTypeNameExp 0/0_median 7.01 ns 7.01 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.134 ns 0.134 ns 4
|
||||
BuildTypeNameExp 0/0_cv 1.92 % 1.92 % 4
|
||||
BuildTypeNameSim 0/0_mean 4.97 ns 4.97 ns 4
|
||||
BuildTypeNameSim 0/0_median 4.98 ns 4.98 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.065 ns 0.065 ns 4
|
||||
BuildTypeNameSim 0/0_cv 1.31 % 1.31 % 4
|
||||
BuildTypeNameStr 10/10_mean 76.6 ns 76.6 ns 4
|
||||
BuildTypeNameStr 10/10_median 76.1 ns 76.1 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 1.27 ns 1.27 ns 4
|
||||
BuildTypeNameStr 10/10_cv 1.65 % 1.65 % 4
|
||||
BuildTypeNameExp 10/10_mean 27.9 ns 27.9 ns 4
|
||||
BuildTypeNameExp 10/10_median 27.9 ns 27.9 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 0.740 ns 0.740 ns 4
|
||||
BuildTypeNameExp 10/10_cv 2.66 % 2.66 % 4
|
||||
BuildTypeNameSim 10/10_mean 22.6 ns 22.6 ns 4
|
||||
BuildTypeNameSim 10/10_median 22.3 ns 22.3 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 0.683 ns 0.683 ns 4
|
||||
BuildTypeNameSim 10/10_cv 3.02 % 3.02 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 236 ns 236 ns 4
|
||||
Concat with replace str_median 236 ns 236 ns 4
|
||||
Concat with replace str_stddev 4.01 ns 4.01 ns 4
|
||||
Concat with replace str_cv 1.70 % 1.70 % 4
|
||||
Concat with replace exp_mean 135 ns 135 ns 4
|
||||
Concat with replace exp_median 134 ns 134 ns 4
|
||||
Concat with replace exp_stddev 3.94 ns 3.94 ns 4
|
||||
Concat with replace exp_cv 2.92 % 2.92 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 1.13 ns 1.13 ns 4
|
||||
std::string e;_median 1.13 ns 1.13 ns 4
|
||||
std::string e;_stddev 0.012 ns 0.012 ns 4
|
||||
std::string e;_cv 1.09 % 1.09 % 4
|
||||
std::string_view e;_mean 0.754 ns 0.754 ns 4
|
||||
std::string_view e;_median 0.751 ns 0.751 ns 4
|
||||
std::string_view e;_stddev 0.013 ns 0.013 ns 4
|
||||
std::string_view e;_cv 1.68 % 1.68 % 4
|
||||
ssa e;_mean 0.187 ns 0.187 ns 4
|
||||
ssa e;_median 0.186 ns 0.186 ns 4
|
||||
ssa e;_stddev 0.002 ns 0.002 ns 4
|
||||
ssa e;_cv 1.20 % 1.20 % 4
|
||||
stringa e;_mean 0.753 ns 0.753 ns 4
|
||||
stringa e;_median 0.757 ns 0.757 ns 4
|
||||
stringa e;_stddev 0.011 ns 0.011 ns 4
|
||||
stringa e;_cv 1.52 % 1.52 % 4
|
||||
lstringa<20> e;_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<20> e;_median 1.15 ns 1.15 ns 4
|
||||
lstringa<20> e;_stddev 0.016 ns 0.016 ns 4
|
||||
lstringa<20> e;_cv 1.44 % 1.44 % 4
|
||||
lstringa<40> e;_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e;_median 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e;_stddev 0.016 ns 0.016 ns 4
|
||||
lstringa<40> e;_cv 1.39 % 1.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.89 ns 1.89 ns 4
|
||||
std::string e = "Test text";_median 1.89 ns 1.89 ns 4
|
||||
std::string e = "Test text";_stddev 0.034 ns 0.034 ns 4
|
||||
std::string e = "Test text";_cv 1.80 % 1.80 % 4
|
||||
std::string_view e = "Test text";_mean 0.754 ns 0.754 ns 4
|
||||
std::string_view e = "Test text";_median 0.753 ns 0.753 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.007 ns 0.007 ns 4
|
||||
std::string_view e = "Test text";_cv 0.97 % 0.97 % 4
|
||||
ssa e = "Test text";_mean 0.757 ns 0.757 ns 4
|
||||
ssa e = "Test text";_median 0.761 ns 0.761 ns 4
|
||||
ssa e = "Test text";_stddev 0.011 ns 0.011 ns 4
|
||||
ssa e = "Test text";_cv 1.44 % 1.44 % 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.26 % 1.26 % 4
|
||||
lstringa<20> e = "Test text";_mean 1.92 ns 1.92 ns 4
|
||||
lstringa<20> e = "Test text";_median 1.89 ns 1.89 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.080 ns 0.080 ns 4
|
||||
lstringa<20> e = "Test text";_cv 4.18 % 4.18 % 4
|
||||
lstringa<40> e = "Test text";_mean 1.90 ns 1.90 ns 4
|
||||
lstringa<40> e = "Test text";_median 1.90 ns 1.90 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.021 ns 0.021 ns 4
|
||||
lstringa<40> e = "Test text";_cv 1.08 % 1.08 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 19.7 ns 19.7 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 19.8 ns 19.8 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.335 ns 0.335 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 1.70 % 1.70 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.751 ns 0.751 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.752 ns 0.752 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.009 ns 0.009 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.19 % 1.19 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 0.761 ns 0.761 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 0.764 ns 0.764 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.014 ns 0.014 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 1.89 % 1.89 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 1.13 ns 1.13 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 1.14 ns 1.14 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.015 ns 0.015 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 1.34 % 1.34 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 18.3 ns 18.3 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 18.3 ns 18.3 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.389 ns 0.389 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 2.12 % 2.12 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 1.91 ns 1.91 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 1.91 ns 1.91 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.011 ns 0.011 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 0.60 % 0.60 % 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 5.03 ns 5.03 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 5.05 ns 5.05 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.100 ns 0.100 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 1.98 % 1.98 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.388 ns 0.388 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.389 ns 0.389 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.003 ns 0.003 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 0.81 % 0.81 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 0.388 ns 0.388 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 0.391 ns 0.391 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.009 ns 0.009 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 2.21 % 2.21 % 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.017 ns 0.017 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 1.53 % 1.53 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 1.15 ns 1.15 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.018 ns 0.018 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.60 % 1.60 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 1.15 ns 1.15 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.016 ns 0.016 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.38 % 1.38 % 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 23.2 ns 23.2 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 23.4 ns 23.4 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 0.477 ns 0.477 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 2.06 % 2.06 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.759 ns 0.759 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.760 ns 0.760 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.004 ns 0.004 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 0.54 % 0.54 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.758 ns 0.758 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.754 ns 0.754 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.017 ns 0.017 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 2.19 % 2.19 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 6.85 ns 6.85 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 6.85 ns 6.85 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.024 ns 0.024 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 0.36 % 0.36 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 17.7 ns 17.7 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 17.6 ns 17.6 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.244 ns 0.244 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 1.38 % 1.38 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 4.18 ns 4.18 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 4.16 ns 4.16 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.121 ns 0.121 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 2.90 % 2.90 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 87.9 ns 87.9 ns 4
|
||||
sz::string::find;_median 87.9 ns 87.9 ns 4
|
||||
sz::string::find;_stddev 1.17 ns 1.17 ns 4
|
||||
sz::string::find;_cv 1.33 % 1.33 % 4
|
||||
std::string::find;_mean 6.95 ns 6.95 ns 4
|
||||
std::string::find;_median 6.95 ns 6.95 ns 4
|
||||
std::string::find;_stddev 0.069 ns 0.069 ns 4
|
||||
std::string::find;_cv 0.99 % 0.99 % 4
|
||||
std::string_view::find;_mean 7.39 ns 7.39 ns 4
|
||||
std::string_view::find;_median 7.40 ns 7.40 ns 4
|
||||
std::string_view::find;_stddev 0.118 ns 0.118 ns 4
|
||||
std::string_view::find;_cv 1.59 % 1.59 % 4
|
||||
ssa::find;_mean 6.87 ns 6.87 ns 4
|
||||
ssa::find;_median 6.88 ns 6.88 ns 4
|
||||
ssa::find;_stddev 0.131 ns 0.131 ns 4
|
||||
ssa::find;_cv 1.90 % 1.90 % 4
|
||||
stringa::find;_mean 7.21 ns 7.21 ns 4
|
||||
stringa::find;_median 7.18 ns 7.18 ns 4
|
||||
stringa::find;_stddev 0.196 ns 0.196 ns 4
|
||||
stringa::find;_cv 2.72 % 2.72 % 4
|
||||
lstringa<20>::find;_mean 6.52 ns 6.52 ns 4
|
||||
lstringa<20>::find;_median 6.56 ns 6.56 ns 4
|
||||
lstringa<20>::find;_stddev 0.116 ns 0.116 ns 4
|
||||
lstringa<20>::find;_cv 1.78 % 1.78 % 4
|
||||
lstringa<40>::find;_mean 6.49 ns 6.49 ns 4
|
||||
lstringa<40>::find;_median 6.48 ns 6.48 ns 4
|
||||
lstringa<40>::find;_stddev 0.150 ns 0.150 ns 4
|
||||
lstringa<40>::find;_cv 2.31 % 2.31 % 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 5.01 ns 5.01 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 5.01 ns 5.02 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 0.085 ns 0.085 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 1.70 % 1.70 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 29.4 ns 29.4 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 29.6 ns 29.6 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 1.16 ns 1.16 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 3.93 % 3.93 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 28.9 ns 28.9 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 28.8 ns 28.8 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 0.401 ns 0.401 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 1.39 % 1.39 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 22.3 ns 22.3 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 22.4 ns 22.4 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 0.245 ns 0.245 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 1.10 % 1.10 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 21.5 ns 21.5 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 21.5 ns 21.5 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 0.170 ns 0.170 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 0.79 % 0.79 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 24.6 ns 24.6 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 24.6 ns 24.6 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 0.699 ns 0.699 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 2.85 % 2.85 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 24.2 ns 24.2 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 24.4 ns 24.4 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 0.806 ns 0.806 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 3.33 % 3.33 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 25.7 ns 25.7 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 25.8 ns 25.8 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 0.425 ns 0.425 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 1.65 % 1.65 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 28.5 ns 28.5 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 28.4 ns 28.4 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 0.749 ns 0.749 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 2.63 % 2.63 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 33.4 ns 33.4 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 33.5 ns 33.5 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 0.562 ns 0.562 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 1.68 % 1.68 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 122 ns 122 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 122 ns 122 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 2.42 ns 2.42 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 1.99 % 1.99 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 157 ns 157 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 157 ns 157 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 7.01 ns 7.01 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 4.47 % 4.47 % 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.015 ns 0.015 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 1.32 % 1.32 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 1.15 ns 1.15 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 1.16 ns 1.16 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.020 ns 0.020 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.73 % 1.73 % 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.022 ns 0.022 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 1.93 % 1.93 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.124 ns 0.124 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 0.76 % 0.76 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.140 ns 0.140 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 0.85 % 0.85 % 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.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.159 ns 0.159 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 0.97 % 0.97 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.099 ns 0.099 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 0.60 % 0.60 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.095 ns 0.095 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.58 % 0.58 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 16.3 ns 16.3 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.048 ns 0.048 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 0.29 % 0.29 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 16.4 ns 16.4 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.066 ns 0.066 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 0.40 % 0.40 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 16.4 ns 16.4 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.039 ns 0.039 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.24 % 0.24 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 16.5 ns 16.5 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.072 ns 0.072 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 0.43 % 0.43 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 1.16 ns 1.16 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.021 ns 0.021 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.83 % 1.83 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 4.89 ns 4.89 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 4.91 ns 4.91 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.063 ns 0.063 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.29 % 1.29 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 4.91 ns 4.91 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 4.89 ns 4.89 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.079 ns 0.079 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.60 % 1.60 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 22.4 ns 22.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 22.1 ns 22.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 0.925 ns 0.925 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 4.12 % 4.12 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 22.5 ns 22.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 22.4 ns 22.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.344 ns 0.344 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 1.53 % 1.53 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 24.3 ns 24.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 24.2 ns 24.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 0.482 ns 0.482 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 1.99 % 1.99 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 33.8 ns 33.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 33.9 ns 33.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 0.822 ns 0.822 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 2.43 % 2.43 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 25.9 ns 25.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 25.9 ns 25.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 0.442 ns 0.442 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 1.71 % 1.71 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 34.8 ns 34.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 34.9 ns 34.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 0.270 ns 0.270 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 0.78 % 0.78 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 99.7 ns 99.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 99.2 ns 99.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 2.75 ns 2.75 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 2.75 % 2.76 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 110 ns 110 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 111 ns 111 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 3.07 ns 3.07 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 2.78 % 2.78 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 129 ns 129 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 130 ns 130 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 2.98 ns 2.98 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 2.32 % 2.32 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 1.15 ns 1.15 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 1.15 ns 1.15 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.018 ns 0.018 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 1.55 % 1.55 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 4.22 ns 4.22 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 4.20 ns 4.20 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.108 ns 0.108 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 2.57 % 2.57 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 4.24 ns 4.24 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 4.23 ns 4.23 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.108 ns 0.108 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 2.55 % 2.55 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 4.26 ns 4.26 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 4.24 ns 4.24 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.075 ns 0.075 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.77 % 1.77 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 4.20 ns 4.20 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 4.17 ns 4.17 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.082 ns 0.082 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.95 % 1.95 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 5.67 ns 5.67 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 5.67 ns 5.67 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.074 ns 0.074 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 1.31 % 1.31 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 6.29 ns 6.29 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 6.30 ns 6.30 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.125 ns 0.125 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 1.98 % 1.98 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 7.98 ns 7.98 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 7.98 ns 7.98 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.053 ns 0.053 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 0.66 % 0.66 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 10.2 ns 10.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 10.2 ns 10.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.100 ns 0.100 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 0.98 % 0.98 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 96.5 ns 96.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 95.5 ns 95.5 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 3.21 ns 3.21 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 3.32 % 3.32 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 103 ns 103 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 103 ns 103 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 2.63 ns 2.63 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.55 % 2.55 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 126 ns 126 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 126 ns 126 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 5.68 ns 5.68 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 4.51 % 4.51 % 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.9 ns 27.9 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 27.9 ns 27.9 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.402 ns 0.402 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.44 % 1.44 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 12.5 ns 12.5 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 12.3 ns 12.3 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.396 ns 0.396 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 3.17 % 3.17 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 16.8 ns 16.8 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 16.8 ns 16.8 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.196 ns 0.196 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.16 % 1.16 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 7.54 ns 7.54 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 7.55 ns 7.55 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.041 ns 0.041 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.55 % 0.55 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 8.43 ns 8.43 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 8.42 ns 8.42 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.141 ns 0.141 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.68 % 1.68 % 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 23.9 ns 23.9 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 23.9 ns 23.9 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.614 ns 0.614 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 2.58 % 2.58 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 9.15 ns 9.15 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 9.19 ns 9.19 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.181 ns 0.181 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.98 % 1.98 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 16.2 ns 16.2 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 16.3 ns 16.3 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.118 ns 0.118 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 0.73 % 0.73 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 6.48 ns 6.48 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 6.45 ns 6.45 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.151 ns 0.151 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.32 % 2.32 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 6.42 ns 6.42 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 6.43 ns 6.43 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.128 ns 0.128 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.99 % 1.99 % 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.1 ns 29.1 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 29.1 ns 29.1 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.141 ns 0.141 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 0.49 % 0.49 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 23.8 ns 23.8 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 23.7 ns 23.7 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.203 ns 0.203 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.85 % 0.85 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 11.0 ns 11.0 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 11.1 ns 11.1 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.156 ns 0.156 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.41 % 1.41 % 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 66.3 ns 66.3 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 66.2 ns 66.2 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 0.163 ns 0.163 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 0.25 % 0.25 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 24.4 ns 24.4 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 24.2 ns 24.2 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 0.303 ns 0.303 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 1.24 % 1.24 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 24.5 ns 24.5 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 24.5 ns 24.5 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.380 ns 0.380 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 1.55 % 1.55 % 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 1411 ns 1411 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 1412 ns 1412 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 35.0 ns 35.0 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.48 % 2.48 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 380 ns 380 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 380 ns 380 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 9.10 ns 9.10 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.40 % 2.40 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 364 ns 364 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 365 ns 365 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 7.15 ns 7.14 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 1.96 % 1.96 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 271 ns 271 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 274 ns 274 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 11.8 ns 11.8 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 4.35 % 4.35 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 229 ns 229 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 233 ns 233 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 8.90 ns 8.90 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 3.89 % 3.89 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 144 ns 144 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 144 ns 144 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 1.68 ns 1.68 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.17 % 1.17 % 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 1391 ns 1391 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 1393 ns 1393 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 6.61 ns 6.60 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 0.48 % 0.47 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 1161 ns 1161 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 1163 ns 1163 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 17.5 ns 17.5 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.51 % 1.51 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 443 ns 443 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 443 ns 443 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 6.52 ns 6.52 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.47 % 1.47 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 368 ns 368 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 369 ns 369 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 12.5 ns 12.5 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.41 % 3.41 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 348 ns 348 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 354 ns 354 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 17.3 ns 17.3 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 4.98 % 4.98 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 214 ns 214 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 215 ns 215 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 3.03 ns 3.03 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.41 % 1.41 % 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 75407 ns 75407 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 76071 ns 76071 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 1624 ns 1624 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 2.15 % 2.15 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 67303 ns 67303 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 67374 ns 67374 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 747 ns 747 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.11 % 1.11 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 20392 ns 20392 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 20416 ns 20416 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 93.8 ns 93.8 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 0.46 % 0.46 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17950 ns 17950 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 18065 ns 18065 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 352 ns 352 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.96 % 1.96 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17908 ns 17908 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17973 ns 17972 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 436 ns 436 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.44 % 2.44 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17735 ns 17735 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17771 ns 17771 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 347 ns 347 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.95 % 1.95 % 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 1397 ns 1397 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 1392 ns 1392 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 41.3 ns 41.3 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.95 % 2.95 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 1344 ns 1344 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 1332 ns 1332 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 64.6 ns 64.6 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 4.81 % 4.81 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 547 ns 547 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 551 ns 551 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 9.05 ns 9.05 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 1.65 % 1.65 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 454 ns 454 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 457 ns 457 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 12.0 ns 12.0 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 2.64 % 2.64 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 422 ns 422 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 426 ns 426 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 25.1 ns 25.1 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 5.95 % 5.95 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 310 ns 310 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 311 ns 311 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 6.36 ns 6.36 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 2.05 % 2.05 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 3033 ns 3033 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 3046 ns 3046 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 70.7 ns 70.7 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 2.33 % 2.33 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 427 ns 427 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 426 ns 426 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 5.62 ns 5.61 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 1.32 % 1.32 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 1487 ns 1487 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 1478 ns 1478 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 26.4 ns 26.4 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.78 % 1.78 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 1206 ns 1206 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 1196 ns 1196 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 34.6 ns 34.6 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 2.87 % 2.87 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 1559 ns 1559 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 1553 ns 1553 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 41.0 ns 41.0 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.63 % 2.63 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1054 ns 1054 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1047 ns 1047 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 16.7 ns 16.7 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 1.58 % 1.58 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 290 ns 290 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 289 ns 289 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 3.95 ns 3.95 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 1.36 % 1.36 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 136 ns 136 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 136 ns 136 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 2.69 ns 2.69 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 1.98 % 1.98 % 4
|
||||
stringa str = "test = " + k + " times";_mean 137 ns 137 ns 4
|
||||
stringa str = "test = " + k + " times";_median 138 ns 138 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 2.86 ns 2.86 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 2.09 % 2.09 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 275 ns 275 ns 4
|
||||
std::string::find + substr + std::strtol_median 276 ns 276 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 7.55 ns 7.55 ns 4
|
||||
std::string::find + substr + std::strtol_cv 2.74 % 2.74 % 4
|
||||
ssa::splitter + ssa::as_int_mean 192 ns 192 ns 4
|
||||
ssa::splitter + ssa::as_int_median 192 ns 192 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 3.46 ns 3.46 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 1.80 % 1.80 % 4
|
||||
ssa::splitf + functor_mean 196 ns 196 ns 4
|
||||
ssa::splitf + functor_median 196 ns 196 ns 4
|
||||
ssa::splitf + functor_stddev 0.580 ns 0.580 ns 4
|
||||
ssa::splitf + functor_cv 0.30 % 0.30 % 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 822 ns 822 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 821 ns 821 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 19.8 ns 19.8 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 2.41 % 2.41 % 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 2424 ns 2424 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 88.6 ns 88.6 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 3.65 % 3.65 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 1065 ns 1065 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 1062 ns 1062 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 18.7 ns 18.7 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 1.76 % 1.76 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1372 ns 1372 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1363 ns 1363 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 28.6 ns 28.6 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 2.09 % 2.09 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1016 ns 1016 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1011 ns 1011 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 19.6 ns 19.6 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 1.93 % 1.93 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1045 ns 1045 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 1039 ns 1039 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 35.5 ns 35.5 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 3.40 % 3.40 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 837 ns 837 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 842 ns 842 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 17.2 ns 17.2 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 2.06 % 2.06 % 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 161 ns 161 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 161 ns 161 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 2.20 ns 2.20 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.36 % 1.36 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 329 ns 329 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 329 ns 329 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 8.06 ns 8.06 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 2.45 % 2.45 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 154 ns 154 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 153 ns 153 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 5.45 ns 5.45 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 3.55 % 3.55 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 180 ns 180 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 179 ns 179 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 4.51 ns 4.51 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 2.50 % 2.50 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 184 ns 184 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 184 ns 184 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 2.95 ns 2.95 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 1.61 % 1.61 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 139 ns 139 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 139 ns 139 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 1.27 ns 1.27 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 0.91 % 0.91 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 132 ns 132 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 132 ns 132 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 1.26 ns 1.26 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 0.95 % 0.95 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 154 ns 154 ns 4
|
||||
replace bb to ---- in std::string|64_median 154 ns 154 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 1.72 ns 1.72 ns 4
|
||||
replace bb to ---- in std::string|64_cv 1.11 % 1.11 % 4
|
||||
replace bb to ---- in std::string|256_mean 504 ns 504 ns 4
|
||||
replace bb to ---- in std::string|256_median 504 ns 504 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 18.2 ns 18.2 ns 4
|
||||
replace bb to ---- in std::string|256_cv 3.62 % 3.62 % 4
|
||||
replace bb to ---- in std::string|512_mean 1000 ns 1000 ns 4
|
||||
replace bb to ---- in std::string|512_median 1002 ns 1002 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 17.0 ns 17.0 ns 4
|
||||
replace bb to ---- in std::string|512_cv 1.70 % 1.70 % 4
|
||||
replace bb to ---- in std::string|1024_mean 2347 ns 2347 ns 4
|
||||
replace bb to ---- in std::string|1024_median 2324 ns 2324 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 166 ns 166 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 7.05 % 7.05 % 4
|
||||
replace bb to ---- in std::string|2048_mean 5969 ns 5969 ns 4
|
||||
replace bb to ---- in std::string|2048_median 5919 ns 5919 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 266 ns 266 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 4.46 % 4.46 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 138 ns 138 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 139 ns 139 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 3.50 ns 3.50 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.53 % 2.53 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 444 ns 444 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 447 ns 447 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 6.19 ns 6.19 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 1.39 % 1.39 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 899 ns 899 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 896 ns 896 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 19.6 ns 19.6 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.18 % 2.18 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1751 ns 1751 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 1752 ns 1752 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 11.7 ns 11.7 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 0.67 % 0.67 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3301 ns 3301 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 3294 ns 3294 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 81.9 ns 81.9 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 2.48 % 2.48 % 4
|
||||
replace bb to ---- by init stringa|64_mean 92.8 ns 92.8 ns 4
|
||||
replace bb to ---- by init stringa|64_median 92.6 ns 92.6 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 1.37 ns 1.37 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 1.48 % 1.48 % 4
|
||||
replace bb to ---- by init stringa|256_mean 287 ns 288 ns 4
|
||||
replace bb to ---- by init stringa|256_median 287 ns 287 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 1.86 ns 1.86 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 0.65 % 0.65 % 4
|
||||
replace bb to ---- by init stringa|512_mean 705 ns 705 ns 4
|
||||
replace bb to ---- by init stringa|512_median 702 ns 702 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 12.7 ns 12.7 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 1.79 % 1.79 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 1550 ns 1550 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 1543 ns 1543 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 19.4 ns 19.4 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 1.25 % 1.25 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 3106 ns 3106 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 3111 ns 3111 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 20.5 ns 20.4 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 0.66 % 0.66 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 131 ns 131 ns 4
|
||||
replace bb to -- in std::string|64_median 129 ns 129 ns 4
|
||||
replace bb to -- in std::string|64_stddev 4.51 ns 4.51 ns 4
|
||||
replace bb to -- in std::string|64_cv 3.45 % 3.45 % 4
|
||||
replace bb to -- in std::string|256_mean 381 ns 381 ns 4
|
||||
replace bb to -- in std::string|256_median 381 ns 381 ns 4
|
||||
replace bb to -- in std::string|256_stddev 5.71 ns 5.71 ns 4
|
||||
replace bb to -- in std::string|256_cv 1.50 % 1.50 % 4
|
||||
replace bb to -- in std::string|512_mean 743 ns 743 ns 4
|
||||
replace bb to -- in std::string|512_median 744 ns 744 ns 4
|
||||
replace bb to -- in std::string|512_stddev 6.19 ns 6.19 ns 4
|
||||
replace bb to -- in std::string|512_cv 0.83 % 0.83 % 4
|
||||
replace bb to -- in std::string|1024_mean 1483 ns 1483 ns 4
|
||||
replace bb to -- in std::string|1024_median 1477 ns 1477 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 36.1 ns 36.1 ns 4
|
||||
replace bb to -- in std::string|1024_cv 2.43 % 2.43 % 4
|
||||
replace bb to -- in std::string|2048_mean 2798 ns 2798 ns 4
|
||||
replace bb to -- in std::string|2048_median 2793 ns 2793 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 34.3 ns 34.2 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.23 % 1.22 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 91.5 ns 91.5 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 91.9 ns 91.9 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 2.11 ns 2.11 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 2.30 % 2.30 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 302 ns 302 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 305 ns 305 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 5.90 ns 5.90 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 1.95 % 1.95 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 539 ns 539 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 541 ns 541 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 7.25 ns 7.25 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 1.34 % 1.34 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 1121 ns 1121 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 1103 ns 1103 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 86.3 ns 86.3 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 7.70 % 7.70 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 2174 ns 2174 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 2126 ns 2126 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 136 ns 136 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 6.25 % 6.25 % 4
|
||||
replace bb to -- by init stringa|64_mean 112 ns 112 ns 4
|
||||
replace bb to -- by init stringa|64_median 112 ns 112 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 1.35 ns 1.35 ns 4
|
||||
replace bb to -- by init stringa|64_cv 1.20 % 1.20 % 4
|
||||
replace bb to -- by init stringa|256_mean 262 ns 262 ns 4
|
||||
replace bb to -- by init stringa|256_median 262 ns 262 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 3.25 ns 3.25 ns 4
|
||||
replace bb to -- by init stringa|256_cv 1.24 % 1.24 % 4
|
||||
replace bb to -- by init stringa|512_mean 479 ns 479 ns 4
|
||||
replace bb to -- by init stringa|512_median 478 ns 478 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 6.02 ns 6.02 ns 4
|
||||
replace bb to -- by init stringa|512_cv 1.26 % 1.26 % 4
|
||||
replace bb to -- by init stringa|1024_mean 954 ns 954 ns 4
|
||||
replace bb to -- by init stringa|1024_median 953 ns 953 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 27.7 ns 27.7 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 2.91 % 2.91 % 4
|
||||
replace bb to -- by init stringa|2048_mean 1809 ns 1809 ns 4
|
||||
replace bb to -- by init stringa|2048_median 1804 ns 1804 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 20.3 ns 20.3 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 1.12 % 1.12 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 3843202 ns 3843218 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 3876351 ns 3876368 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 83132 ns 83131 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 2.16 % 2.16 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 3689411 ns 3689422 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 3701989 ns 3701997 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 102615 ns 102613 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 2.78 % 2.78 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3848145 ns 3848147 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3860211 ns 3860203 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 53550 ns 53545 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.39 % 1.39 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 4076242 ns 4076215 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 4075582 ns 4075516 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 57080 ns 57087 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 1.40 % 1.40 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 738 ns 738 ns 4
|
||||
Build func full name std::string;_median 745 ns 745 ns 4
|
||||
Build func full name std::string;_stddev 20.2 ns 20.2 ns 4
|
||||
Build func full name std::string;_cv 2.74 % 2.74 % 4
|
||||
Build func full name std::string 1;_mean 820 ns 820 ns 4
|
||||
Build func full name std::string 1;_median 819 ns 819 ns 4
|
||||
Build func full name std::string 1;_stddev 7.48 ns 7.48 ns 4
|
||||
Build func full name std::string 1;_cv 0.91 % 0.91 % 4
|
||||
Build func full name std::stream;_mean 2610 ns 2610 ns 4
|
||||
Build func full name std::stream;_median 2628 ns 2628 ns 4
|
||||
Build func full name std::stream;_stddev 45.5 ns 45.5 ns 4
|
||||
Build func full name std::stream;_cv 1.75 % 1.75 % 4
|
||||
Build func full name stringa;_mean 480 ns 480 ns 4
|
||||
Build func full name stringa;_median 479 ns 479 ns 4
|
||||
Build func full name stringa;_stddev 6.26 ns 6.26 ns 4
|
||||
Build func full name stringa;_cv 1.30 % 1.30 % 4
|
||||
Build func full name stringa 1;_mean 564 ns 564 ns 4
|
||||
Build func full name stringa 1;_median 563 ns 563 ns 4
|
||||
Build func full name stringa 1;_stddev 12.8 ns 12.8 ns 4
|
||||
Build func full name stringa 1;_cv 2.26 % 2.26 % 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 174 ns 174 ns 4
|
||||
To upper case std::wstring_stddev 3.12 ns 3.12 ns 4
|
||||
To upper case std::wstring_cv 1.78 % 1.78 % 4
|
||||
To upper case lstringw<15>_mean 40.4 ns 40.4 ns 4
|
||||
To upper case lstringw<15>_median 40.3 ns 40.3 ns 4
|
||||
To upper case lstringw<15>_stddev 0.801 ns 0.801 ns 4
|
||||
To upper case lstringw<15>_cv 1.98 % 1.98 % 4
|
||||
|
|
@ -1,777 +0,0 @@
|
|||
2025-08-06T12:08:34+03:00
|
||||
Running benchStr.exe
|
||||
Run on (32 X 2518.87 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)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e;_mean 1.12 ns 1.11 ns 10
|
||||
std::string e;_median 1.12 ns 1.11 ns 10
|
||||
std::string e;_stddev 0.025 ns 0.033 ns 10
|
||||
std::string e;_cv 2.24 % 2.98 % 10
|
||||
std::string_view e;_mean 0.377 ns 0.373 ns 10
|
||||
std::string_view e;_median 0.376 ns 0.375 ns 10
|
||||
std::string_view e;_stddev 0.021 ns 0.025 ns 10
|
||||
std::string_view e;_cv 5.58 % 6.67 % 10
|
||||
ssa e;_mean 0.367 ns 0.364 ns 10
|
||||
ssa e;_median 0.367 ns 0.359 ns 10
|
||||
ssa e;_stddev 0.007 ns 0.015 ns 10
|
||||
ssa e;_cv 1.83 % 4.07 % 10
|
||||
stringa e;_mean 0.751 ns 0.748 ns 10
|
||||
stringa e;_median 0.747 ns 0.750 ns 10
|
||||
stringa e;_stddev 0.018 ns 0.019 ns 10
|
||||
stringa e;_cv 2.43 % 2.50 % 10
|
||||
lstringa<20> e;_mean 1.14 ns 1.13 ns 10
|
||||
lstringa<20> e;_median 1.14 ns 1.12 ns 10
|
||||
lstringa<20> e;_stddev 0.022 ns 0.018 ns 10
|
||||
lstringa<20> e;_cv 1.96 % 1.60 % 10
|
||||
lstringa<40> e;_mean 1.15 ns 1.13 ns 10
|
||||
lstringa<40> e;_median 1.12 ns 1.12 ns 10
|
||||
lstringa<40> e;_stddev 0.047 ns 0.044 ns 10
|
||||
lstringa<40> e;_cv 4.14 % 3.90 % 10
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text";_mean 1.85 ns 1.84 ns 10
|
||||
std::string e = "Test text";_median 1.85 ns 1.84 ns 10
|
||||
std::string e = "Test text";_stddev 0.025 ns 0.037 ns 10
|
||||
std::string e = "Test text";_cv 1.37 % 1.99 % 10
|
||||
std::string_view e = "Test text";_mean 0.740 ns 0.736 ns 10
|
||||
std::string_view e = "Test text";_median 0.740 ns 0.734 ns 10
|
||||
std::string_view e = "Test text";_stddev 0.012 ns 0.012 ns 10
|
||||
std::string_view e = "Test text";_cv 1.61 % 1.57 % 10
|
||||
ssa e = "Test text";_mean 0.371 ns 0.369 ns 10
|
||||
ssa e = "Test text";_median 0.370 ns 0.375 ns 10
|
||||
ssa e = "Test text";_stddev 0.006 ns 0.015 ns 10
|
||||
ssa e = "Test text";_cv 1.67 % 4.09 % 10
|
||||
stringa e = "Test text";_mean 1.12 ns 1.11 ns 10
|
||||
stringa e = "Test text";_median 1.12 ns 1.11 ns 10
|
||||
stringa e = "Test text";_stddev 0.028 ns 0.028 ns 10
|
||||
stringa e = "Test text";_cv 2.47 % 2.56 % 10
|
||||
lstringa<20> e = "Test text";_mean 1.84 ns 1.84 ns 10
|
||||
lstringa<20> e = "Test text";_median 1.85 ns 1.84 ns 10
|
||||
lstringa<20> e = "Test text";_stddev 0.022 ns 0.042 ns 10
|
||||
lstringa<20> e = "Test text";_cv 1.21 % 2.27 % 10
|
||||
lstringa<40> e = "Test text";_mean 1.87 ns 1.85 ns 10
|
||||
lstringa<40> e = "Test text";_median 1.87 ns 1.84 ns 10
|
||||
lstringa<40> e = "Test text";_stddev 0.035 ns 0.026 ns 10
|
||||
lstringa<40> e = "Test text";_cv 1.88 % 1.43 % 10
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 78.0 ns 76.6 ns 10
|
||||
std::string e = "123456789012345678901234567890";_median 78.2 ns 76.4 ns 10
|
||||
std::string e = "123456789012345678901234567890";_stddev 2.16 ns 2.02 ns 10
|
||||
std::string e = "123456789012345678901234567890";_cv 2.77 % 2.64 % 10
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.739 ns 0.731 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.736 ns 0.732 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.010 ns 0.017 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.40 % 2.37 % 10
|
||||
ssa e = "123456789012345678901234567890";_mean 0.369 ns 0.370 ns 10
|
||||
ssa e = "123456789012345678901234567890";_median 0.368 ns 0.375 ns 10
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.007 ns 0.011 ns 10
|
||||
ssa e = "123456789012345678901234567890";_cv 1.79 % 2.85 % 10
|
||||
stringa e = "123456789012345678901234567890";_mean 1.11 ns 1.10 ns 10
|
||||
stringa e = "123456789012345678901234567890";_median 1.11 ns 1.12 ns 10
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.014 ns 0.030 ns 10
|
||||
stringa e = "123456789012345678901234567890";_cv 1.30 % 2.71 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 82.0 ns 80.7 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 81.1 ns 79.3 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 2.75 ns 3.08 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 3.35 % 3.82 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 1.85 ns 1.84 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 1.85 ns 1.86 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.024 ns 0.049 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.30 % 2.67 % 10
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 1.87 ns 1.86 ns 10
|
||||
std::string e = "Test text"; auto c{e};_median 1.86 ns 1.86 ns 10
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.038 ns 0.036 ns 10
|
||||
std::string e = "Test text"; auto c{e};_cv 2.05 % 1.91 % 10
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.376 ns 0.377 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.374 ns 0.375 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.012 ns 0.012 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_cv 3.19 % 3.06 % 10
|
||||
ssa e = "Test text"; auto c{e};_mean 0.377 ns 0.378 ns 10
|
||||
ssa e = "Test text"; auto c{e};_median 0.375 ns 0.375 ns 10
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.014 ns 0.014 ns 10
|
||||
ssa e = "Test text"; auto c{e};_cv 3.68 % 3.80 % 10
|
||||
stringa e = "Test text"; auto c{e};_mean 1.32 ns 1.32 ns 10
|
||||
stringa e = "Test text"; auto c{e};_median 1.32 ns 1.31 ns 10
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.024 ns 0.022 ns 10
|
||||
stringa e = "Test text"; auto c{e};_cv 1.78 % 1.67 % 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 5.23 ns 5.20 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 5.23 ns 5.16 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.058 ns 0.105 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.11 % 2.03 % 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 5.24 ns 5.22 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 5.24 ns 5.23 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.068 ns 0.109 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.30 % 2.09 % 10
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 78.2 ns 78.0 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 77.6 ns 77.6 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 1.99 ns 2.73 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 2.55 % 3.51 % 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.741 ns 0.739 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.743 ns 0.741 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.008 ns 0.012 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.14 % 1.65 % 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.372 ns 0.370 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.374 ns 0.375 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.006 ns 0.013 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.71 % 3.47 % 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 1.89 ns 1.88 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 1.87 ns 1.88 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.045 ns 0.034 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 2.36 % 1.78 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 79.0 ns 78.0 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 78.7 ns 78.1 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 2.03 ns 1.80 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 2.57 % 2.30 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 4.95 ns 4.94 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 4.89 ns 4.84 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.243 ns 0.268 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 4.91 % 5.42 % 10
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find;_mean 39.5 ns 38.8 ns 10
|
||||
std::string::find;_median 38.9 ns 38.5 ns 10
|
||||
std::string::find;_stddev 1.56 ns 0.900 ns 10
|
||||
std::string::find;_cv 3.95 % 2.32 % 10
|
||||
std::string_view::find;_mean 39.1 ns 38.6 ns 10
|
||||
std::string_view::find;_median 39.0 ns 38.8 ns 10
|
||||
std::string_view::find;_stddev 0.455 ns 0.827 ns 10
|
||||
std::string_view::find;_cv 1.17 % 2.14 % 10
|
||||
ssa::find;_mean 18.2 ns 17.9 ns 10
|
||||
ssa::find;_median 18.2 ns 18.0 ns 10
|
||||
ssa::find;_stddev 0.242 ns 0.385 ns 10
|
||||
ssa::find;_cv 1.33 % 2.15 % 10
|
||||
stringa::find;_mean 18.8 ns 18.5 ns 10
|
||||
stringa::find;_median 18.4 ns 18.4 ns 10
|
||||
stringa::find;_stddev 0.795 ns 0.461 ns 10
|
||||
stringa::find;_cv 4.22 % 2.50 % 10
|
||||
lstringa<20>::find;_mean 18.2 ns 18.1 ns 10
|
||||
lstringa<20>::find;_median 18.0 ns 18.0 ns 10
|
||||
lstringa<20>::find;_stddev 0.505 ns 0.436 ns 10
|
||||
lstringa<20>::find;_cv 2.77 % 2.41 % 10
|
||||
lstringa<40>::find;_mean 17.8 ns 17.8 ns 10
|
||||
lstringa<40>::find;_median 17.8 ns 17.6 ns 10
|
||||
lstringa<40>::find;_stddev 0.232 ns 0.324 ns 10
|
||||
lstringa<40>::find;_cv 1.31 % 1.82 % 10
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string copy{str_with_len_N};/15_mean 1.85 ns 1.85 ns 10
|
||||
std::string copy{str_with_len_N};/15_median 1.85 ns 1.84 ns 10
|
||||
std::string copy{str_with_len_N};/15_stddev 0.041 ns 0.035 ns 10
|
||||
std::string copy{str_with_len_N};/15_cv 2.22 % 1.91 % 10
|
||||
std::string copy{str_with_len_N};/16_mean 80.4 ns 80.1 ns 10
|
||||
std::string copy{str_with_len_N};/16_median 80.4 ns 80.6 ns 10
|
||||
std::string copy{str_with_len_N};/16_stddev 1.57 ns 1.72 ns 10
|
||||
std::string copy{str_with_len_N};/16_cv 1.95 % 2.15 % 10
|
||||
std::string copy{str_with_len_N};/23_mean 81.2 ns 80.9 ns 10
|
||||
std::string copy{str_with_len_N};/23_median 80.8 ns 80.2 ns 10
|
||||
std::string copy{str_with_len_N};/23_stddev 2.51 ns 2.99 ns 10
|
||||
std::string copy{str_with_len_N};/23_cv 3.09 % 3.69 % 10
|
||||
std::string copy{str_with_len_N};/24_mean 80.9 ns 80.4 ns 10
|
||||
std::string copy{str_with_len_N};/24_median 80.6 ns 80.2 ns 10
|
||||
std::string copy{str_with_len_N};/24_stddev 1.27 ns 1.29 ns 10
|
||||
std::string copy{str_with_len_N};/24_cv 1.57 % 1.60 % 10
|
||||
std::string copy{str_with_len_N};/32_mean 85.9 ns 86.0 ns 10
|
||||
std::string copy{str_with_len_N};/32_median 86.3 ns 86.3 ns 10
|
||||
std::string copy{str_with_len_N};/32_stddev 1.08 ns 1.44 ns 10
|
||||
std::string copy{str_with_len_N};/32_cv 1.25 % 1.67 % 10
|
||||
std::string copy{str_with_len_N};/64_mean 87.1 ns 85.8 ns 10
|
||||
std::string copy{str_with_len_N};/64_median 86.4 ns 85.4 ns 10
|
||||
std::string copy{str_with_len_N};/64_stddev 3.35 ns 1.60 ns 10
|
||||
std::string copy{str_with_len_N};/64_cv 3.85 % 1.87 % 10
|
||||
std::string copy{str_with_len_N};/128_mean 90.3 ns 89.8 ns 10
|
||||
std::string copy{str_with_len_N};/128_median 89.0 ns 87.9 ns 10
|
||||
std::string copy{str_with_len_N};/128_stddev 6.26 ns 5.96 ns 10
|
||||
std::string copy{str_with_len_N};/128_cv 6.93 % 6.63 % 10
|
||||
std::string copy{str_with_len_N};/256_mean 87.8 ns 87.5 ns 10
|
||||
std::string copy{str_with_len_N};/256_median 86.8 ns 87.2 ns 10
|
||||
std::string copy{str_with_len_N};/256_stddev 2.33 ns 2.14 ns 10
|
||||
std::string copy{str_with_len_N};/256_cv 2.66 % 2.45 % 10
|
||||
std::string copy{str_with_len_N};/512_mean 90.4 ns 89.4 ns 10
|
||||
std::string copy{str_with_len_N};/512_median 90.1 ns 90.0 ns 10
|
||||
std::string copy{str_with_len_N};/512_stddev 2.20 ns 1.72 ns 10
|
||||
std::string copy{str_with_len_N};/512_cv 2.43 % 1.93 % 10
|
||||
std::string copy{str_with_len_N};/1024_mean 95.5 ns 94.6 ns 10
|
||||
std::string copy{str_with_len_N};/1024_median 94.5 ns 94.2 ns 10
|
||||
std::string copy{str_with_len_N};/1024_stddev 3.70 ns 2.93 ns 10
|
||||
std::string copy{str_with_len_N};/1024_cv 3.87 % 3.09 % 10
|
||||
std::string copy{str_with_len_N};/2048_mean 130 ns 129 ns 10
|
||||
std::string copy{str_with_len_N};/2048_median 130 ns 130 ns 10
|
||||
std::string copy{str_with_len_N};/2048_stddev 3.36 ns 2.70 ns 10
|
||||
std::string copy{str_with_len_N};/2048_cv 2.58 % 2.08 % 10
|
||||
std::string copy{str_with_len_N};/4096_mean 186 ns 185 ns 10
|
||||
std::string copy{str_with_len_N};/4096_median 184 ns 184 ns 10
|
||||
std::string copy{str_with_len_N};/4096_stddev 4.96 ns 2.83 ns 10
|
||||
std::string copy{str_with_len_N};/4096_cv 2.67 % 1.53 % 10
|
||||
stringa copy{str_with_len_N};/15_mean 1.31 ns 1.30 ns 10
|
||||
stringa copy{str_with_len_N};/15_median 1.31 ns 1.30 ns 10
|
||||
stringa copy{str_with_len_N};/15_stddev 0.035 ns 0.037 ns 10
|
||||
stringa copy{str_with_len_N};/15_cv 2.65 % 2.86 % 10
|
||||
stringa copy{str_with_len_N};/16_mean 1.31 ns 1.29 ns 10
|
||||
stringa copy{str_with_len_N};/16_median 1.30 ns 1.28 ns 10
|
||||
stringa copy{str_with_len_N};/16_stddev 0.028 ns 0.030 ns 10
|
||||
stringa copy{str_with_len_N};/16_cv 2.15 % 2.32 % 10
|
||||
stringa copy{str_with_len_N};/23_mean 1.30 ns 1.30 ns 10
|
||||
stringa copy{str_with_len_N};/23_median 1.29 ns 1.29 ns 10
|
||||
stringa copy{str_with_len_N};/23_stddev 0.038 ns 0.039 ns 10
|
||||
stringa copy{str_with_len_N};/23_cv 2.90 % 3.03 % 10
|
||||
stringa copy{str_with_len_N};/24_mean 16.1 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/24_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/24_stddev 0.320 ns 0.329 ns 10
|
||||
stringa copy{str_with_len_N};/24_cv 1.99 % 2.05 % 10
|
||||
stringa copy{str_with_len_N};/32_mean 16.3 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/32_median 16.1 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/32_stddev 0.543 ns 0.329 ns 10
|
||||
stringa copy{str_with_len_N};/32_cv 3.34 % 2.05 % 10
|
||||
stringa copy{str_with_len_N};/64_mean 16.0 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/64_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/64_stddev 0.094 ns 0.247 ns 10
|
||||
stringa copy{str_with_len_N};/64_cv 0.59 % 1.55 % 10
|
||||
stringa copy{str_with_len_N};/128_mean 16.1 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/128_median 16.1 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/128_stddev 0.106 ns 0.235 ns 10
|
||||
stringa copy{str_with_len_N};/128_cv 0.66 % 1.48 % 10
|
||||
stringa copy{str_with_len_N};/256_mean 16.0 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/256_median 16.0 ns 16.1 ns 10
|
||||
stringa copy{str_with_len_N};/256_stddev 0.111 ns 0.271 ns 10
|
||||
stringa copy{str_with_len_N};/256_cv 0.70 % 1.70 % 10
|
||||
stringa copy{str_with_len_N};/512_mean 16.0 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/512_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/512_stddev 0.128 ns 0.331 ns 10
|
||||
stringa copy{str_with_len_N};/512_cv 0.80 % 2.08 % 10
|
||||
stringa copy{str_with_len_N};/1024_mean 16.0 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/1024_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.137 ns 0.180 ns 10
|
||||
stringa copy{str_with_len_N};/1024_cv 0.85 % 1.13 % 10
|
||||
stringa copy{str_with_len_N};/2048_mean 16.0 ns 15.9 ns 10
|
||||
stringa copy{str_with_len_N};/2048_median 16.0 ns 16.0 ns 10
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.061 ns 0.235 ns 10
|
||||
stringa copy{str_with_len_N};/2048_cv 0.38 % 1.48 % 10
|
||||
stringa copy{str_with_len_N};/4096_mean 16.0 ns 15.8 ns 10
|
||||
stringa copy{str_with_len_N};/4096_median 15.9 ns 15.7 ns 10
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.305 ns 0.275 ns 10
|
||||
stringa copy{str_with_len_N};/4096_cv 1.90 % 1.75 % 10
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 4.85 ns 4.84 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_median 4.85 ns 4.87 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.072 ns 0.068 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.49 % 1.41 % 10
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 4.83 ns 4.83 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_median 4.83 ns 4.87 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.077 ns 0.073 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.59 % 1.51 % 10
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 4.89 ns 4.85 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_median 4.88 ns 4.87 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.055 ns 0.080 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.12 % 1.64 % 10
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 83.5 ns 82.5 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_median 83.0 ns 82.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 2.42 ns 2.18 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.90 % 2.65 % 10
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 85.8 ns 85.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_median 84.3 ns 83.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 4.76 ns 5.20 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 5.54 % 6.08 % 10
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 81.4 ns 80.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_median 81.8 ns 81.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 1.99 ns 1.68 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 2.44 % 2.08 % 10
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 84.3 ns 82.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_median 83.9 ns 82.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 3.17 ns 2.99 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 3.76 % 3.61 % 10
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 85.1 ns 85.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_median 84.5 ns 85.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 2.13 ns 1.98 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 2.51 % 2.33 % 10
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 89.0 ns 88.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_median 87.4 ns 87.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 5.89 ns 5.75 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 6.62 % 6.47 % 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 99.5 ns 99.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 97.4 ns 96.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 4.93 ns 4.53 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 4.96 % 4.57 % 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 132 ns 130 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 130 ns 129 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 3.80 ns 3.05 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 2.88 % 2.34 % 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 195 ns 194 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 195 ns 193 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 2.91 ns 3.97 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 1.49 % 2.05 % 10
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 5.57 ns 5.55 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_median 5.56 ns 5.62 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.097 ns 0.110 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 1.73 % 1.99 % 10
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 5.69 ns 5.66 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_median 5.63 ns 5.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.225 ns 0.188 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 3.95 % 3.32 % 10
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 5.60 ns 5.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_median 5.63 ns 5.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.105 ns 0.066 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 1.87 % 1.18 % 10
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 5.59 ns 5.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_median 5.60 ns 5.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.075 ns 0.093 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 1.35 % 1.67 % 10
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 8.48 ns 8.43 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_median 8.48 ns 8.37 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.137 ns 0.141 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 1.61 % 1.67 % 10
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 8.74 ns 8.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_median 8.62 ns 8.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.367 ns 0.140 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 4.20 % 1.63 % 10
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 8.99 ns 8.94 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_median 8.96 ns 9.00 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.220 ns 0.199 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 2.45 % 2.22 % 10
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 10.1 ns 10.0 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_median 10.0 ns 10.0 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.247 ns 0.197 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 2.45 % 1.96 % 10
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 11.8 ns 11.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_median 11.7 ns 11.5 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.325 ns 0.206 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 2.75 % 1.78 % 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 99.4 ns 99.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 97.7 ns 97.7 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 4.44 ns 5.66 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 4.47 % 5.71 % 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 133 ns 133 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 132 ns 133 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 6.58 ns 6.87 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 4.95 % 5.18 % 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 196 ns 195 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 196 ns 193 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 5.23 ns 2.96 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 2.67 % 1.52 % 10
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 32.5 ns 31.7 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 31.9 ns 31.5 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 1.54 ns 0.927 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 4.73 % 2.93 % 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 13.8 ns 13.7 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 13.8 ns 13.8 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.262 ns 0.288 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 1.90 % 2.10 % 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.3 ns 13.2 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.3 ns 13.3 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.207 ns 0.270 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.55 % 2.04 % 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.0 ns 13.0 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.1 ns 13.0 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.137 ns 0.237 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.05 % 1.83 % 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.2 ns 13.2 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.3 ns 13.2 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.184 ns 0.232 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.40 % 1.76 % 10
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 34.4 ns 34.4 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 34.3 ns 34.1 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.621 ns 0.883 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 1.80 % 2.57 % 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 8.29 ns 8.28 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 8.31 ns 8.28 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.097 ns 0.148 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.17 % 1.79 % 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 11.4 ns 11.4 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 11.3 ns 11.4 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.296 ns 0.327 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.59 % 2.86 % 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 10.8 ns 10.7 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 10.7 ns 10.7 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.205 ns 0.230 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.91 % 2.14 % 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 11.2 ns 11.1 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 11.2 ns 11.0 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.125 ns 0.262 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.12 % 2.37 % 10
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 44.2 ns 43.9 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 43.9 ns 43.9 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.886 ns 1.22 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 2.01 % 2.77 % 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 18.8 ns 18.6 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 18.6 ns 18.6 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.412 ns 0.293 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 2.20 % 1.57 % 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 15.9 ns 15.8 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 15.9 ns 16.0 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.196 ns 0.294 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.23 % 1.86 % 10
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 7392 ns 7366 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 7379 ns 7324 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 138 ns 195 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 1.87 % 2.65 % 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1068 ns 1060 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1067 ns 1050 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 18.9 ns 26.2 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 1.77 % 2.48 % 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 757 ns 751 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 748 ns 753 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 19.1 ns 14.4 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 2.52 % 1.92 % 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 403 ns 399 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 391 ns 384 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 33.6 ns 33.1 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 8.34 % 8.29 % 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 229 ns 229 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 226 ns 225 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 6.65 ns 7.56 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 2.91 % 3.31 % 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 139 ns 139 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 139 ns 140 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 0.950 ns 1.88 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 0.68 % 1.36 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 6632 ns 6574 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 6640 ns 6539 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 127 ns 144 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 1.92 % 2.18 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 3901 ns 3892 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 3899 ns 3934 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 83.7 ns 81.3 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 2.15 % 2.09 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 763 ns 760 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 760 ns 753 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 17.7 ns 14.1 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.32 % 1.86 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 481 ns 473 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 474 ns 474 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 27.4 ns 12.2 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 5.70 % 2.58 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 306 ns 305 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 306 ns 305 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 10.0 ns 10.4 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.28 % 3.40 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 214 ns 213 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 213 ns 212 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 3.83 ns 4.72 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.79 % 2.22 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 361900 ns 360695 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 362008 ns 360695 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 8052 ns 8089 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 2.23 % 2.24 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 199378 ns 199655 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 199446 ns 200911 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 3464 ns 4434 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.74 % 2.22 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 19852 ns 19796 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 19976 ns 19880 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 336 ns 443 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.69 % 2.24 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 18215 ns 18164 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 18175 ns 18206 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 300 ns 293 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.65 % 1.61 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17973 ns 17955 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17963 ns 17997 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 396 ns 461 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.20 % 2.57 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17891 ns 17746 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17888 ns 17788 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 237 ns 404 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.33 % 2.28 % 10
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 6383 ns 6344 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 6406 ns 6406 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 115 ns 132 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 1.80 % 2.08 % 10
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 3986 ns 3993 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_median 3990 ns 3984 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 64.6 ns 62.6 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.62 % 1.57 % 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 859 ns 856 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 846 ns 858 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 42.3 ns 40.0 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 4.92 % 4.67 % 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 569 ns 568 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 562 ns 558 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 25.2 ns 24.7 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 4.42 % 4.34 % 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 403 ns 400 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 401 ns 399 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 5.68 ns 6.69 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 1.41 % 1.67 % 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 314 ns 310 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 311 ns 307 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 15.1 ns 8.19 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 4.80 % 2.64 % 10
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 11663 ns 11597 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_median 11672 ns 11597 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 126 ns 129 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 1.08 % 1.11 % 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 1114 ns 1110 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 1113 ns 1116 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 23.9 ns 22.0 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 2.14 % 1.98 % 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 2906 ns 2876 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 2888 ns 2849 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 81.9 ns 71.2 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 2.82 % 2.48 % 10
|
||||
std::string str = std::format("test = {} times", k);_mean 1950 ns 1941 ns 10
|
||||
std::string str = std::format("test = {} times", k);_median 1942 ns 1904 ns 10
|
||||
std::string str = std::format("test = {} times", k);_stddev 57.0 ns 66.9 ns 10
|
||||
std::string str = std::format("test = {} times", k);_cv 2.92 % 3.45 % 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 2112 ns 2086 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 2107 ns 2086 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 28.2 ns 37.0 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 1.33 % 1.77 % 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1029 ns 1027 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1031 ns 1036 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 22.3 ns 20.8 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 2.17 % 2.03 % 10
|
||||
lstringa<8> str = "test = " + k + " times";_mean 823 ns 821 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_median 824 ns 820 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 20.8 ns 20.9 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_cv 2.53 % 2.54 % 10
|
||||
lstringa<32> str = "test = " + k + " times";_mean 160 ns 156 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_median 158 ns 155 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 6.73 ns 6.16 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_cv 4.21 % 3.95 % 10
|
||||
stringa str = "test = " + k + " times";_mean 156 ns 155 ns 10
|
||||
stringa str = "test = " + k + " times";_median 155 ns 153 ns 10
|
||||
stringa str = "test = " + k + " times";_stddev 4.05 ns 3.69 ns 10
|
||||
stringa str = "test = " + k + " times";_cv 2.60 % 2.39 % 10
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find + substr + std::strtol_mean 576 ns 573 ns 10
|
||||
std::string::find + substr + std::strtol_median 574 ns 572 ns 10
|
||||
std::string::find + substr + std::strtol_stddev 9.17 ns 12.2 ns 10
|
||||
std::string::find + substr + std::strtol_cv 1.59 % 2.13 % 10
|
||||
ssa::splitter + ssa::as_int_mean 173 ns 171 ns 10
|
||||
ssa::splitter + ssa::as_int_median 172 ns 171 ns 10
|
||||
ssa::splitter + ssa::as_int_stddev 3.44 ns 6.07 ns 10
|
||||
ssa::splitter + ssa::as_int_cv 1.99 % 3.55 % 10
|
||||
ssa::splitf + functor_mean 188 ns 187 ns 10
|
||||
ssa::splitf + functor_median 187 ns 186 ns 10
|
||||
ssa::splitf + functor_stddev 4.21 ns 5.57 ns 10
|
||||
ssa::splitf + functor_cv 2.23 % 2.98 % 10
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 1153 ns 1152 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 1163 ns 1160 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 21.3 ns 22.4 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 1.85 % 1.95 % 10
|
||||
replace symbols with std::string find_first_of + replace_mean 2073 ns 2070 ns 10
|
||||
replace symbols with std::string find_first_of + replace_median 2069 ns 2051 ns 10
|
||||
replace symbols with std::string find_first_of + replace_stddev 48.9 ns 41.2 ns 10
|
||||
replace symbols with std::string find_first_of + replace_cv 2.36 % 1.99 % 10
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2441 ns 2433 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_median 2447 ns 2455 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 40.0 ns 47.1 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_cv 1.64 % 1.93 % 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1386 ns 1372 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1386 ns 1365 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 27.9 ns 42.0 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 2.01 % 3.06 % 10
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1373 ns 1362 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1367 ns 1381 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 67.1 ns 57.7 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 4.89 % 4.23 % 10
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1213 ns 1211 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_median 1210 ns 1200 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 28.4 ns 19.5 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_cv 2.34 % 1.61 % 10
|
||||
replace const symbols with string expressions and memorization of all search results_mean 1228 ns 1203 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_median 1218 ns 1200 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 38.9 ns 24.4 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_cv 3.17 % 2.03 % 10
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 321 ns 319 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 322 ns 317 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 4.92 ns 6.62 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.53 % 2.08 % 10
|
||||
Short replace symbols with std::string find_first_of + replace_mean 378 ns 377 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_median 377 ns 377 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 8.10 ns 11.8 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_cv 2.14 % 3.14 % 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 342 ns 340 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 343 ns 341 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 4.68 ns 6.32 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 1.37 % 1.86 % 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 251 ns 247 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 251 ns 246 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 2.57 ns 5.91 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.02 % 2.39 % 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 347 ns 344 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 344 ns 344 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 7.13 ns 6.91 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 2.06 % 2.01 % 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 218 ns 217 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 220 ns 217 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 4.90 ns 5.27 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 2.25 % 2.43 % 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 301 ns 300 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 300 ns 300 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 6.51 ns 5.70 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 2.16 % 1.90 % 10
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to ---- in std::string|64_mean 238 ns 237 ns 10
|
||||
replace bb to ---- in std::string|64_median 239 ns 238 ns 10
|
||||
replace bb to ---- in std::string|64_stddev 4.84 ns 5.54 ns 10
|
||||
replace bb to ---- in std::string|64_cv 2.03 % 2.34 % 10
|
||||
replace bb to ---- in std::string|256_mean 779 ns 771 ns 10
|
||||
replace bb to ---- in std::string|256_median 775 ns 767 ns 10
|
||||
replace bb to ---- in std::string|256_stddev 25.1 ns 16.0 ns 10
|
||||
replace bb to ---- in std::string|256_cv 3.23 % 2.08 % 10
|
||||
replace bb to ---- in std::string|512_mean 1450 ns 1444 ns 10
|
||||
replace bb to ---- in std::string|512_median 1452 ns 1430 ns 10
|
||||
replace bb to ---- in std::string|512_stddev 29.1 ns 29.4 ns 10
|
||||
replace bb to ---- in std::string|512_cv 2.01 % 2.04 % 10
|
||||
replace bb to ---- in std::string|1024_mean 3246 ns 3230 ns 10
|
||||
replace bb to ---- in std::string|1024_median 3193 ns 3209 ns 10
|
||||
replace bb to ---- in std::string|1024_stddev 122 ns 114 ns 10
|
||||
replace bb to ---- in std::string|1024_cv 3.76 % 3.53 % 10
|
||||
replace bb to ---- in std::string|2048_mean 8153 ns 8057 ns 10
|
||||
replace bb to ---- in std::string|2048_median 7974 ns 8022 ns 10
|
||||
replace bb to ---- in std::string|2048_stddev 374 ns 257 ns 10
|
||||
replace bb to ---- in std::string|2048_cv 4.59 % 3.19 % 10
|
||||
replace bb to ---- in lstringa<8>|64_mean 343 ns 342 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_median 342 ns 341 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_stddev 6.86 ns 5.61 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.00 % 1.64 % 10
|
||||
replace bb to ---- in lstringa<8>|256_mean 645 ns 646 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_median 644 ns 642 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_stddev 13.7 ns 14.8 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_cv 2.12 % 2.29 % 10
|
||||
replace bb to ---- in lstringa<8>|512_mean 1080 ns 1072 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_median 1078 ns 1074 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_stddev 23.2 ns 24.3 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.14 % 2.27 % 10
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1916 ns 1904 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_median 1910 ns 1904 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 31.6 ns 42.7 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.65 % 2.24 % 10
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3650 ns 3618 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_median 3650 ns 3610 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 32.9 ns 59.2 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_cv 0.90 % 1.64 % 10
|
||||
replace bb to ---- by init stringa|64_mean 216 ns 216 ns 10
|
||||
replace bb to ---- by init stringa|64_median 215 ns 214 ns 10
|
||||
replace bb to ---- by init stringa|64_stddev 8.87 ns 8.47 ns 10
|
||||
replace bb to ---- by init stringa|64_cv 4.10 % 3.93 % 10
|
||||
replace bb to ---- by init stringa|256_mean 548 ns 547 ns 10
|
||||
replace bb to ---- by init stringa|256_median 546 ns 547 ns 10
|
||||
replace bb to ---- by init stringa|256_stddev 9.01 ns 12.8 ns 10
|
||||
replace bb to ---- by init stringa|256_cv 1.64 % 2.33 % 10
|
||||
replace bb to ---- by init stringa|512_mean 941 ns 942 ns 10
|
||||
replace bb to ---- by init stringa|512_median 942 ns 942 ns 10
|
||||
replace bb to ---- by init stringa|512_stddev 22.7 ns 24.2 ns 10
|
||||
replace bb to ---- by init stringa|512_cv 2.41 % 2.57 % 10
|
||||
replace bb to ---- by init stringa|1024_mean 1775 ns 1765 ns 10
|
||||
replace bb to ---- by init stringa|1024_median 1766 ns 1765 ns 10
|
||||
replace bb to ---- by init stringa|1024_stddev 33.7 ns 31.3 ns 10
|
||||
replace bb to ---- by init stringa|1024_cv 1.90 % 1.77 % 10
|
||||
replace bb to ---- by init stringa|2048_mean 3478 ns 3450 ns 10
|
||||
replace bb to ---- by init stringa|2048_median 3489 ns 3442 ns 10
|
||||
replace bb to ---- by init stringa|2048_stddev 48.5 ns 54.0 ns 10
|
||||
replace bb to ---- by init stringa|2048_cv 1.39 % 1.57 % 10
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to -- in std::string|64_mean 196 ns 195 ns 10
|
||||
replace bb to -- in std::string|64_median 196 ns 197 ns 10
|
||||
replace bb to -- in std::string|64_stddev 2.59 ns 3.53 ns 10
|
||||
replace bb to -- in std::string|64_cv 1.32 % 1.81 % 10
|
||||
replace bb to -- in std::string|256_mean 503 ns 500 ns 10
|
||||
replace bb to -- in std::string|256_median 501 ns 500 ns 10
|
||||
replace bb to -- in std::string|256_stddev 8.11 ns 10.4 ns 10
|
||||
replace bb to -- in std::string|256_cv 1.61 % 2.08 % 10
|
||||
replace bb to -- in std::string|512_mean 864 ns 861 ns 10
|
||||
replace bb to -- in std::string|512_median 868 ns 854 ns 10
|
||||
replace bb to -- in std::string|512_stddev 17.6 ns 18.7 ns 10
|
||||
replace bb to -- in std::string|512_cv 2.04 % 2.18 % 10
|
||||
replace bb to -- in std::string|1024_mean 1700 ns 1684 ns 10
|
||||
replace bb to -- in std::string|1024_median 1702 ns 1688 ns 10
|
||||
replace bb to -- in std::string|1024_stddev 27.7 ns 28.3 ns 10
|
||||
replace bb to -- in std::string|1024_cv 1.63 % 1.68 % 10
|
||||
replace bb to -- in std::string|2048_mean 3239 ns 3230 ns 10
|
||||
replace bb to -- in std::string|2048_median 3196 ns 3209 ns 10
|
||||
replace bb to -- in std::string|2048_stddev 103 ns 123 ns 10
|
||||
replace bb to -- in std::string|2048_cv 3.18 % 3.82 % 10
|
||||
replace bb to -- in lstringa<8>|64_mean 192 ns 191 ns 10
|
||||
replace bb to -- in lstringa<8>|64_median 189 ns 188 ns 10
|
||||
replace bb to -- in lstringa<8>|64_stddev 8.04 ns 7.43 ns 10
|
||||
replace bb to -- in lstringa<8>|64_cv 4.19 % 3.90 % 10
|
||||
replace bb to -- in lstringa<8>|256_mean 452 ns 450 ns 10
|
||||
replace bb to -- in lstringa<8>|256_median 452 ns 449 ns 10
|
||||
replace bb to -- in lstringa<8>|256_stddev 9.20 ns 12.6 ns 10
|
||||
replace bb to -- in lstringa<8>|256_cv 2.04 % 2.79 % 10
|
||||
replace bb to -- in lstringa<8>|512_mean 797 ns 790 ns 10
|
||||
replace bb to -- in lstringa<8>|512_median 796 ns 785 ns 10
|
||||
replace bb to -- in lstringa<8>|512_stddev 11.3 ns 14.4 ns 10
|
||||
replace bb to -- in lstringa<8>|512_cv 1.42 % 1.82 % 10
|
||||
replace bb to -- in lstringa<8>|1024_mean 1444 ns 1437 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_median 1435 ns 1430 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_stddev 28.8 ns 39.6 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_cv 2.00 % 2.76 % 10
|
||||
replace bb to -- in lstringa<8>|2048_mean 2839 ns 2844 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_median 2831 ns 2825 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_stddev 55.3 ns 78.6 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.95 % 2.76 % 10
|
||||
replace bb to -- by init stringa|64_mean 167 ns 166 ns 10
|
||||
replace bb to -- by init stringa|64_median 167 ns 165 ns 10
|
||||
replace bb to -- by init stringa|64_stddev 5.30 ns 3.96 ns 10
|
||||
replace bb to -- by init stringa|64_cv 3.17 % 2.39 % 10
|
||||
replace bb to -- by init stringa|256_mean 352 ns 351 ns 10
|
||||
replace bb to -- by init stringa|256_median 353 ns 353 ns 10
|
||||
replace bb to -- by init stringa|256_stddev 4.26 ns 5.07 ns 10
|
||||
replace bb to -- by init stringa|256_cv 1.21 % 1.44 % 10
|
||||
replace bb to -- by init stringa|512_mean 598 ns 596 ns 10
|
||||
replace bb to -- by init stringa|512_median 597 ns 600 ns 10
|
||||
replace bb to -- by init stringa|512_stddev 11.5 ns 14.8 ns 10
|
||||
replace bb to -- by init stringa|512_cv 1.92 % 2.48 % 10
|
||||
replace bb to -- by init stringa|1024_mean 1082 ns 1078 ns 10
|
||||
replace bb to -- by init stringa|1024_median 1084 ns 1088 ns 10
|
||||
replace bb to -- by init stringa|1024_stddev 24.1 ns 28.3 ns 10
|
||||
replace bb to -- by init stringa|1024_cv 2.23 % 2.63 % 10
|
||||
replace bb to -- by init stringa|2048_mean 1963 ns 1963 ns 10
|
||||
replace bb to -- by init stringa|2048_median 1964 ns 1967 ns 10
|
||||
replace bb to -- by init stringa|2048_stddev 29.4 ns 36.6 ns 10
|
||||
replace bb to -- by init stringa|2048_cv 1.50 % 1.87 % 10
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 4144900 ns 4132154 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 4145547 ns 4094503 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 160485 ns 168671 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 3.87 % 4.08 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 5984962 ns 5929129 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 5980382 ns 5929129 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 115002 ns 118560 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 1.92 % 2.00 % 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3983708 ns 3942587 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3962420 ns 3906250 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 76626 ns 97653 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.92 % 2.48 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 7030276 ns 7003348 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 6994535 ns 6975446 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 131572 ns 158383 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 1.87 % 2.26 % 10
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Build func full name std::string;_mean 1588 ns 1580 ns 10
|
||||
Build func full name std::string;_median 1583 ns 1569 ns 10
|
||||
Build func full name std::string;_stddev 33.8 ns 33.1 ns 10
|
||||
Build func full name std::string;_cv 2.13 % 2.09 % 10
|
||||
Build func full name std::string 1;_mean 1648 ns 1638 ns 10
|
||||
Build func full name std::string 1;_median 1626 ns 1631 ns 10
|
||||
Build func full name std::string 1;_stddev 60.0 ns 57.3 ns 10
|
||||
Build func full name std::string 1;_cv 3.64 % 3.50 % 10
|
||||
Build func full name std::stream;_mean 10979 ns 10718 ns 10
|
||||
Build func full name std::stream;_median 10840 ns 10742 ns 10
|
||||
Build func full name std::stream;_stddev 530 ns 269 ns 10
|
||||
Build func full name std::stream;_cv 4.82 % 2.51 % 10
|
||||
Build func full name stringa;_mean 847 ns 844 ns 10
|
||||
Build func full name stringa;_median 844 ns 837 ns 10
|
||||
Build func full name stringa;_stddev 22.6 ns 20.5 ns 10
|
||||
Build func full name stringa;_cv 2.66 % 2.43 % 10
|
||||
Build func full name stringa 1;_mean 1003 ns 998 ns 10
|
||||
Build func full name stringa 1;_median 999 ns 1004 ns 10
|
||||
Build func full name stringa 1;_stddev 12.7 ns 14.1 ns 10
|
||||
Build func full name stringa 1;_cv 1.27 % 1.41 % 10
|
||||
|
|
@ -0,0 +1,987 @@
|
|||
Benchmarks of simstr, version 1.8.1
|
||||
Sources: https://github.com/orefkov/simstr
|
||||
Results: https://orefkov.github.io/simstr/results.html
|
||||
Compiler Clang 22.1.0
|
||||
2026-03-22T14:13:24+03:00
|
||||
Running benchStr.exe
|
||||
Run on (32 X 2494 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)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Concatenate email ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat email std::format_mean 201 ns 198 ns 4
|
||||
Concat email std::format_median 202 ns 197 ns 4
|
||||
Concat email std::format_stddev 3.07 ns 4.34 ns 4
|
||||
Concat email std::format_cv 1.52 % 2.19 % 4
|
||||
Concat email std::stringstream_mean 830 ns 827 ns 4
|
||||
Concat email std::stringstream_median 834 ns 827 ns 4
|
||||
Concat email std::stringstream_stddev 18.5 ns 12.1 ns 4
|
||||
Concat email std::stringstream_cv 2.23 % 1.46 % 4
|
||||
Concat email stringzilla append_mean 273 ns 271 ns 4
|
||||
Concat email stringzilla append_median 274 ns 273 ns 4
|
||||
Concat email stringzilla append_stddev 3.38 ns 2.96 ns 4
|
||||
Concat email stringzilla append_cv 1.24 % 1.09 % 4
|
||||
Concat email stringzilla concat_mean 126 ns 127 ns 4
|
||||
Concat email stringzilla concat_median 127 ns 127 ns 4
|
||||
Concat email stringzilla concat_stddev 1.88 ns 1.61 ns 4
|
||||
Concat email stringzilla concat_cv 1.48 % 1.27 % 4
|
||||
Concat email std::string append_mean 187 ns 185 ns 4
|
||||
Concat email std::string append_median 187 ns 184 ns 4
|
||||
Concat email std::string append_stddev 2.11 ns 2.09 ns 4
|
||||
Concat email std::string append_cv 1.13 % 1.13 % 4
|
||||
Concat email std::string by strexpr_mean 104 ns 104 ns 4
|
||||
Concat email std::string by strexpr_median 103 ns 104 ns 4
|
||||
Concat email std::string by strexpr_stddev 1.83 ns 2.00 ns 4
|
||||
Concat email std::string by strexpr_cv 1.76 % 1.92 % 4
|
||||
Concat email stringa_mean 94.4 ns 94.2 ns 4
|
||||
Concat email stringa_median 94.9 ns 94.2 ns 4
|
||||
Concat email stringa_stddev 2.21 ns 1.71 ns 4
|
||||
Concat email stringa_cv 2.34 % 1.81 % 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 268 ns 268 ns 4
|
||||
Concat std::string and number by std to std::string_median 267 ns 267 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 7.57 ns 10.7 ns 4
|
||||
Concat std::string and number by std to std::string_cv 2.83 % 3.99 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 160 ns 160 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 160 ns 160 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 4.44 ns 4.39 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 2.78 % 2.75 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 68.7 ns 68.4 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 68.4 ns 68.4 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 1.17 ns 0.000 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 1.70 % 0.00 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 74.2 ns 74.3 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 74.1 ns 73.9 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 0.363 ns 0.698 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 0.49 % 0.94 % 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 725 ns 722 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 727 ns 725 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 8.98 ns 6.98 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 1.24 % 0.97 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 1525 ns 1508 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 1525 ns 1517 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 29.4 ns 33.4 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 1.93 % 2.21 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 188 ns 186 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 189 ns 186 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 3.60 ns 2.42 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.91 % 1.30 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 84.6 ns 84.1 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 85.1 ns 84.6 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 1.31 ns 1.67 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 1.55 % 1.98 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 71.4 ns 71.1 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 71.3 ns 70.6 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 1.52 ns 1.67 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 2.12 % 2.35 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 76.9 ns 76.3 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 77.0 ns 75.9 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 0.926 ns 1.67 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 1.20 % 2.19 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 149 ns 150 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 149 ns 149 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 2.26 ns 3.01 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 1.51 % 2.01 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 287 ns 287 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 286 ns 285 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 5.37 ns 8.34 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 1.87 % 2.91 % 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 639 ns 635 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 637 ns 635 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 5.27 ns 18.0 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 0.83 % 2.84 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 750 ns 746 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 749 ns 753 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 11.7 ns 14.0 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 1.56 % 1.87 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 1070 ns 1067 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 1070 ns 1057 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 27.0 ns 29.6 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 2.52 % 2.77 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 1433 ns 1437 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 1440 ns 1451 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 38.0 ns 27.9 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 2.65 % 1.94 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 1327 ns 1318 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 1310 ns 1297 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 39.9 ns 52.8 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 3.01 % 4.01 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 1568 ns 1569 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 1565 ns 1569 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 20.6 ns 28.5 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.32 % 1.81 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 1555 ns 1543 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 1546 ns 1552 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 40.0 ns 33.4 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 2.57 % 2.16 % 4
|
||||
std::format with std::formatted_size_mean 2496 ns 2490 ns 4
|
||||
std::format with std::formatted_size_median 2488 ns 2490 ns 4
|
||||
std::format with std::formatted_size_stddev 31.6 ns 68.5 ns 4
|
||||
std::format with std::formatted_size_cv 1.27 % 2.75 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 6707 ns 6731 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 6709 ns 6766 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 106 ns 134 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 1.58 % 1.98 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 42.2 ns 42.2 ns 4
|
||||
Concat std::string by std to std::string_median 41.7 ns 42.2 ns 4
|
||||
Concat std::string by std to std::string_stddev 1.16 ns 1.17 ns 4
|
||||
Concat std::string by std to std::string_cv 2.76 % 2.78 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 39.3 ns 39.5 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 39.4 ns 39.2 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 0.441 ns 0.436 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 1.12 % 1.10 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 30.6 ns 30.2 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 30.5 ns 30.0 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 0.672 ns 0.349 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 2.20 % 1.16 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 206 ns 204 ns 4
|
||||
Find concat three std::string_median 206 ns 204 ns 4
|
||||
Find concat three std::string_stddev 2.29 ns 5.24 ns 4
|
||||
Find concat three std::string_cv 1.11 % 2.57 % 4
|
||||
Find concat three strexpr_mean 113 ns 112 ns 4
|
||||
Find concat three strexpr_median 112 ns 113 ns 4
|
||||
Find concat three strexpr_stddev 3.29 ns 2.67 ns 4
|
||||
Find concat three strexpr_cv 2.92 % 2.38 % 4
|
||||
Find concat three simstr_mean 21.2 ns 21.2 ns 4
|
||||
Find concat three simstr_median 21.0 ns 21.1 ns 4
|
||||
Find concat three simstr_stddev 0.696 ns 0.774 ns 4
|
||||
Find concat three simstr_cv 3.29 % 3.65 % 4
|
||||
Find concat three stringzilla string_mean 215 ns 215 ns 4
|
||||
Find concat three stringzilla string_median 215 ns 215 ns 4
|
||||
Find concat three stringzilla string_stddev 1.86 ns 3.99 ns 4
|
||||
Find concat three stringzilla string_cv 0.86 % 1.86 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 8.34 ns 8.37 ns 4
|
||||
BuildTypeNameStr 0/0_median 8.34 ns 8.37 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.055 ns 0.000 ns 4
|
||||
BuildTypeNameStr 0/0_cv 0.66 % 0.00 % 4
|
||||
BuildTypeNameExp 0/0_mean 7.67 ns 7.59 ns 4
|
||||
BuildTypeNameExp 0/0_median 7.68 ns 7.59 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.232 ns 0.225 ns 4
|
||||
BuildTypeNameExp 0/0_cv 3.03 % 2.97 % 4
|
||||
BuildTypeNameSim 0/0_mean 7.90 ns 7.85 ns 4
|
||||
BuildTypeNameSim 0/0_median 7.83 ns 7.76 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.149 ns 0.247 ns 4
|
||||
BuildTypeNameSim 0/0_cv 1.89 % 3.14 % 4
|
||||
BuildTypeNameStr 10/10_mean 79.5 ns 79.8 ns 4
|
||||
BuildTypeNameStr 10/10_median 79.5 ns 79.3 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 2.19 ns 1.67 ns 4
|
||||
BuildTypeNameStr 10/10_cv 2.75 % 2.09 % 4
|
||||
BuildTypeNameExp 10/10_mean 33.1 ns 33.1 ns 4
|
||||
BuildTypeNameExp 10/10_median 32.9 ns 33.0 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 0.775 ns 0.922 ns 4
|
||||
BuildTypeNameExp 10/10_cv 2.34 % 2.78 % 4
|
||||
BuildTypeNameSim 10/10_mean 25.2 ns 25.2 ns 4
|
||||
BuildTypeNameSim 10/10_median 25.2 ns 25.2 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 0.364 ns 0.342 ns 4
|
||||
BuildTypeNameSim 10/10_cv 1.45 % 1.36 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 315 ns 312 ns 4
|
||||
Concat with replace str_median 314 ns 314 ns 4
|
||||
Concat with replace str_stddev 5.64 ns 3.49 ns 4
|
||||
Concat with replace str_cv 1.79 % 1.12 % 4
|
||||
Concat with replace exp_mean 220 ns 220 ns 4
|
||||
Concat with replace exp_median 219 ns 222 ns 4
|
||||
Concat with replace exp_stddev 6.89 ns 6.91 ns 4
|
||||
Concat with replace exp_cv 3.13 % 3.14 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 1.12 ns 1.12 ns 4
|
||||
std::string e;_median 1.12 ns 1.12 ns 4
|
||||
std::string e;_stddev 0.012 ns 0.012 ns 4
|
||||
std::string e;_cv 1.11 % 1.09 % 4
|
||||
std::string_view e;_mean 0.369 ns 0.369 ns 4
|
||||
std::string_view e;_median 0.369 ns 0.369 ns 4
|
||||
std::string_view e;_stddev 0.002 ns 0.000 ns 4
|
||||
std::string_view e;_cv 0.66 % 0.00 % 4
|
||||
ssa e;_mean 0.362 ns 0.359 ns 4
|
||||
ssa e;_median 0.363 ns 0.361 ns 4
|
||||
ssa e;_stddev 0.003 ns 0.004 ns 4
|
||||
ssa e;_cv 0.91 % 1.12 % 4
|
||||
stringa e;_mean 0.745 ns 0.746 ns 4
|
||||
stringa e;_median 0.744 ns 0.746 ns 4
|
||||
stringa e;_stddev 0.004 ns 0.008 ns 4
|
||||
stringa e;_cv 0.54 % 1.08 % 4
|
||||
lstringa<20> e;_mean 1.10 ns 1.09 ns 4
|
||||
lstringa<20> e;_median 1.10 ns 1.09 ns 4
|
||||
lstringa<20> e;_stddev 0.015 ns 0.023 ns 4
|
||||
lstringa<20> e;_cv 1.36 % 2.14 % 4
|
||||
lstringa<40> e;_mean 1.11 ns 1.10 ns 4
|
||||
lstringa<40> e;_median 1.11 ns 1.10 ns 4
|
||||
lstringa<40> e;_stddev 0.015 ns 0.016 ns 4
|
||||
lstringa<40> e;_cv 1.33 % 1.46 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 1.84 ns 1.82 ns 4
|
||||
std::string e = "Test text";_median 1.85 ns 1.82 ns 4
|
||||
std::string e = "Test text";_stddev 0.023 ns 0.024 ns 4
|
||||
std::string e = "Test text";_cv 1.27 % 1.33 % 4
|
||||
std::string_view e = "Test text";_mean 0.741 ns 0.743 ns 4
|
||||
std::string_view e = "Test text";_median 0.741 ns 0.746 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.009 ns 0.013 ns 4
|
||||
std::string_view e = "Test text";_cv 1.25 % 1.80 % 4
|
||||
ssa e = "Test text";_mean 0.369 ns 0.367 ns 4
|
||||
ssa e = "Test text";_median 0.368 ns 0.369 ns 4
|
||||
ssa e = "Test text";_stddev 0.008 ns 0.004 ns 4
|
||||
ssa e = "Test text";_cv 2.15 % 1.09 % 4
|
||||
stringa e = "Test text";_mean 1.11 ns 1.11 ns 4
|
||||
stringa e = "Test text";_median 1.11 ns 1.11 ns 4
|
||||
stringa e = "Test text";_stddev 0.011 ns 0.014 ns 4
|
||||
stringa e = "Test text";_cv 1.02 % 1.27 % 4
|
||||
lstringa<20> e = "Test text";_mean 1.84 ns 1.82 ns 4
|
||||
lstringa<20> e = "Test text";_median 1.85 ns 1.80 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.028 ns 0.042 ns 4
|
||||
lstringa<20> e = "Test text";_cv 1.55 % 2.30 % 4
|
||||
lstringa<40> e = "Test text";_mean 1.85 ns 1.82 ns 4
|
||||
lstringa<40> e = "Test text";_median 1.83 ns 1.79 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.063 ns 0.086 ns 4
|
||||
lstringa<40> e = "Test text";_cv 3.39 % 4.70 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 73.9 ns 73.7 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 74.4 ns 74.1 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 0.956 ns 1.67 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 1.29 % 2.27 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 0.736 ns 0.736 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 0.735 ns 0.739 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.009 ns 0.007 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.22 % 0.95 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 0.369 ns 0.369 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 0.369 ns 0.369 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.004 ns 0.007 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 1.03 % 1.77 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 1.11 ns 1.11 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 1.11 ns 1.11 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.010 ns 0.014 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 0.93 % 1.27 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 73.1 ns 73.2 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 72.7 ns 73.2 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 1.20 ns 1.42 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 1.64 % 1.94 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 2.56 ns 2.55 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 2.56 ns 2.57 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.031 ns 0.028 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.22 % 1.09 % 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.84 ns 1.83 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 1.84 ns 1.82 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.028 ns 0.040 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 1.53 % 2.19 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 0.373 ns 0.371 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 0.373 ns 0.373 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.001 ns 0.008 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 0.38 % 2.07 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 0.380 ns 0.377 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 0.380 ns 0.377 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.006 ns 0.007 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 1.71 % 1.74 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 1.10 ns 1.10 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 1.10 ns 1.10 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.011 ns 0.000 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 0.99 % 0.00 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 1.12 ns 1.10 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 1.12 ns 1.10 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.026 ns 0.031 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 2.34 % 2.78 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 1.11 ns 1.11 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 1.11 ns 1.11 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.017 ns 0.032 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.49 % 2.84 % 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 78.0 ns 77.6 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 78.1 ns 77.6 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 2.07 ns 2.25 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 2.66 % 2.90 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 0.734 ns 0.732 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 0.736 ns 0.732 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.005 ns 0.008 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 0.70 % 1.10 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 0.377 ns 0.368 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 0.373 ns 0.366 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.011 ns 0.004 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 2.90 % 1.18 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 1.12 ns 1.12 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 1.11 ns 1.12 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.009 ns 0.012 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 0.82 % 1.09 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 72.6 ns 72.4 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 73.0 ns 72.4 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 2.07 ns 2.25 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 2.85 % 3.11 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 5.42 ns 5.43 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 5.44 ns 5.39 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.101 ns 0.150 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 1.87 % 2.76 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 94.8 ns 94.2 ns 4
|
||||
sz::string::find;_median 94.3 ns 94.2 ns 4
|
||||
sz::string::find;_stddev 1.19 ns 0.000 ns 4
|
||||
sz::string::find;_cv 1.26 % 0.00 % 4
|
||||
std::string::find;_mean 40.2 ns 40.1 ns 4
|
||||
std::string::find;_median 40.0 ns 40.4 ns 4
|
||||
std::string::find;_stddev 0.608 ns 0.868 ns 4
|
||||
std::string::find;_cv 1.51 % 2.16 % 4
|
||||
std::string_view::find;_mean 39.3 ns 39.2 ns 4
|
||||
std::string_view::find;_median 39.2 ns 39.0 ns 4
|
||||
std::string_view::find;_stddev 0.443 ns 0.453 ns 4
|
||||
std::string_view::find;_cv 1.13 % 1.16 % 4
|
||||
ssa::find;_mean 18.7 ns 18.7 ns 4
|
||||
ssa::find;_median 18.5 ns 18.6 ns 4
|
||||
ssa::find;_stddev 0.479 ns 0.401 ns 4
|
||||
ssa::find;_cv 2.57 % 2.14 % 4
|
||||
stringa::find;_mean 19.6 ns 19.5 ns 4
|
||||
stringa::find;_median 19.8 ns 19.5 ns 4
|
||||
stringa::find;_stddev 0.421 ns 0.524 ns 4
|
||||
stringa::find;_cv 2.15 % 2.69 % 4
|
||||
lstringa<20>::find;_mean 18.0 ns 17.9 ns 4
|
||||
lstringa<20>::find;_median 18.1 ns 18.0 ns 4
|
||||
lstringa<20>::find;_stddev 0.262 ns 0.209 ns 4
|
||||
lstringa<20>::find;_cv 1.45 % 1.17 % 4
|
||||
lstringa<40>::find;_mean 18.5 ns 18.5 ns 4
|
||||
lstringa<40>::find;_median 18.4 ns 18.6 ns 4
|
||||
lstringa<40>::find;_stddev 0.343 ns 0.227 ns 4
|
||||
lstringa<40>::find;_cv 1.85 % 1.23 % 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.83 ns 1.82 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 1.83 ns 1.84 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 0.018 ns 0.043 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 0.98 % 2.38 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 78.7 ns 78.9 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 78.9 ns 79.3 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 1.33 ns 1.67 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 1.69 % 2.12 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 79.1 ns 78.5 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 79.0 ns 78.5 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 0.895 ns 1.42 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 1.13 % 1.81 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 80.3 ns 79.8 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 80.4 ns 79.3 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 1.94 ns 1.67 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 2.41 % 2.09 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 79.6 ns 79.3 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 78.3 ns 78.5 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 3.75 ns 3.02 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 4.71 % 3.81 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 80.7 ns 81.1 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 80.9 ns 81.1 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 3.49 ns 3.02 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 4.32 % 3.72 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 84.2 ns 84.1 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 84.6 ns 84.6 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 2.47 ns 1.67 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 2.93 % 1.98 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 87.3 ns 86.8 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 87.7 ns 86.8 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 1.06 ns 1.21 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 1.21 % 1.39 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 87.3 ns 87.6 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 86.7 ns 87.2 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 2.31 ns 2.19 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 2.65 % 2.50 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 97.6 ns 97.3 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 97.9 ns 97.3 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 3.35 ns 2.70 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 3.43 % 2.78 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 132 ns 133 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 132 ns 133 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 1.34 ns 1.61 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 1.01 % 1.22 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 180 ns 179 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 180 ns 180 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 1.41 ns 1.92 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 0.78 % 1.07 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 1.09 ns 1.09 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 1.09 ns 1.09 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.024 ns 0.032 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 2.20 % 2.90 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 1.08 ns 1.09 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 1.08 ns 1.09 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.016 ns 0.014 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 1.48 % 1.30 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 1.09 ns 1.09 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 1.09 ns 1.10 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.005 ns 0.012 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 0.49 % 1.12 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.102 ns 0.000 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 0.63 % 0.00 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.076 ns 0.000 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 0.47 % 0.00 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/64_median 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.056 ns 0.000 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 0.35 % 0.00 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.079 ns 0.000 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 0.49 % 0.00 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.125 ns 0.174 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.78 % 1.09 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.073 ns 0.174 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 0.46 % 1.09 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 16.1 ns 15.9 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.121 ns 0.367 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 0.75 % 2.29 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 16.0 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.042 ns 0.174 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.27 % 1.09 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 16.1 ns 16.0 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 16.1 ns 16.1 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.112 ns 0.192 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 0.70 % 1.20 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 1.12 ns 1.10 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 1.11 ns 1.10 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.011 ns 0.031 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.01 % 2.78 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 4.56 ns 4.54 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 4.54 ns 4.49 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.102 ns 0.098 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 2.25 % 2.15 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 4.49 ns 4.50 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 4.48 ns 4.50 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.027 ns 0.058 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 0.61 % 1.30 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 76.6 ns 76.3 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 76.7 ns 75.9 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 2.12 ns 1.67 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.77 % 2.19 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 77.3 ns 77.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 77.0 ns 76.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 3.05 ns 2.62 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 3.95 % 3.39 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 79.3 ns 79.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 79.5 ns 79.5 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 4.31 ns 3.67 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 5.44 % 4.63 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 82.6 ns 82.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 82.3 ns 82.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 1.87 ns 1.74 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 2.26 % 2.11 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 83.7 ns 83.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 83.7 ns 83.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 1.07 ns 0.000 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 1.28 % 0.00 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 88.5 ns 88.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 87.5 ns 86.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 3.22 ns 3.96 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 3.63 % 4.48 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 93.9 ns 94.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 94.1 ns 94.2 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 3.71 ns 3.82 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 3.95 % 4.06 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 125 ns 126 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 126 ns 126 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 4.07 ns 3.22 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 3.25 % 2.57 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 190 ns 189 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 188 ns 188 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 5.83 ns 4.34 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 3.08 % 2.29 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 1.14 ns 1.14 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 1.12 ns 1.13 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.043 ns 0.039 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 3.72 % 3.45 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 6.12 ns 6.09 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 6.32 ns 6.25 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.549 ns 0.556 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 8.97 % 9.13 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 5.29 ns 5.27 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 5.29 ns 5.30 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.012 ns 0.070 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 0.22 % 1.32 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 5.27 ns 5.27 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 5.23 ns 5.23 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.121 ns 0.150 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 2.30 % 2.84 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 8.14 ns 8.15 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 8.13 ns 8.20 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.077 ns 0.087 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 0.94 % 1.07 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 8.48 ns 8.41 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 8.44 ns 8.37 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.164 ns 0.219 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 1.93 % 2.61 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 8.58 ns 8.59 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 8.58 ns 8.63 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.127 ns 0.167 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 1.48 % 1.94 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 9.69 ns 9.68 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 9.67 ns 9.63 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.143 ns 0.105 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.48 % 1.08 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 11.4 ns 11.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 11.3 ns 11.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.178 ns 0.307 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.57 % 2.72 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 98.3 ns 97.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 99.6 ns 98.9 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 3.01 ns 4.62 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 3.06 % 4.76 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 130 ns 130 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 130 ns 130 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 3.75 ns 3.60 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.88 % 2.78 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 188 ns 187 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 188 ns 188 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 3.59 ns 4.83 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 1.91 % 2.58 % 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 31.4 ns 31.3 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 31.5 ns 31.5 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.520 ns 0.634 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.65 % 2.03 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 12.6 ns 12.6 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 12.6 ns 12.6 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.135 ns 0.228 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 1.07 % 1.81 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.7 ns 13.6 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.7 ns 13.7 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.166 ns 0.301 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.21 % 2.21 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 9.40 ns 9.42 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 9.34 ns 9.31 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.179 ns 0.296 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.91 % 3.14 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 13.4 ns 13.3 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 13.4 ns 13.3 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.251 ns 0.405 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.88 % 3.04 % 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 33.6 ns 33.2 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 33.5 ns 33.0 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.374 ns 0.965 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 1.11 % 2.91 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 8.50 ns 8.46 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 8.49 ns 8.46 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.106 ns 0.101 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.24 % 1.19 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 13.7 ns 13.5 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 13.7 ns 13.5 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.213 ns 0.000 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.56 % 0.00 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 7.50 ns 7.46 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 7.53 ns 7.41 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.081 ns 0.167 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.08 % 2.24 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 12.6 ns 12.6 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 12.4 ns 12.6 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.460 ns 0.351 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 3.64 % 2.78 % 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 43.6 ns 43.5 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 43.8 ns 43.5 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.865 ns 0.826 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 1.98 % 1.90 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 17.3 ns 17.1 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 17.1 ns 17.1 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.318 ns 0.222 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 1.84 % 1.30 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 12.9 ns 12.9 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 12.9 ns 13.0 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.107 ns 0.267 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 0.82 % 2.07 % 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 100 ns 99.9 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 100 ns 100 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 1.37 ns 1.05 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 1.37 % 1.05 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 58.7 ns 58.6 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 58.7 ns 58.6 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 0.055 ns 0.000 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 0.09 % 0.00 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 36.7 ns 36.6 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 36.7 ns 36.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.255 ns 0.419 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 0.69 % 1.14 % 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 5118 ns 5082 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 5015 ns 5028 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 256 ns 234 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 5.00 % 4.60 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1073 ns 1074 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1074 ns 1074 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 30.6 ns 28.2 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.85 % 2.62 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 767 ns 754 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 768 ns 759 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 10.1 ns 16.7 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 1.32 % 2.21 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 390 ns 390 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 386 ns 384 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 10.5 ns 13.1 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 2.70 % 3.35 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 239 ns 238 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 240 ns 238 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 1.20 ns 3.02 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 0.50 % 1.27 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 158 ns 159 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 158 ns 159 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 0.918 ns 2.01 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 0.58 % 1.27 % 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 4657 ns 4627 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 4626 ns 4602 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 87.2 ns 96.8 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 1.87 % 2.09 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 3774 ns 3767 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 3760 ns 3767 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 66.6 ns 68.3 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.76 % 1.81 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 716 ns 718 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 721 ns 718 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 18.4 ns 18.0 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.57 % 2.51 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 442 ns 443 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 442 ns 443 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 4.25 ns 7.69 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 0.96 % 1.74 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 303 ns 300 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 304 ns 302 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 4.86 ns 6.34 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.61 % 2.12 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 188 ns 186 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 189 ns 186 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 4.25 ns 5.40 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.26 % 2.90 % 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 221584 ns 220947 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 221856 ns 222168 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 3088 ns 4675 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 1.39 % 2.12 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 183793 ns 181029 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 182410 ns 182075 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 4717 ns 4007 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.57 % 2.21 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 19687 ns 19671 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 19753 ns 19671 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 462 ns 483 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.35 % 2.46 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16880 ns 16915 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16897 ns 17090 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 194 ns 349 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.15 % 2.06 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 17061 ns 17073 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 17073 ns 17073 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 272 ns 222 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.60 % 1.30 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 16444 ns 16401 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 16332 ns 16305 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 295 ns 367 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.80 % 2.24 % 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 4403 ns 4402 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 4390 ns 4426 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 43.3 ns 47.1 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 0.98 % 1.07 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 3893 ns 3870 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 3890 ns 3891 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 44.1 ns 76.8 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.13 % 1.98 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 794 ns 789 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 793 ns 793 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 19.0 ns 16.7 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 2.40 % 2.12 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 527 ns 527 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 528 ns 523 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 7.44 ns 15.0 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 1.41 % 2.84 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 381 ns 379 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 378 ns 377 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 8.74 ns 12.6 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 2.30 % 3.31 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 297 ns 292 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 299 ns 292 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 7.42 ns 0.000 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 2.50 % 0.00 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 10833 ns 10742 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 10807 ns 10742 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 90.0 ns 199 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 0.83 % 1.86 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 1053 ns 1052 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 1055 ns 1057 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 7.82 ns 20.0 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 0.74 % 1.91 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 2810 ns 2794 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 2794 ns 2794 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 67.1 ns 36.2 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 2.39 % 1.30 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 1904 ns 1893 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 1911 ns 1882 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 32.1 ns 43.4 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 1.68 % 2.29 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 2003 ns 1995 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 1998 ns 1995 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 50.7 ns 52.4 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.53 % 2.62 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 962 ns 952 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 962 ns 952 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 12.7 ns 19.9 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 1.32 % 2.09 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 807 ns 809 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 806 ns 809 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 8.18 ns 11.4 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 1.01 % 1.41 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 134 ns 133 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 134 ns 133 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 1.83 ns 2.67 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 1.37 % 2.01 % 4
|
||||
stringa str = "test = " + k + " times";_mean 126 ns 124 ns 4
|
||||
stringa str = "test = " + k + " times";_median 126 ns 124 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 0.706 ns 1.61 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 0.56 % 1.30 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 558 ns 559 ns 4
|
||||
std::string::find + substr + std::strtol_median 559 ns 562 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 10.3 ns 7.81 ns 4
|
||||
std::string::find + substr + std::strtol_cv 1.85 % 1.40 % 4
|
||||
ssa::splitter + ssa::as_int_mean 176 ns 176 ns 4
|
||||
ssa::splitter + ssa::as_int_median 176 ns 176 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 4.18 ns 5.75 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 2.37 % 3.28 % 4
|
||||
ssa::splitf + functor_mean 192 ns 192 ns 4
|
||||
ssa::splitf + functor_median 190 ns 190 ns 4
|
||||
ssa::splitf + functor_stddev 4.66 ns 5.71 ns 4
|
||||
ssa::splitf + functor_cv 2.43 % 2.98 % 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 1124 ns 1117 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 1116 ns 1099 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 24.4 ns 36.6 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 2.17 % 3.28 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 1940 ns 1938 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 1929 ns 1927 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 28.9 ns 43.4 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 1.49 % 2.24 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2359 ns 2356 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 2360 ns 2344 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 29.6 ns 24.4 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 1.25 % 1.04 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1654 ns 1650 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1660 ns 1669 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 40.9 ns 54.3 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 2.47 % 3.29 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1483 ns 1483 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1482 ns 1491 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 14.5 ns 30.1 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 0.98 % 2.03 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1122 ns 1117 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 1119 ns 1123 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 16.8 ns 12.2 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 1.50 % 1.09 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 1170 ns 1165 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 1174 ns 1158 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 18.2 ns 26.7 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 1.56 % 2.29 % 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 308 ns 305 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 305 ns 303 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 6.23 ns 11.9 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 2.02 % 3.90 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 364 ns 363 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 366 ns 364 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 9.78 ns 7.35 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 2.68 % 2.03 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 305 ns 305 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 306 ns 305 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 6.50 ns 7.65 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 2.13 % 2.51 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 269 ns 264 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 268 ns 264 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 4.83 ns 5.13 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.80 % 1.94 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 366 ns 365 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 367 ns 365 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 2.14 ns 4.63 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 0.58 % 1.27 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 202 ns 202 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 202 ns 202 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 2.65 ns 5.85 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 1.31 % 2.90 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 293 ns 292 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 293 ns 292 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 7.11 ns 5.41 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 2.43 % 1.86 % 4
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to ---- in std::string|64_mean 223 ns 221 ns 4
|
||||
replace bb to ---- in std::string|64_median 223 ns 222 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 4.11 ns 4.67 ns 4
|
||||
replace bb to ---- in std::string|64_cv 1.84 % 2.12 % 4
|
||||
replace bb to ---- in std::string|256_mean 727 ns 729 ns 4
|
||||
replace bb to ---- in std::string|256_median 720 ns 718 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 20.3 ns 26.4 ns 4
|
||||
replace bb to ---- in std::string|256_cv 2.79 % 3.62 % 4
|
||||
replace bb to ---- in std::string|512_mean 1418 ns 1413 ns 4
|
||||
replace bb to ---- in std::string|512_median 1416 ns 1413 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 37.9 ns 45.0 ns 4
|
||||
replace bb to ---- in std::string|512_cv 2.67 % 3.19 % 4
|
||||
replace bb to ---- in std::string|1024_mean 3058 ns 3058 ns 4
|
||||
replace bb to ---- in std::string|1024_median 3054 ns 3076 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 45.8 ns 36.6 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 1.50 % 1.20 % 4
|
||||
replace bb to ---- in std::string|2048_mean 8038 ns 7847 ns 4
|
||||
replace bb to ---- in std::string|2048_median 8026 ns 7847 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 49.4 ns 318 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 0.61 % 4.06 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 216 ns 216 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 215 ns 215 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 2.62 ns 2.44 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 1.22 % 1.13 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 606 ns 607 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 602 ns 600 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 13.8 ns 14.0 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 2.27 % 2.30 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 1002 ns 1004 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 996 ns 994 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 22.0 ns 29.6 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.20 % 2.95 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 1848 ns 1842 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 1847 ns 1842 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 26.3 ns 31.3 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.42 % 1.70 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3556 ns 3530 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 3581 ns 3568 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 76.1 ns 109 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 2.14 % 3.07 % 4
|
||||
replace bb to ---- by init stringa|64_mean 165 ns 165 ns 4
|
||||
replace bb to ---- by init stringa|64_median 165 ns 165 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 3.13 ns 3.13 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 1.90 % 1.90 % 4
|
||||
replace bb to ---- by init stringa|256_mean 366 ns 367 ns 4
|
||||
replace bb to ---- by init stringa|256_median 363 ns 369 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 7.03 ns 4.01 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 1.92 % 1.09 % 4
|
||||
replace bb to ---- by init stringa|512_mean 793 ns 793 ns 4
|
||||
replace bb to ---- by init stringa|512_median 799 ns 802 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 15.0 ns 17.4 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 1.89 % 2.20 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 1626 ns 1621 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 1632 ns 1611 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 14.6 ns 19.2 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 0.90 % 1.18 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 3047 ns 3032 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 3055 ns 3048 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 22.3 ns 33.1 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 0.73 % 1.09 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 187 ns 186 ns 4
|
||||
replace bb to -- in std::string|64_median 188 ns 186 ns 4
|
||||
replace bb to -- in std::string|64_stddev 2.48 ns 4.95 ns 4
|
||||
replace bb to -- in std::string|64_cv 1.33 % 2.66 % 4
|
||||
replace bb to -- in std::string|256_mean 469 ns 470 ns 4
|
||||
replace bb to -- in std::string|256_median 471 ns 476 ns 4
|
||||
replace bb to -- in std::string|256_stddev 8.19 ns 10.8 ns 4
|
||||
replace bb to -- in std::string|256_cv 1.74 % 2.30 % 4
|
||||
replace bb to -- in std::string|512_mean 837 ns 837 ns 4
|
||||
replace bb to -- in std::string|512_median 835 ns 837 ns 4
|
||||
replace bb to -- in std::string|512_stddev 14.4 ns 24.2 ns 4
|
||||
replace bb to -- in std::string|512_cv 1.73 % 2.89 % 4
|
||||
replace bb to -- in std::string|1024_mean 1612 ns 1596 ns 4
|
||||
replace bb to -- in std::string|1024_median 1608 ns 1604 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 24.9 ns 17.4 ns 4
|
||||
replace bb to -- in std::string|1024_cv 1.55 % 1.09 % 4
|
||||
replace bb to -- in std::string|2048_mean 3131 ns 3122 ns 4
|
||||
replace bb to -- in std::string|2048_median 3146 ns 3104 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 47.3 ns 66.8 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.51 % 2.14 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 175 ns 176 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 176 ns 176 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 2.70 ns 4.83 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 1.54 % 2.75 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 427 ns 426 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 425 ns 424 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 8.29 ns 11.8 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 1.94 % 2.78 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 723 ns 724 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 723 ns 724 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 1.22 ns 10.1 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 0.17 % 1.39 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 1373 ns 1365 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 1373 ns 1365 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 36.7 ns 18.1 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 2.68 % 1.33 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 2685 ns 2683 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 2675 ns 2668 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 29.6 ns 29.6 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.10 % 1.10 % 4
|
||||
replace bb to -- by init stringa|64_mean 153 ns 152 ns 4
|
||||
replace bb to -- by init stringa|64_median 153 ns 152 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 2.02 ns 2.01 ns 4
|
||||
replace bb to -- by init stringa|64_cv 1.32 % 1.33 % 4
|
||||
replace bb to -- by init stringa|256_mean 322 ns 322 ns 4
|
||||
replace bb to -- by init stringa|256_median 319 ns 319 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 9.25 ns 10.4 ns 4
|
||||
replace bb to -- by init stringa|256_cv 2.87 % 3.21 % 4
|
||||
replace bb to -- by init stringa|512_mean 520 ns 516 ns 4
|
||||
replace bb to -- by init stringa|512_median 514 ns 509 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 18.8 ns 19.7 ns 4
|
||||
replace bb to -- by init stringa|512_cv 3.61 % 3.82 % 4
|
||||
replace bb to -- by init stringa|1024_mean 954 ns 952 ns 4
|
||||
replace bb to -- by init stringa|1024_median 951 ns 952 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 20.0 ns 27.0 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 2.10 % 2.84 % 4
|
||||
replace bb to -- by init stringa|2048_mean 1806 ns 1800 ns 4
|
||||
replace bb to -- by init stringa|2048_median 1801 ns 1800 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 32.2 ns 48.3 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 1.78 % 2.69 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 4069702 ns 4080831 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 4065785 ns 4102654 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 27677 ns 43645 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 0.68 % 1.07 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 5913523 ns 5824498 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 5907914 ns 5859375 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 277139 ns 309341 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 4.69 % 5.31 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3619495 ns 3545673 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3562421 ns 3565705 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 164099 ns 76717 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 4.53 % 2.16 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 6497268 ns 6522042 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 6500552 ns 6556920 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 44944 ns 69754 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 0.69 % 1.07 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 1507 ns 1507 ns 4
|
||||
Build func full name std::string;_median 1518 ns 1507 ns 4
|
||||
Build func full name std::string;_stddev 28.8 ns 25.6 ns 4
|
||||
Build func full name std::string;_cv 1.91 % 1.70 % 4
|
||||
Build func full name std::string 1;_mean 1515 ns 1507 ns 4
|
||||
Build func full name std::string 1;_median 1512 ns 1507 ns 4
|
||||
Build func full name std::string 1;_stddev 14.5 ns 25.6 ns 4
|
||||
Build func full name std::string 1;_cv 0.96 % 1.70 % 4
|
||||
Build func full name std::stream;_mean 8296 ns 8327 ns 4
|
||||
Build func full name std::stream;_median 8331 ns 8371 ns 4
|
||||
Build func full name std::stream;_stddev 233 ns 262 ns 4
|
||||
Build func full name std::stream;_cv 2.80 % 3.14 % 4
|
||||
Build func full name stringa;_mean 749 ns 750 ns 4
|
||||
Build func full name stringa;_median 748 ns 750 ns 4
|
||||
Build func full name stringa;_stddev 12.4 ns 14.2 ns 4
|
||||
Build func full name stringa;_cv 1.65 % 1.90 % 4
|
||||
Build func full name stringa 1;_mean 878 ns 853 ns 4
|
||||
Build func full name stringa 1;_median 865 ns 858 ns 4
|
||||
Build func full name stringa 1;_stddev 30.2 ns 10.5 ns 4
|
||||
Build func full name stringa 1;_cv 3.44 % 1.23 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 1457 ns 1460 ns 4
|
||||
To upper case std::wstring_median 1455 ns 1460 ns 4
|
||||
To upper case std::wstring_stddev 16.8 ns 18.1 ns 4
|
||||
To upper case std::wstring_cv 1.16 % 1.24 % 4
|
||||
To upper case lstringw<15>_mean 41.0 ns 41.0 ns 4
|
||||
To upper case lstringw<15>_median 41.0 ns 41.0 ns 4
|
||||
To upper case lstringw<15>_stddev 0.393 ns 0.544 ns 4
|
||||
To upper case lstringw<15>_cv 0.96 % 1.33 % 4
|
||||
|
|
@ -1,777 +0,0 @@
|
|||
2025-08-06T12:39:51+03:00
|
||||
Running benchStr.exe
|
||||
Run on (32 X 2497.21 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)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e;_mean 2.59 ns 2.58 ns 10
|
||||
std::string e;_median 2.60 ns 2.61 ns 10
|
||||
std::string e;_stddev 0.037 ns 0.081 ns 10
|
||||
std::string e;_cv 1.42 % 3.13 % 10
|
||||
std::string_view e;_mean 1.86 ns 1.84 ns 10
|
||||
std::string_view e;_median 1.85 ns 1.84 ns 10
|
||||
std::string_view e;_stddev 0.025 ns 0.040 ns 10
|
||||
std::string_view e;_cv 1.33 % 2.20 % 10
|
||||
ssa e;_mean 1.84 ns 1.84 ns 10
|
||||
ssa e;_median 1.84 ns 1.81 ns 10
|
||||
ssa e;_stddev 0.033 ns 0.044 ns 10
|
||||
ssa e;_cv 1.79 % 2.40 % 10
|
||||
stringa e;_mean 2.22 ns 2.22 ns 10
|
||||
stringa e;_median 2.23 ns 2.22 ns 10
|
||||
stringa e;_stddev 0.034 ns 0.034 ns 10
|
||||
stringa e;_cv 1.53 % 1.54 % 10
|
||||
lstringa<20> e;_mean 2.62 ns 2.60 ns 10
|
||||
lstringa<20> e;_median 2.59 ns 2.61 ns 10
|
||||
lstringa<20> e;_stddev 0.136 ns 0.078 ns 10
|
||||
lstringa<20> e;_cv 5.18 % 3.01 % 10
|
||||
lstringa<40> e;_mean 2.60 ns 2.58 ns 10
|
||||
lstringa<40> e;_median 2.61 ns 2.57 ns 10
|
||||
lstringa<40> e;_stddev 0.049 ns 0.051 ns 10
|
||||
lstringa<40> e;_cv 1.86 % 1.99 % 10
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text";_mean 2.61 ns 2.59 ns 10
|
||||
std::string e = "Test text";_median 2.61 ns 2.61 ns 10
|
||||
std::string e = "Test text";_stddev 0.056 ns 0.064 ns 10
|
||||
std::string e = "Test text";_cv 2.16 % 2.47 % 10
|
||||
std::string_view e = "Test text";_mean 1.83 ns 1.83 ns 10
|
||||
std::string_view e = "Test text";_median 1.83 ns 1.82 ns 10
|
||||
std::string_view e = "Test text";_stddev 0.027 ns 0.034 ns 10
|
||||
std::string_view e = "Test text";_cv 1.45 % 1.88 % 10
|
||||
ssa e = "Test text";_mean 1.84 ns 1.84 ns 10
|
||||
ssa e = "Test text";_median 1.83 ns 1.84 ns 10
|
||||
ssa e = "Test text";_stddev 0.029 ns 0.037 ns 10
|
||||
ssa e = "Test text";_cv 1.57 % 1.99 % 10
|
||||
stringa e = "Test text";_mean 2.60 ns 2.59 ns 10
|
||||
stringa e = "Test text";_median 2.60 ns 2.58 ns 10
|
||||
stringa e = "Test text";_stddev 0.040 ns 0.041 ns 10
|
||||
stringa e = "Test text";_cv 1.52 % 1.60 % 10
|
||||
lstringa<20> e = "Test text";_mean 2.25 ns 2.25 ns 10
|
||||
lstringa<20> e = "Test text";_median 2.25 ns 2.25 ns 10
|
||||
lstringa<20> e = "Test text";_stddev 0.031 ns 0.033 ns 10
|
||||
lstringa<20> e = "Test text";_cv 1.38 % 1.45 % 10
|
||||
lstringa<40> e = "Test text";_mean 2.63 ns 2.62 ns 10
|
||||
lstringa<40> e = "Test text";_median 2.62 ns 2.62 ns 10
|
||||
lstringa<40> e = "Test text";_stddev 0.063 ns 0.053 ns 10
|
||||
lstringa<40> e = "Test text";_cv 2.41 % 2.01 % 10
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 74.8 ns 74.8 ns 10
|
||||
std::string e = "123456789012345678901234567890";_median 75.4 ns 75.0 ns 10
|
||||
std::string e = "123456789012345678901234567890";_stddev 1.69 ns 1.73 ns 10
|
||||
std::string e = "123456789012345678901234567890";_cv 2.26 % 2.32 % 10
|
||||
std::string_view e = "123456789012345678901234567890";_mean 1.84 ns 1.83 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_median 1.84 ns 1.84 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.018 ns 0.028 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_cv 1.00 % 1.54 % 10
|
||||
ssa e = "123456789012345678901234567890";_mean 1.85 ns 1.85 ns 10
|
||||
ssa e = "123456789012345678901234567890";_median 1.85 ns 1.84 ns 10
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.022 ns 0.026 ns 10
|
||||
ssa e = "123456789012345678901234567890";_cv 1.17 % 1.43 % 10
|
||||
stringa e = "123456789012345678901234567890";_mean 2.92 ns 2.88 ns 10
|
||||
stringa e = "123456789012345678901234567890";_median 2.89 ns 2.89 ns 10
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.100 ns 0.026 ns 10
|
||||
stringa e = "123456789012345678901234567890";_cv 3.43 % 0.92 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 76.7 ns 76.0 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 76.7 ns 76.7 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 1.13 ns 1.47 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 1.48 % 1.93 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 3.01 ns 2.99 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 3.01 ns 2.95 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.059 ns 0.079 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 1.96 % 2.62 % 10
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 5.16 ns 5.13 ns 10
|
||||
std::string e = "Test text"; auto c{e};_median 5.17 ns 5.16 ns 10
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.099 ns 0.128 ns 10
|
||||
std::string e = "Test text"; auto c{e};_cv 1.91 % 2.50 % 10
|
||||
std::string_view e = "Test text"; auto c{e};_mean 3.74 ns 3.73 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_median 3.73 ns 3.75 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.024 ns 0.055 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_cv 0.64 % 1.48 % 10
|
||||
ssa e = "Test text"; auto c{e};_mean 3.75 ns 3.74 ns 10
|
||||
ssa e = "Test text"; auto c{e};_median 3.75 ns 3.77 ns 10
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.023 ns 0.040 ns 10
|
||||
ssa e = "Test text"; auto c{e};_cv 0.62 % 1.08 % 10
|
||||
stringa e = "Test text"; auto c{e};_mean 4.07 ns 4.06 ns 10
|
||||
stringa e = "Test text"; auto c{e};_median 4.08 ns 4.05 ns 10
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.031 ns 0.069 ns 10
|
||||
stringa e = "Test text"; auto c{e};_cv 0.76 % 1.71 % 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 8.64 ns 8.62 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 8.54 ns 8.58 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.240 ns 0.276 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 2.78 % 3.20 % 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 8.46 ns 8.44 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 8.46 ns 8.37 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.110 ns 0.147 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 1.29 % 1.74 % 10
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 76.3 ns 75.5 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 75.7 ns 75.0 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 3.22 ns 2.61 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 4.22 % 3.45 % 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 1.84 ns 1.84 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 1.84 ns 1.84 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.018 ns 0.034 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 1.00 % 1.86 % 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 1.87 ns 1.84 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 1.85 ns 1.84 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.110 ns 0.034 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 5.87 % 1.86 % 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 2.97 ns 2.96 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 2.97 ns 2.95 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.045 ns 0.078 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.53 % 2.63 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 82.0 ns 82.0 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 81.4 ns 82.0 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 2.62 ns 2.47 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 3.20 % 3.01 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 7.05 ns 7.05 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 7.04 ns 7.11 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.058 ns 0.099 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 0.83 % 1.40 % 10
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find;_mean 42.5 ns 42.2 ns 10
|
||||
std::string::find;_median 41.6 ns 41.0 ns 10
|
||||
std::string::find;_stddev 3.23 ns 3.41 ns 10
|
||||
std::string::find;_cv 7.61 % 8.08 % 10
|
||||
std::string_view::find;_mean 41.5 ns 40.8 ns 10
|
||||
std::string_view::find;_median 41.0 ns 40.8 ns 10
|
||||
std::string_view::find;_stddev 1.46 ns 0.855 ns 10
|
||||
std::string_view::find;_cv 3.52 % 2.10 % 10
|
||||
ssa::find;_mean 21.1 ns 21.0 ns 10
|
||||
ssa::find;_median 21.2 ns 20.9 ns 10
|
||||
ssa::find;_stddev 0.338 ns 0.430 ns 10
|
||||
ssa::find;_cv 1.60 % 2.05 % 10
|
||||
stringa::find;_mean 32.2 ns 32.2 ns 10
|
||||
stringa::find;_median 32.2 ns 32.1 ns 10
|
||||
stringa::find;_stddev 1.30 ns 1.22 ns 10
|
||||
stringa::find;_cv 4.02 % 3.79 % 10
|
||||
lstringa<20>::find;_mean 21.3 ns 21.2 ns 10
|
||||
lstringa<20>::find;_median 21.2 ns 21.1 ns 10
|
||||
lstringa<20>::find;_stddev 0.530 ns 0.526 ns 10
|
||||
lstringa<20>::find;_cv 2.49 % 2.48 % 10
|
||||
lstringa<40>::find;_mean 21.6 ns 21.4 ns 10
|
||||
lstringa<40>::find;_median 21.5 ns 21.5 ns 10
|
||||
lstringa<40>::find;_stddev 0.399 ns 0.428 ns 10
|
||||
lstringa<40>::find;_cv 1.85 % 1.99 % 10
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string copy{str_with_len_N};/15_mean 5.18 ns 5.15 ns 10
|
||||
std::string copy{str_with_len_N};/15_median 5.18 ns 5.16 ns 10
|
||||
std::string copy{str_with_len_N};/15_stddev 0.073 ns 0.122 ns 10
|
||||
std::string copy{str_with_len_N};/15_cv 1.42 % 2.37 % 10
|
||||
std::string copy{str_with_len_N};/16_mean 84.9 ns 83.5 ns 10
|
||||
std::string copy{str_with_len_N};/16_median 83.6 ns 83.7 ns 10
|
||||
std::string copy{str_with_len_N};/16_stddev 3.62 ns 2.39 ns 10
|
||||
std::string copy{str_with_len_N};/16_cv 4.26 % 2.86 % 10
|
||||
std::string copy{str_with_len_N};/23_mean 85.1 ns 84.5 ns 10
|
||||
std::string copy{str_with_len_N};/23_median 84.5 ns 83.7 ns 10
|
||||
std::string copy{str_with_len_N};/23_stddev 3.10 ns 2.88 ns 10
|
||||
std::string copy{str_with_len_N};/23_cv 3.64 % 3.41 % 10
|
||||
std::string copy{str_with_len_N};/24_mean 83.1 ns 82.7 ns 10
|
||||
std::string copy{str_with_len_N};/24_median 83.3 ns 83.7 ns 10
|
||||
std::string copy{str_with_len_N};/24_stddev 1.97 ns 2.75 ns 10
|
||||
std::string copy{str_with_len_N};/24_cv 2.37 % 3.33 % 10
|
||||
std::string copy{str_with_len_N};/32_mean 89.1 ns 87.9 ns 10
|
||||
std::string copy{str_with_len_N};/32_median 89.5 ns 87.9 ns 10
|
||||
std::string copy{str_with_len_N};/32_stddev 1.88 ns 2.21 ns 10
|
||||
std::string copy{str_with_len_N};/32_cv 2.11 % 2.51 % 10
|
||||
std::string copy{str_with_len_N};/64_mean 89.7 ns 89.1 ns 10
|
||||
std::string copy{str_with_len_N};/64_median 89.3 ns 90.0 ns 10
|
||||
std::string copy{str_with_len_N};/64_stddev 3.48 ns 2.82 ns 10
|
||||
std::string copy{str_with_len_N};/64_cv 3.88 % 3.17 % 10
|
||||
std::string copy{str_with_len_N};/128_mean 89.0 ns 88.3 ns 10
|
||||
std::string copy{str_with_len_N};/128_median 89.4 ns 87.9 ns 10
|
||||
std::string copy{str_with_len_N};/128_stddev 1.67 ns 1.65 ns 10
|
||||
std::string copy{str_with_len_N};/128_cv 1.88 % 1.87 % 10
|
||||
std::string copy{str_with_len_N};/256_mean 91.5 ns 89.6 ns 10
|
||||
std::string copy{str_with_len_N};/256_median 90.9 ns 90.0 ns 10
|
||||
std::string copy{str_with_len_N};/256_stddev 3.43 ns 2.38 ns 10
|
||||
std::string copy{str_with_len_N};/256_cv 3.75 % 2.65 % 10
|
||||
std::string copy{str_with_len_N};/512_mean 93.8 ns 93.5 ns 10
|
||||
std::string copy{str_with_len_N};/512_median 94.0 ns 94.2 ns 10
|
||||
std::string copy{str_with_len_N};/512_stddev 1.39 ns 1.99 ns 10
|
||||
std::string copy{str_with_len_N};/512_cv 1.48 % 2.12 % 10
|
||||
std::string copy{str_with_len_N};/1024_mean 99.5 ns 99.4 ns 10
|
||||
std::string copy{str_with_len_N};/1024_median 99.3 ns 98.4 ns 10
|
||||
std::string copy{str_with_len_N};/1024_stddev 2.81 ns 3.31 ns 10
|
||||
std::string copy{str_with_len_N};/1024_cv 2.82 % 3.33 % 10
|
||||
std::string copy{str_with_len_N};/2048_mean 132 ns 131 ns 10
|
||||
std::string copy{str_with_len_N};/2048_median 133 ns 131 ns 10
|
||||
std::string copy{str_with_len_N};/2048_stddev 6.13 ns 5.17 ns 10
|
||||
std::string copy{str_with_len_N};/2048_cv 4.64 % 3.95 % 10
|
||||
std::string copy{str_with_len_N};/4096_mean 181 ns 180 ns 10
|
||||
std::string copy{str_with_len_N};/4096_median 182 ns 182 ns 10
|
||||
std::string copy{str_with_len_N};/4096_stddev 3.84 ns 4.83 ns 10
|
||||
std::string copy{str_with_len_N};/4096_cv 2.12 % 2.69 % 10
|
||||
stringa copy{str_with_len_N};/15_mean 4.15 ns 4.06 ns 10
|
||||
stringa copy{str_with_len_N};/15_median 4.12 ns 4.08 ns 10
|
||||
stringa copy{str_with_len_N};/15_stddev 0.168 ns 0.083 ns 10
|
||||
stringa copy{str_with_len_N};/15_cv 4.04 % 2.05 % 10
|
||||
stringa copy{str_with_len_N};/16_mean 4.11 ns 4.10 ns 10
|
||||
stringa copy{str_with_len_N};/16_median 4.11 ns 4.08 ns 10
|
||||
stringa copy{str_with_len_N};/16_stddev 0.036 ns 0.057 ns 10
|
||||
stringa copy{str_with_len_N};/16_cv 0.88 % 1.40 % 10
|
||||
stringa copy{str_with_len_N};/23_mean 4.13 ns 4.13 ns 10
|
||||
stringa copy{str_with_len_N};/23_median 4.12 ns 4.13 ns 10
|
||||
stringa copy{str_with_len_N};/23_stddev 0.051 ns 0.077 ns 10
|
||||
stringa copy{str_with_len_N};/23_cv 1.22 % 1.87 % 10
|
||||
stringa copy{str_with_len_N};/24_mean 18.7 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/24_median 18.6 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/24_stddev 0.128 ns 0.293 ns 10
|
||||
stringa copy{str_with_len_N};/24_cv 0.68 % 1.57 % 10
|
||||
stringa copy{str_with_len_N};/32_mean 18.6 ns 18.5 ns 10
|
||||
stringa copy{str_with_len_N};/32_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/32_stddev 0.118 ns 0.243 ns 10
|
||||
stringa copy{str_with_len_N};/32_cv 0.64 % 1.31 % 10
|
||||
stringa copy{str_with_len_N};/64_mean 18.6 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/64_median 18.6 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/64_stddev 0.168 ns 0.221 ns 10
|
||||
stringa copy{str_with_len_N};/64_cv 0.90 % 1.18 % 10
|
||||
stringa copy{str_with_len_N};/128_mean 18.6 ns 18.5 ns 10
|
||||
stringa copy{str_with_len_N};/128_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/128_stddev 0.180 ns 0.243 ns 10
|
||||
stringa copy{str_with_len_N};/128_cv 0.97 % 1.31 % 10
|
||||
stringa copy{str_with_len_N};/256_mean 18.6 ns 18.5 ns 10
|
||||
stringa copy{str_with_len_N};/256_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/256_stddev 0.089 ns 0.283 ns 10
|
||||
stringa copy{str_with_len_N};/256_cv 0.48 % 1.53 % 10
|
||||
stringa copy{str_with_len_N};/512_mean 18.7 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/512_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/512_stddev 0.388 ns 0.324 ns 10
|
||||
stringa copy{str_with_len_N};/512_cv 2.07 % 1.74 % 10
|
||||
stringa copy{str_with_len_N};/1024_mean 18.6 ns 18.6 ns 10
|
||||
stringa copy{str_with_len_N};/1024_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.199 ns 0.268 ns 10
|
||||
stringa copy{str_with_len_N};/1024_cv 1.07 % 1.44 % 10
|
||||
stringa copy{str_with_len_N};/2048_mean 18.8 ns 18.5 ns 10
|
||||
stringa copy{str_with_len_N};/2048_median 18.6 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.774 ns 0.265 ns 10
|
||||
stringa copy{str_with_len_N};/2048_cv 4.11 % 1.43 % 10
|
||||
stringa copy{str_with_len_N};/4096_mean 18.5 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/4096_median 18.5 ns 18.4 ns 10
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.111 ns 0.309 ns 10
|
||||
stringa copy{str_with_len_N};/4096_cv 0.60 % 1.68 % 10
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 8.67 ns 8.66 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_median 8.62 ns 8.58 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.415 ns 0.409 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 4.78 % 4.72 % 10
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 8.61 ns 8.58 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_median 8.57 ns 8.54 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.177 ns 0.138 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 2.06 % 1.60 % 10
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 8.58 ns 8.56 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_median 8.57 ns 8.54 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.127 ns 0.173 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 1.48 % 2.03 % 10
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 80.5 ns 80.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_median 81.1 ns 79.5 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 2.02 ns 2.43 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.50 % 3.03 % 10
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 83.1 ns 81.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_median 82.9 ns 82.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 3.13 ns 3.12 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 3.76 % 3.82 % 10
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 83.1 ns 82.5 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_median 83.1 ns 83.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 2.31 ns 2.47 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 2.78 % 3.00 % 10
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 86.5 ns 85.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_median 86.4 ns 85.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 1.40 ns 0.990 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 1.61 % 1.16 % 10
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 89.8 ns 88.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_median 89.3 ns 87.9 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 3.02 ns 2.65 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 3.37 % 2.98 % 10
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 90.8 ns 90.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_median 90.4 ns 90.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 2.53 ns 2.87 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 2.78 % 3.18 % 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 101 ns 99.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 101 ns 98.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 4.94 ns 3.97 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 4.88 % 3.99 % 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 131 ns 130 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 129 ns 128 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 4.11 ns 4.60 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 3.13 % 3.55 % 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 192 ns 189 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 192 ns 188 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 4.74 ns 2.65 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 2.47 % 1.40 % 10
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 8.47 ns 8.46 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_median 8.45 ns 8.46 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.064 ns 0.092 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 0.76 % 1.09 % 10
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 8.59 ns 8.54 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_median 8.59 ns 8.58 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.112 ns 0.165 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 1.31 % 1.93 % 10
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 8.48 ns 8.48 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_median 8.47 ns 8.48 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.099 ns 0.110 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 1.16 % 1.30 % 10
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 8.60 ns 8.42 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_median 8.49 ns 8.37 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.400 ns 0.165 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 4.65 % 1.96 % 10
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 11.7 ns 11.5 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_median 11.5 ns 11.5 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.459 ns 0.365 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 3.93 % 3.16 % 10
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 11.6 ns 11.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_median 11.6 ns 11.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.274 ns 0.171 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 2.36 % 1.48 % 10
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 11.9 ns 11.9 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_median 11.9 ns 11.8 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.201 ns 0.236 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 1.69 % 1.99 % 10
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 13.0 ns 12.9 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_median 12.9 ns 12.8 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.235 ns 0.176 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.80 % 1.37 % 10
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 14.6 ns 14.4 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_median 14.5 ns 14.4 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.500 ns 0.232 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 3.43 % 1.61 % 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 101 ns 100 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 99.2 ns 100 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 4.55 ns 3.64 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 4.53 % 3.64 % 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 130 ns 129 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 129 ns 128 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 3.39 ns 3.90 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.61 % 3.03 % 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 192 ns 192 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 192 ns 193 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 3.24 ns 3.85 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 1.69 % 2.01 % 10
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 33.7 ns 33.5 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 33.7 ns 33.3 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.541 ns 0.756 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.60 % 2.26 % 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 17.9 ns 17.9 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 17.9 ns 17.6 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.358 ns 0.443 ns 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 2.00 % 2.48 % 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 15.4 ns 15.3 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 15.4 ns 15.4 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.153 ns 0.258 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.00 % 1.69 % 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 15.1 ns 15.1 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 15.0 ns 15.1 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.250 ns 0.362 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.66 % 2.41 % 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 14.9 ns 14.8 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 15.0 ns 14.9 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.290 ns 0.333 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 1.94 % 2.24 % 10
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 36.1 ns 35.7 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 36.1 ns 36.0 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.420 ns 0.971 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 1.16 % 2.72 % 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 10.1 ns 10.0 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 10.1 ns 10.0 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.165 ns 0.208 ns 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.64 % 2.08 % 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 13.8 ns 13.6 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 13.6 ns 13.7 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.516 ns 0.244 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 3.74 % 1.79 % 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 12.8 ns 12.8 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 12.8 ns 12.8 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.202 ns 0.158 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.58 % 1.24 % 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 12.8 ns 12.6 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 12.8 ns 12.6 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.167 ns 0.265 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.30 % 2.09 % 10
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 48.8 ns 48.1 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 48.9 ns 48.4 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 1.84 ns 1.44 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 3.76 % 2.98 % 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 22.4 ns 22.2 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 22.3 ns 22.2 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.215 ns 0.366 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.96 % 1.65 % 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 19.0 ns 19.0 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 19.0 ns 18.8 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.223 ns 0.293 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.17 % 1.54 % 10
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 5758 ns 5734 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 5729 ns 5720 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 141 ns 180 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.44 % 3.13 % 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1327 ns 1318 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1326 ns 1318 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 26.7 ns 25.6 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 2.01 % 1.94 % 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 972 ns 963 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 953 ns 963 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 53.6 ns 39.5 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 5.52 % 4.10 % 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 539 ns 536 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 538 ns 537 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 13.9 ns 19.9 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 2.59 % 3.72 % 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 371 ns 370 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 371 ns 372 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 4.64 ns 9.50 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 1.25 % 2.57 % 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 235 ns 231 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 232 ns 229 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 7.10 ns 7.30 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 3.02 % 3.16 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 5986 ns 5984 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 5935 ns 5938 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 197 ns 196 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 3.29 % 3.27 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 3929 ns 3917 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 3847 ns 3850 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 165 ns 136 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 4.20 % 3.46 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 849 ns 837 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 843 ns 837 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 25.5 ns 18.4 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.00 % 2.20 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 550 ns 550 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 550 ns 544 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 12.6 ns 15.0 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.30 % 2.73 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 388 ns 383 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 387 ns 385 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 11.3 ns 9.11 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.91 % 2.38 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 271 ns 271 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 268 ns 267 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 6.37 ns 6.28 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.35 % 2.32 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 285644 ns 283121 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 284822 ns 282493 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 5319 ns 7516 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 1.86 % 2.65 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 194551 ns 194632 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 192304 ns 192540 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 4793 ns 5313 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.46 % 2.73 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 23615 ns 23490 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 23822 ns 23542 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 534 ns 626 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.26 % 2.67 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 22280 ns 22119 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 22301 ns 21973 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 236 ns 463 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.06 % 2.09 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 22335 ns 22119 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 22202 ns 21973 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 749 ns 566 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.35 % 2.56 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 21663 ns 21582 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 21492 ns 21484 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 516 ns 385 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.38 % 1.78 % 10
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 5491 ns 5500 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 5477 ns 5469 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 117 ns 177 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.14 % 3.23 % 10
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 3997 ns 3990 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_median 3983 ns 3990 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 96.0 ns 113 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 2.40 % 2.83 % 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 958 ns 950 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 951 ns 952 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 33.2 ns 29.2 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 3.47 % 3.08 % 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 664 ns 661 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 637 ns 637 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 70.1 ns 70.9 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 10.56 % 10.73 % 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 483 ns 476 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 479 ns 476 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 16.5 ns 5.51 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 3.42 % 1.16 % 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 381 ns 375 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 375 ns 372 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 13.7 ns 15.5 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 3.59 % 4.14 % 10
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 11615 ns 11579 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_median 11545 ns 11440 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 250 ns 271 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 2.15 % 2.34 % 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 1260 ns 1256 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 1258 ns 1242 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 43.2 ns 50.9 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 3.43 % 4.06 % 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 2855 ns 2846 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 2847 ns 2846 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 56.7 ns 39.5 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 1.98 % 1.39 % 10
|
||||
std::string str = std::format("test = {} times", k);_mean 2420 ns 2399 ns 10
|
||||
std::string str = std::format("test = {} times", k);_median 2407 ns 2403 ns 10
|
||||
std::string str = std::format("test = {} times", k);_stddev 56.2 ns 39.7 ns 10
|
||||
std::string str = std::format("test = {} times", k);_cv 2.32 % 1.66 % 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 2609 ns 2585 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 2633 ns 2609 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 64.8 ns 63.7 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.48 % 2.47 % 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1549 ns 1545 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1544 ns 1535 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 22.3 ns 23.5 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 1.44 % 1.52 % 10
|
||||
lstringa<8> str = "test = " + k + " times";_mean 949 ns 935 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_median 932 ns 921 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 47.9 ns 44.2 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_cv 5.05 % 4.72 % 10
|
||||
lstringa<32> str = "test = " + k + " times";_mean 191 ns 190 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_median 191 ns 190 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 3.14 ns 4.78 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_cv 1.64 % 2.51 % 10
|
||||
stringa str = "test = " + k + " times";_mean 241 ns 239 ns 10
|
||||
stringa str = "test = " + k + " times";_median 240 ns 241 ns 10
|
||||
stringa str = "test = " + k + " times";_stddev 2.40 ns 5.54 ns 10
|
||||
stringa str = "test = " + k + " times";_cv 1.00 % 2.32 % 10
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find + substr + std::strtol_mean 555 ns 547 ns 10
|
||||
std::string::find + substr + std::strtol_median 553 ns 547 ns 10
|
||||
std::string::find + substr + std::strtol_stddev 16.8 ns 12.8 ns 10
|
||||
std::string::find + substr + std::strtol_cv 3.02 % 2.33 % 10
|
||||
ssa::splitter + ssa::as_int_mean 289 ns 288 ns 10
|
||||
ssa::splitter + ssa::as_int_median 289 ns 286 ns 10
|
||||
ssa::splitter + ssa::as_int_stddev 7.31 ns 9.10 ns 10
|
||||
ssa::splitter + ssa::as_int_cv 2.53 % 3.16 % 10
|
||||
ssa::splitf + functor_mean 207 ns 207 ns 10
|
||||
ssa::splitf + functor_median 206 ns 209 ns 10
|
||||
ssa::splitf + functor_stddev 3.00 ns 2.70 ns 10
|
||||
ssa::splitf + functor_cv 1.45 % 1.30 % 10
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 1303 ns 1294 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 1294 ns 1290 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 44.5 ns 53.1 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 3.42 % 4.11 % 10
|
||||
replace symbols with std::string find_first_of + replace_mean 2205 ns 2204 ns 10
|
||||
replace symbols with std::string find_first_of + replace_median 2177 ns 2176 ns 10
|
||||
replace symbols with std::string find_first_of + replace_stddev 62.9 ns 68.3 ns 10
|
||||
replace symbols with std::string find_first_of + replace_cv 2.85 % 3.10 % 10
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2625 ns 2595 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_median 2598 ns 2567 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 88.9 ns 80.0 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_cv 3.39 % 3.08 % 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1555 ns 1542 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1558 ns 1535 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 33.3 ns 43.6 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 2.14 % 2.82 % 10
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1382 ns 1381 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1376 ns 1381 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 22.5 ns 29.6 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 1.63 % 2.14 % 10
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1277 ns 1268 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_median 1275 ns 1271 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 18.6 ns 21.9 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_cv 1.46 % 1.73 % 10
|
||||
replace const symbols with string expressions and memorization of all search results_mean 1266 ns 1256 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_median 1253 ns 1256 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 43.0 ns 37.2 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_cv 3.40 % 2.96 % 10
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 329 ns 328 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 328 ns 328 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 10.2 ns 9.86 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 3.12 % 3.01 % 10
|
||||
Short replace symbols with std::string find_first_of + replace_mean 429 ns 428 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_median 427 ns 424 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 7.85 ns 10.1 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.83 % 2.37 % 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 363 ns 362 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 363 ns 364 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 7.84 ns 8.87 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 2.16 % 2.45 % 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 279 ns 278 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 279 ns 276 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 5.50 ns 4.24 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.97 % 1.52 % 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 389 ns 384 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 387 ns 384 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 14.2 ns 13.0 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 3.65 % 3.39 % 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 248 ns 244 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 246 ns 246 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 10.1 ns 6.86 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 4.09 % 2.81 % 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 354 ns 352 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 349 ns 353 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 14.4 ns 12.8 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 4.07 % 3.63 % 10
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to ---- in std::string|64_mean 245 ns 243 ns 10
|
||||
replace bb to ---- in std::string|64_median 246 ns 246 ns 10
|
||||
replace bb to ---- in std::string|64_stddev 3.99 ns 5.42 ns 10
|
||||
replace bb to ---- in std::string|64_cv 1.63 % 2.23 % 10
|
||||
replace bb to ---- in std::string|256_mean 852 ns 849 ns 10
|
||||
replace bb to ---- in std::string|256_median 846 ns 846 ns 10
|
||||
replace bb to ---- in std::string|256_stddev 23.7 ns 24.7 ns 10
|
||||
replace bb to ---- in std::string|256_cv 2.78 % 2.91 % 10
|
||||
replace bb to ---- in std::string|512_mean 1534 ns 1521 ns 10
|
||||
replace bb to ---- in std::string|512_median 1522 ns 1517 ns 10
|
||||
replace bb to ---- in std::string|512_stddev 51.7 ns 59.7 ns 10
|
||||
replace bb to ---- in std::string|512_cv 3.37 % 3.93 % 10
|
||||
replace bb to ---- in std::string|1024_mean 3381 ns 3354 ns 10
|
||||
replace bb to ---- in std::string|1024_median 3379 ns 3369 ns 10
|
||||
replace bb to ---- in std::string|1024_stddev 92.1 ns 83.2 ns 10
|
||||
replace bb to ---- in std::string|1024_cv 2.72 % 2.48 % 10
|
||||
replace bb to ---- in std::string|2048_mean 8081 ns 8057 ns 10
|
||||
replace bb to ---- in std::string|2048_median 8100 ns 8022 ns 10
|
||||
replace bb to ---- in std::string|2048_stddev 97.1 ns 110 ns 10
|
||||
replace bb to ---- in std::string|2048_cv 1.20 % 1.37 % 10
|
||||
replace bb to ---- in lstringa<8>|64_mean 349 ns 346 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_median 347 ns 345 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_stddev 11.2 ns 12.2 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_cv 3.21 % 3.54 % 10
|
||||
replace bb to ---- in lstringa<8>|256_mean 702 ns 696 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_median 690 ns 684 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_stddev 29.3 ns 28.2 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_cv 4.18 % 4.06 % 10
|
||||
replace bb to ---- in lstringa<8>|512_mean 1187 ns 1183 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_median 1180 ns 1172 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_stddev 29.9 ns 42.0 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_cv 2.52 % 3.55 % 10
|
||||
replace bb to ---- in lstringa<8>|1024_mean 2087 ns 2068 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_median 2075 ns 2063 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 38.1 ns 61.2 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.82 % 2.96 % 10
|
||||
replace bb to ---- in lstringa<8>|2048_mean 4039 ns 3999 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_median 4012 ns 3990 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 145 ns 90.2 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_cv 3.58 % 2.25 % 10
|
||||
replace bb to ---- by init stringa|64_mean 230 ns 228 ns 10
|
||||
replace bb to ---- by init stringa|64_median 229 ns 225 ns 10
|
||||
replace bb to ---- by init stringa|64_stddev 7.53 ns 6.62 ns 10
|
||||
replace bb to ---- by init stringa|64_cv 3.27 % 2.90 % 10
|
||||
replace bb to ---- by init stringa|256_mean 573 ns 572 ns 10
|
||||
replace bb to ---- by init stringa|256_median 574 ns 578 ns 10
|
||||
replace bb to ---- by init stringa|256_stddev 10.1 ns 16.8 ns 10
|
||||
replace bb to ---- by init stringa|256_cv 1.77 % 2.94 % 10
|
||||
replace bb to ---- by init stringa|512_mean 1009 ns 1011 ns 10
|
||||
replace bb to ---- by init stringa|512_median 1006 ns 1004 ns 10
|
||||
replace bb to ---- by init stringa|512_stddev 13.1 ns 14.1 ns 10
|
||||
replace bb to ---- by init stringa|512_cv 1.30 % 1.40 % 10
|
||||
replace bb to ---- by init stringa|1024_mean 1988 ns 1963 ns 10
|
||||
replace bb to ---- by init stringa|1024_median 1918 ns 1925 ns 10
|
||||
replace bb to ---- by init stringa|1024_stddev 165 ns 127 ns 10
|
||||
replace bb to ---- by init stringa|1024_cv 8.31 % 6.47 % 10
|
||||
replace bb to ---- by init stringa|2048_mean 3790 ns 3775 ns 10
|
||||
replace bb to ---- by init stringa|2048_median 3702 ns 3706 ns 10
|
||||
replace bb to ---- by init stringa|2048_stddev 230 ns 184 ns 10
|
||||
replace bb to ---- by init stringa|2048_cv 6.07 % 4.87 % 10
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to -- in std::string|64_mean 218 ns 218 ns 10
|
||||
replace bb to -- in std::string|64_median 216 ns 215 ns 10
|
||||
replace bb to -- in std::string|64_stddev 8.42 ns 8.90 ns 10
|
||||
replace bb to -- in std::string|64_cv 3.85 % 4.08 % 10
|
||||
replace bb to -- in std::string|256_mean 539 ns 539 ns 10
|
||||
replace bb to -- in std::string|256_median 537 ns 537 ns 10
|
||||
replace bb to -- in std::string|256_stddev 10.6 ns 16.4 ns 10
|
||||
replace bb to -- in std::string|256_cv 1.97 % 3.04 % 10
|
||||
replace bb to -- in std::string|512_mean 979 ns 977 ns 10
|
||||
replace bb to -- in std::string|512_median 976 ns 973 ns 10
|
||||
replace bb to -- in std::string|512_stddev 20.3 ns 28.0 ns 10
|
||||
replace bb to -- in std::string|512_cv 2.07 % 2.86 % 10
|
||||
replace bb to -- in std::string|1024_mean 1885 ns 1873 ns 10
|
||||
replace bb to -- in std::string|1024_median 1840 ns 1814 ns 10
|
||||
replace bb to -- in std::string|1024_stddev 134 ns 148 ns 10
|
||||
replace bb to -- in std::string|1024_cv 7.09 % 7.91 % 10
|
||||
replace bb to -- in std::string|2048_mean 3576 ns 3560 ns 10
|
||||
replace bb to -- in std::string|2048_median 3558 ns 3530 ns 10
|
||||
replace bb to -- in std::string|2048_stddev 87.0 ns 97.1 ns 10
|
||||
replace bb to -- in std::string|2048_cv 2.43 % 2.73 % 10
|
||||
replace bb to -- in lstringa<8>|64_mean 202 ns 199 ns 10
|
||||
replace bb to -- in lstringa<8>|64_median 199 ns 201 ns 10
|
||||
replace bb to -- in lstringa<8>|64_stddev 10.2 ns 8.88 ns 10
|
||||
replace bb to -- in lstringa<8>|64_cv 5.05 % 4.47 % 10
|
||||
replace bb to -- in lstringa<8>|256_mean 470 ns 467 ns 10
|
||||
replace bb to -- in lstringa<8>|256_median 471 ns 471 ns 10
|
||||
replace bb to -- in lstringa<8>|256_stddev 11.5 ns 8.82 ns 10
|
||||
replace bb to -- in lstringa<8>|256_cv 2.45 % 1.89 % 10
|
||||
replace bb to -- in lstringa<8>|512_mean 816 ns 814 ns 10
|
||||
replace bb to -- in lstringa<8>|512_median 810 ns 802 ns 10
|
||||
replace bb to -- in lstringa<8>|512_stddev 20.9 ns 18.5 ns 10
|
||||
replace bb to -- in lstringa<8>|512_cv 2.56 % 2.27 % 10
|
||||
replace bb to -- in lstringa<8>|1024_mean 1515 ns 1504 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_median 1506 ns 1507 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_stddev 41.4 ns 43.0 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_cv 2.73 % 2.86 % 10
|
||||
replace bb to -- in lstringa<8>|2048_mean 2909 ns 2875 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_median 2897 ns 2856 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_stddev 63.6 ns 57.7 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_cv 2.19 % 2.01 % 10
|
||||
replace bb to -- by init stringa|64_mean 183 ns 181 ns 10
|
||||
replace bb to -- by init stringa|64_median 180 ns 180 ns 10
|
||||
replace bb to -- by init stringa|64_stddev 5.34 ns 5.44 ns 10
|
||||
replace bb to -- by init stringa|64_cv 2.92 % 3.00 % 10
|
||||
replace bb to -- by init stringa|256_mean 392 ns 384 ns 10
|
||||
replace bb to -- by init stringa|256_median 388 ns 381 ns 10
|
||||
replace bb to -- by init stringa|256_stddev 12.6 ns 14.8 ns 10
|
||||
replace bb to -- by init stringa|256_cv 3.21 % 3.87 % 10
|
||||
replace bb to -- by init stringa|512_mean 668 ns 657 ns 10
|
||||
replace bb to -- by init stringa|512_median 660 ns 663 ns 10
|
||||
replace bb to -- by init stringa|512_stddev 16.9 ns 14.4 ns 10
|
||||
replace bb to -- by init stringa|512_cv 2.53 % 2.18 % 10
|
||||
replace bb to -- by init stringa|1024_mean 1201 ns 1197 ns 10
|
||||
replace bb to -- by init stringa|1024_median 1201 ns 1200 ns 10
|
||||
replace bb to -- by init stringa|1024_stddev 21.6 ns 24.4 ns 10
|
||||
replace bb to -- by init stringa|1024_cv 1.80 % 2.04 % 10
|
||||
replace bb to -- by init stringa|2048_mean 2295 ns 2285 ns 10
|
||||
replace bb to -- by init stringa|2048_median 2275 ns 2295 ns 10
|
||||
replace bb to -- by init stringa|2048_stddev 50.8 ns 55.4 ns 10
|
||||
replace bb to -- by init stringa|2048_cv 2.21 % 2.43 % 10
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 4237335 ns 4230925 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 4253455 ns 4261364 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 162581 ns 151627 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 3.84 % 3.58 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 5468019 ns 5343750 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 5365539 ns 5312500 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 272590 ns 98821 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 4.99 % 1.85 % 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 3990921 ns 3919344 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 3971040 ns 3928073 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 113397 ns 145193 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 2.84 % 3.70 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 6304651 ns 6305804 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 6263162 ns 6277902 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 161063 ns 171495 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 2.55 % 2.72 % 10
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Build func full name std::string;_mean 1660 ns 1638 ns 10
|
||||
Build func full name std::string;_median 1637 ns 1650 ns 10
|
||||
Build func full name std::string;_stddev 56.0 ns 25.9 ns 10
|
||||
Build func full name std::string;_cv 3.37 % 1.58 % 10
|
||||
Build func full name std::string 1;_mean 1747 ns 1737 ns 10
|
||||
Build func full name std::string 1;_median 1738 ns 1709 ns 10
|
||||
Build func full name std::string 1;_stddev 50.9 ns 51.5 ns 10
|
||||
Build func full name std::string 1;_cv 2.91 % 2.96 % 10
|
||||
Build func full name std::stream;_mean 9942 ns 9647 ns 10
|
||||
Build func full name std::stream;_median 9768 ns 9626 ns 10
|
||||
Build func full name std::stream;_stddev 436 ns 287 ns 10
|
||||
Build func full name std::stream;_cv 4.38 % 2.97 % 10
|
||||
Build func full name stringa;_mean 891 ns 872 ns 10
|
||||
Build func full name stringa;_median 879 ns 872 ns 10
|
||||
Build func full name stringa;_stddev 31.8 ns 16.4 ns 10
|
||||
Build func full name stringa;_cv 3.57 % 1.89 % 10
|
||||
Build func full name stringa 1;_mean 1007 ns 1001 ns 10
|
||||
Build func full name stringa 1;_median 998 ns 1001 ns 10
|
||||
Build func full name stringa 1;_stddev 33.0 ns 25.7 ns 10
|
||||
Build func full name stringa 1;_cv 3.28 % 2.57 % 10
|
||||
|
|
@ -1,783 +0,0 @@
|
|||
Run on (32 X 2513.96 MHz CPU s)
|
||||
Chrome 136.0.7103.114 webasm
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e;_mean 3.47 ns 3.47 ns 10
|
||||
std::string e;_median 3.46 ns 3.46 ns 10
|
||||
std::string e;_stddev 0.077 ns 0.077 ns 10
|
||||
std::string e;_cv 2.22 % 2.22 % 10
|
||||
std::string_view e;_mean 3.68 ns 3.68 ns 10
|
||||
std::string_view e;_median 3.68 ns 3.68 ns 10
|
||||
std::string_view e;_stddev 0.025 ns 0.025 ns 10
|
||||
std::string_view e;_cv 0.67 % 0.67 % 10
|
||||
ssa e;_mean 2.14 ns 2.14 ns 10
|
||||
ssa e;_median 2.14 ns 2.14 ns 10
|
||||
ssa e;_stddev 0.022 ns 0.022 ns 10
|
||||
ssa e;_cv 1.01 % 1.01 % 10
|
||||
stringa e;_mean 3.66 ns 3.66 ns 10
|
||||
stringa e;_median 3.66 ns 3.66 ns 10
|
||||
stringa e;_stddev 0.070 ns 0.070 ns 10
|
||||
stringa e;_cv 1.91 % 1.91 % 10
|
||||
lstringa<20> e;_mean 3.10 ns 3.10 ns 10
|
||||
lstringa<20> e;_median 3.05 ns 3.05 ns 10
|
||||
lstringa<20> e;_stddev 0.112 ns 0.112 ns 10
|
||||
lstringa<20> e;_cv 3.63 % 3.63 % 10
|
||||
lstringa<40> e;_mean 3.10 ns 3.10 ns 10
|
||||
lstringa<40> e;_median 3.10 ns 3.10 ns 10
|
||||
lstringa<40> e;_stddev 0.080 ns 0.080 ns 10
|
||||
lstringa<40> e;_cv 2.56 % 2.56 % 10
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text";_mean 4.95 ns 4.95 ns 10
|
||||
std::string e = "Test text";_median 4.93 ns 4.93 ns 10
|
||||
std::string e = "Test text";_stddev 0.074 ns 0.074 ns 10
|
||||
std::string e = "Test text";_cv 1.50 % 1.50 % 10
|
||||
std::string_view e = "Test text";_mean 2.22 ns 2.22 ns 10
|
||||
std::string_view e = "Test text";_median 2.22 ns 2.22 ns 10
|
||||
std::string_view e = "Test text";_stddev 0.024 ns 0.024 ns 10
|
||||
std::string_view e = "Test text";_cv 1.10 % 1.10 % 10
|
||||
ssa e = "Test text";_mean 2.18 ns 2.18 ns 10
|
||||
ssa e = "Test text";_median 2.18 ns 2.18 ns 10
|
||||
ssa e = "Test text";_stddev 0.021 ns 0.021 ns 10
|
||||
ssa e = "Test text";_cv 0.99 % 0.99 % 10
|
||||
stringa e = "Test text";_mean 4.69 ns 4.69 ns 10
|
||||
stringa e = "Test text";_median 4.67 ns 4.67 ns 10
|
||||
stringa e = "Test text";_stddev 0.087 ns 0.087 ns 10
|
||||
stringa e = "Test text";_cv 1.85 % 1.85 % 10
|
||||
lstringa<20> e = "Test text";_mean 6.54 ns 6.54 ns 10
|
||||
lstringa<20> e = "Test text";_median 6.54 ns 6.54 ns 10
|
||||
lstringa<20> e = "Test text";_stddev 0.109 ns 0.109 ns 10
|
||||
lstringa<20> e = "Test text";_cv 1.67 % 1.67 % 10
|
||||
lstringa<40> e = "Test text";_mean 4.02 ns 4.02 ns 10
|
||||
lstringa<40> e = "Test text";_median 4.01 ns 4.01 ns 10
|
||||
lstringa<40> e = "Test text";_stddev 0.090 ns 0.090 ns 10
|
||||
lstringa<40> e = "Test text";_cv 2.24 % 2.24 % 10
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 56.3 ns 56.3 ns 10
|
||||
std::string e = "123456789012345678901234567890";_median 55.8 ns 55.8 ns 10
|
||||
std::string e = "123456789012345678901234567890";_stddev 2.07 ns 2.07 ns 10
|
||||
std::string e = "123456789012345678901234567890";_cv 3.67 % 3.67 % 10
|
||||
std::string_view e = "123456789012345678901234567890";_mean 5.05 ns 5.05 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_median 5.06 ns 5.06 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.026 ns 0.026 ns 10
|
||||
std::string_view e = "123456789012345678901234567890";_cv 0.52 % 0.52 % 10
|
||||
ssa e = "123456789012345678901234567890";_mean 2.18 ns 2.18 ns 10
|
||||
ssa e = "123456789012345678901234567890";_median 2.17 ns 2.17 ns 10
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.031 ns 0.031 ns 10
|
||||
ssa e = "123456789012345678901234567890";_cv 1.40 % 1.40 % 10
|
||||
stringa e = "123456789012345678901234567890";_mean 5.33 ns 5.33 ns 10
|
||||
stringa e = "123456789012345678901234567890";_median 5.32 ns 5.32 ns 10
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.033 ns 0.033 ns 10
|
||||
stringa e = "123456789012345678901234567890";_cv 0.63 % 0.63 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 59.7 ns 59.7 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 59.2 ns 59.2 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 1.30 ns 1.30 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 2.18 % 2.18 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 6.28 ns 6.28 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 6.20 ns 6.20 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.202 ns 0.202 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 3.21 % 3.21 % 10
|
||||
----- Create copy of Str with 9 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "Test text"; auto c{e};_mean 5.67 ns 5.67 ns 10
|
||||
std::string e = "Test text"; auto c{e};_median 5.66 ns 5.66 ns 10
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.127 ns 0.127 ns 10
|
||||
std::string e = "Test text"; auto c{e};_cv 2.24 % 2.24 % 10
|
||||
std::string_view e = "Test text"; auto c{e};_mean 5.04 ns 5.04 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_median 5.03 ns 5.03 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.009 ns 0.009 ns 10
|
||||
std::string_view e = "Test text"; auto c{e};_cv 0.18 % 0.18 % 10
|
||||
ssa e = "Test text"; auto c{e};_mean 5.02 ns 5.02 ns 10
|
||||
ssa e = "Test text"; auto c{e};_median 5.02 ns 5.02 ns 10
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.015 ns 0.015 ns 10
|
||||
ssa e = "Test text"; auto c{e};_cv 0.31 % 0.31 % 10
|
||||
stringa e = "Test text"; auto c{e};_mean 4.81 ns 4.81 ns 10
|
||||
stringa e = "Test text"; auto c{e};_median 4.80 ns 4.80 ns 10
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.075 ns 0.075 ns 10
|
||||
stringa e = "Test text"; auto c{e};_cv 1.55 % 1.55 % 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 15.8 ns 15.8 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 15.5 ns 15.5 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.819 ns 0.819 ns 10
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 5.19 % 5.19 % 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 15.7 ns 15.7 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 15.7 ns 15.7 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.536 ns 0.536 ns 10
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 3.41 % 3.41 % 10
|
||||
----- Create copy of Str with 30 symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_mean 116 ns 116 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 113 ns 113 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 5.88 ns 5.88 ns 10
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 5.06 % 5.06 % 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 5.04 ns 5.04 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 5.03 ns 5.03 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.038 ns 0.038 ns 10
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 0.75 % 0.75 % 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 2.20 ns 2.20 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 2.19 ns 2.19 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.038 ns 0.038 ns 10
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.73 % 1.73 % 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 5.36 ns 5.36 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 5.36 ns 5.36 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.068 ns 0.068 ns 10
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.28 % 1.28 % 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 67.1 ns 67.1 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 67.0 ns 67.0 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 1.65 ns 1.65 ns 10
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 2.46 % 2.46 % 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 15.5 ns 15.5 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 15.5 ns 15.5 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.607 ns 0.607 ns 10
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 3.90 % 3.90 % 10
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find;_mean 141 ns 141 ns 10
|
||||
std::string::find;_median 138 ns 138 ns 10
|
||||
std::string::find;_stddev 7.07 ns 7.07 ns 10
|
||||
std::string::find;_cv 5.00 % 5.00 % 10
|
||||
std::string_view::find;_mean 134 ns 134 ns 10
|
||||
std::string_view::find;_median 133 ns 133 ns 10
|
||||
std::string_view::find;_stddev 4.94 ns 4.94 ns 10
|
||||
std::string_view::find;_cv 3.68 % 3.68 % 10
|
||||
ssa::find;_mean 101 ns 101 ns 10
|
||||
ssa::find;_median 102 ns 102 ns 10
|
||||
ssa::find;_stddev 4.82 ns 4.82 ns 10
|
||||
ssa::find;_cv 4.75 % 4.75 % 10
|
||||
stringa::find;_mean 102 ns 102 ns 10
|
||||
stringa::find;_median 101 ns 101 ns 10
|
||||
stringa::find;_stddev 2.09 ns 2.09 ns 10
|
||||
stringa::find;_cv 2.06 % 2.06 % 10
|
||||
lstringa<20>::find;_mean 100 ns 100 ns 10
|
||||
lstringa<20>::find;_median 100 ns 100 ns 10
|
||||
lstringa<20>::find;_stddev 2.47 ns 2.47 ns 10
|
||||
lstringa<20>::find;_cv 2.46 % 2.46 % 10
|
||||
lstringa<40>::find;_mean 102 ns 102 ns 10
|
||||
lstringa<40>::find;_median 102 ns 102 ns 10
|
||||
lstringa<40>::find;_stddev 2.47 ns 2.47 ns 10
|
||||
lstringa<40>::find;_cv 2.42 % 2.42 % 10
|
||||
------- Copy not literal Str with N symbols ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string copy{str_with_len_N};/15_mean 117 ns 117 ns 10
|
||||
std::string copy{str_with_len_N};/15_median 118 ns 118 ns 10
|
||||
std::string copy{str_with_len_N};/15_stddev 2.87 ns 2.87 ns 10
|
||||
std::string copy{str_with_len_N};/15_cv 2.45 % 2.45 % 10
|
||||
std::string copy{str_with_len_N};/16_mean 120 ns 120 ns 10
|
||||
std::string copy{str_with_len_N};/16_median 119 ns 119 ns 10
|
||||
std::string copy{str_with_len_N};/16_stddev 4.25 ns 4.25 ns 10
|
||||
std::string copy{str_with_len_N};/16_cv 3.54 % 3.54 % 10
|
||||
std::string copy{str_with_len_N};/23_mean 119 ns 119 ns 10
|
||||
std::string copy{str_with_len_N};/23_median 119 ns 119 ns 10
|
||||
std::string copy{str_with_len_N};/23_stddev 4.81 ns 4.81 ns 10
|
||||
std::string copy{str_with_len_N};/23_cv 4.03 % 4.03 % 10
|
||||
std::string copy{str_with_len_N};/24_mean 120 ns 120 ns 10
|
||||
std::string copy{str_with_len_N};/24_median 117 ns 117 ns 10
|
||||
std::string copy{str_with_len_N};/24_stddev 6.96 ns 6.96 ns 10
|
||||
std::string copy{str_with_len_N};/24_cv 5.78 % 5.78 % 10
|
||||
std::string copy{str_with_len_N};/32_mean 124 ns 124 ns 10
|
||||
std::string copy{str_with_len_N};/32_median 125 ns 125 ns 10
|
||||
std::string copy{str_with_len_N};/32_stddev 4.17 ns 4.17 ns 10
|
||||
std::string copy{str_with_len_N};/32_cv 3.37 % 3.37 % 10
|
||||
std::string copy{str_with_len_N};/64_mean 125 ns 125 ns 10
|
||||
std::string copy{str_with_len_N};/64_median 125 ns 125 ns 10
|
||||
std::string copy{str_with_len_N};/64_stddev 5.21 ns 5.21 ns 10
|
||||
std::string copy{str_with_len_N};/64_cv 4.16 % 4.16 % 10
|
||||
std::string copy{str_with_len_N};/128_mean 122 ns 122 ns 10
|
||||
std::string copy{str_with_len_N};/128_median 121 ns 121 ns 10
|
||||
std::string copy{str_with_len_N};/128_stddev 5.21 ns 5.21 ns 10
|
||||
std::string copy{str_with_len_N};/128_cv 4.27 % 4.27 % 10
|
||||
std::string copy{str_with_len_N};/256_mean 146 ns 146 ns 10
|
||||
std::string copy{str_with_len_N};/256_median 152 ns 152 ns 10
|
||||
std::string copy{str_with_len_N};/256_stddev 17.4 ns 17.4 ns 10
|
||||
std::string copy{str_with_len_N};/256_cv 11.94 % 11.94 % 10
|
||||
std::string copy{str_with_len_N};/512_mean 163 ns 163 ns 10
|
||||
std::string copy{str_with_len_N};/512_median 168 ns 168 ns 10
|
||||
std::string copy{str_with_len_N};/512_stddev 37.9 ns 37.9 ns 10
|
||||
std::string copy{str_with_len_N};/512_cv 23.21 % 23.21 % 10
|
||||
std::string copy{str_with_len_N};/1024_mean 148 ns 148 ns 10
|
||||
std::string copy{str_with_len_N};/1024_median 142 ns 142 ns 10
|
||||
std::string copy{str_with_len_N};/1024_stddev 23.5 ns 23.5 ns 10
|
||||
std::string copy{str_with_len_N};/1024_cv 15.86 % 15.86 % 10
|
||||
std::string copy{str_with_len_N};/2048_mean 165 ns 165 ns 10
|
||||
std::string copy{str_with_len_N};/2048_median 165 ns 165 ns 10
|
||||
std::string copy{str_with_len_N};/2048_stddev 8.09 ns 8.09 ns 10
|
||||
std::string copy{str_with_len_N};/2048_cv 4.92 % 4.92 % 10
|
||||
std::string copy{str_with_len_N};/4096_mean 204 ns 204 ns 10
|
||||
std::string copy{str_with_len_N};/4096_median 203 ns 203 ns 10
|
||||
std::string copy{str_with_len_N};/4096_stddev 9.70 ns 9.70 ns 10
|
||||
std::string copy{str_with_len_N};/4096_cv 4.76 % 4.76 % 10
|
||||
stringa copy{str_with_len_N};/15_mean 4.84 ns 4.84 ns 10
|
||||
stringa copy{str_with_len_N};/15_median 4.80 ns 4.80 ns 10
|
||||
stringa copy{str_with_len_N};/15_stddev 0.112 ns 0.112 ns 10
|
||||
stringa copy{str_with_len_N};/15_cv 2.31 % 2.31 % 10
|
||||
stringa copy{str_with_len_N};/16_mean 10.3 ns 10.3 ns 10
|
||||
stringa copy{str_with_len_N};/16_median 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/16_stddev 0.343 ns 0.343 ns 10
|
||||
stringa copy{str_with_len_N};/16_cv 3.35 % 3.35 % 10
|
||||
stringa copy{str_with_len_N};/23_mean 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/23_median 10.2 ns 10.2 ns 10
|
||||
stringa copy{str_with_len_N};/23_stddev 0.210 ns 0.210 ns 10
|
||||
stringa copy{str_with_len_N};/23_cv 2.07 % 2.07 % 10
|
||||
stringa copy{str_with_len_N};/24_mean 10.2 ns 10.2 ns 10
|
||||
stringa copy{str_with_len_N};/24_median 10.2 ns 10.2 ns 10
|
||||
stringa copy{str_with_len_N};/24_stddev 0.244 ns 0.244 ns 10
|
||||
stringa copy{str_with_len_N};/24_cv 2.40 % 2.40 % 10
|
||||
stringa copy{str_with_len_N};/32_mean 10.2 ns 10.2 ns 10
|
||||
stringa copy{str_with_len_N};/32_median 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/32_stddev 0.203 ns 0.204 ns 10
|
||||
stringa copy{str_with_len_N};/32_cv 2.00 % 2.00 % 10
|
||||
stringa copy{str_with_len_N};/64_mean 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/64_median 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/64_stddev 0.134 ns 0.134 ns 10
|
||||
stringa copy{str_with_len_N};/64_cv 1.34 % 1.34 % 10
|
||||
stringa copy{str_with_len_N};/128_mean 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/128_median 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/128_stddev 0.171 ns 0.171 ns 10
|
||||
stringa copy{str_with_len_N};/128_cv 1.70 % 1.71 % 10
|
||||
stringa copy{str_with_len_N};/256_mean 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/256_median 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/256_stddev 0.138 ns 0.138 ns 10
|
||||
stringa copy{str_with_len_N};/256_cv 1.37 % 1.37 % 10
|
||||
stringa copy{str_with_len_N};/512_mean 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/512_median 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/512_stddev 0.187 ns 0.187 ns 10
|
||||
stringa copy{str_with_len_N};/512_cv 1.85 % 1.85 % 10
|
||||
stringa copy{str_with_len_N};/1024_mean 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/1024_median 9.97 ns 9.97 ns 10
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.168 ns 0.168 ns 10
|
||||
stringa copy{str_with_len_N};/1024_cv 1.68 % 1.68 % 10
|
||||
stringa copy{str_with_len_N};/2048_mean 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/2048_median 10.0 ns 10.0 ns 10
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.121 ns 0.121 ns 10
|
||||
stringa copy{str_with_len_N};/2048_cv 1.21 % 1.21 % 10
|
||||
stringa copy{str_with_len_N};/4096_mean 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/4096_median 10.1 ns 10.1 ns 10
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.091 ns 0.091 ns 10
|
||||
stringa copy{str_with_len_N};/4096_cv 0.90 % 0.90 % 10
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 15.7 ns 15.7 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_median 15.8 ns 15.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.435 ns 0.435 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 2.78 % 2.78 % 10
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 16.1 ns 16.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_median 16.1 ns 16.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.768 ns 0.768 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 4.76 % 4.76 % 10
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 75.4 ns 75.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_median 75.3 ns 75.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 3.08 ns 3.08 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 4.08 % 4.08 % 10
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 76.2 ns 76.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_median 75.6 ns 75.6 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 4.31 ns 4.31 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 5.66 % 5.66 % 10
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 82.1 ns 82.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_median 82.8 ns 82.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 5.50 ns 5.50 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 6.70 % 6.70 % 10
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 78.1 ns 78.1 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_median 78.0 ns 78.0 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 2.56 ns 2.56 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 3.27 % 3.27 % 10
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 79.2 ns 79.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_median 77.8 ns 77.8 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 3.51 ns 3.51 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 4.44 % 4.44 % 10
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 103 ns 103 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_median 110 ns 110 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 16.2 ns 16.2 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 15.73 % 15.73 % 10
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 121 ns 121 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_median 120 ns 120 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 39.3 ns 39.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 32.53 % 32.53 % 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 107 ns 107 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 103 ns 103 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 25.3 ns 25.3 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 23.61 % 23.61 % 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 123 ns 123 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 122 ns 122 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 7.32 ns 7.32 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 5.96 % 5.96 % 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 160 ns 160 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 161 ns 161 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 13.4 ns 13.4 ns 10
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 8.38 % 8.38 % 10
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 15.3 ns 15.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_median 15.2 ns 15.2 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.277 ns 0.277 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 1.82 % 1.82 % 10
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 15.1 ns 15.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_median 15.2 ns 15.2 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.358 ns 0.358 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 2.37 % 2.37 % 10
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 15.6 ns 15.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_median 15.6 ns 15.6 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.607 ns 0.607 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 3.89 % 3.89 % 10
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 15.3 ns 15.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_median 15.3 ns 15.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.619 ns 0.619 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 4.05 % 4.05 % 10
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 17.2 ns 17.2 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_median 17.1 ns 17.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.672 ns 0.672 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 3.90 % 3.90 % 10
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 18.3 ns 18.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_median 18.1 ns 18.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.938 ns 0.938 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 5.14 % 5.14 % 10
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 19.1 ns 19.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_median 19.1 ns 19.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.733 ns 0.733 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 3.84 % 3.84 % 10
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 32.3 ns 32.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_median 32.3 ns 32.3 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.534 ns 0.534 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.65 % 1.65 % 10
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 33.8 ns 33.8 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_median 33.7 ns 33.7 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.661 ns 0.661 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 1.95 % 1.95 % 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 106 ns 106 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 101 ns 101 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 26.1 ns 26.1 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 24.65 % 24.65 % 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 119 ns 119 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 119 ns 119 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 6.93 ns 6.93 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 5.81 % 5.81 % 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 162 ns 162 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 163 ns 163 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 10.0 ns 10.0 ns 10
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 6.19 % 6.19 % 10
|
||||
----- Convert to int '1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_mean 205 ns 205 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 206 ns 206 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 6.93 ns 6.93 ns 10
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 3.39 % 3.39 % 10
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10); ERROR OCCURRED: 'not implemented'
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 55.2 ns 55.2 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 54.5 ns 54.5 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.79 ns 1.79 ns 10
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 3.25 % 3.25 % 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 51.0 ns 51.0 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 51.1 ns 51.1 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.67 ns 1.67 ns 10
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 3.27 % 3.27 % 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 52.1 ns 52.1 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 51.3 ns 51.3 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 1.94 ns 1.94 ns 10
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 3.73 % 3.73 % 10
|
||||
----- Convert to unsigned 'abcDef' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_mean 149 ns 149 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 149 ns 149 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 3.19 ns 3.19 ns 10
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 2.14 % 2.14 % 10
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16); ERROR OCCURRED: 'not implemented'
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 51.8 ns 51.8 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 51.5 ns 51.5 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.900 ns 0.900 ns 10
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.74 % 1.74 % 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 50.0 ns 50.0 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 50.1 ns 50.1 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.773 ns 0.773 ns 10
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.55 % 1.55 % 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 51.4 ns 51.4 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 50.8 ns 50.8 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 1.46 ns 1.46 ns 10
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 2.84 % 2.84 % 10
|
||||
----- Convert to int ' 1234567' ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_mean 216 ns 216 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 215 ns 215 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 9.26 ns 9.26 ns 10
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 4.28 % 4.28 % 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 74.8 ns 74.8 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 75.4 ns 75.4 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 2.69 ns 2.69 ns 10
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 3.60 % 3.60 % 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 51.3 ns 51.3 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 51.3 ns 51.3 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.921 ns 0.921 ns 10
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 1.79 % 1.79 % 10
|
||||
-- Append const literal of 16 bytes 64 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_mean 11603 ns 11603 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 11482 ns 11482 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 292 ns 292 ns 10
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 2.51 % 2.51 % 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1138 ns 1138 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1122 ns 1122 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 58.6 ns 58.6 ns 10
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 5.15 % 5.15 % 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 1204 ns 1204 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 1191 ns 1191 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 54.3 ns 54.3 ns 10
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 4.51 % 4.51 % 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 873 ns 873 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 871 ns 871 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 60.7 ns 60.7 ns 10
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 6.95 % 6.95 % 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 640 ns 640 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 638 ns 638 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 38.9 ns 38.9 ns 10
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 6.08 % 6.08 % 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 498 ns 498 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 497 ns 497 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 9.13 ns 9.13 ns 10
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 1.83 % 1.83 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_mean 11698 ns 11698 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 11738 ns 11738 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 210 ns 210 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 1.80 % 1.80 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 4015 ns 4015 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 4012 ns 4012 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 170 ns 170 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 4.23 % 4.23 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 1435 ns 1435 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 1436 ns 1436 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 35.8 ns 35.8 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.49 % 2.49 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 1128 ns 1128 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 1147 ns 1147 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 69.6 ns 69.6 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 6.17 % 6.17 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 858 ns 858 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 846 ns 846 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 40.9 ns 40.9 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 4.76 % 4.76 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 730 ns 730 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 724 ns 724 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 22.2 ns 22.2 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 3.03 % 3.03 % 10
|
||||
-- Append string of 16 bytes and const literal of 16 bytes 2048 times, 65536 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_mean 581542 ns 581546 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 576314 ns 576319 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 14331 ns 14332 ns 10
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 2.46 % 2.46 % 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 207680 ns 207682 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 209032 ns 209032 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 7880 ns 7881 ns 10
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.79 % 3.79 % 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 52577 ns 52578 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 51856 ns 51856 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1859 ns 1859 ns 10
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 3.53 % 3.53 % 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 49889 ns 49889 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 49640 ns 49640 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 922 ns 922 ns 10
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.85 % 1.85 % 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 50097 ns 50097 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 50166 ns 50166 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 997 ns 997 ns 10
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.99 % 1.99 % 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 49930 ns 49930 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 49358 ns 49359 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 1206 ns 1206 ns 10
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.42 % 2.42 % 10
|
||||
-- Append 2 string of 16 bytes 32 times, 1024 total length --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_mean 11739 ns 11739 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 11709 ns 11709 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 342 ns 342 ns 10
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.91 % 2.91 % 10
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 4587 ns 4587 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_median 4642 ns 4642 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 172 ns 172 ns 10
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 3.75 % 3.75 % 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 1593 ns 1593 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 1590 ns 1590 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 43.9 ns 43.9 ns 10
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 2.75 % 2.75 % 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 1343 ns 1343 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 1326 ns 1326 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 62.5 ns 62.5 ns 10
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 4.65 % 4.65 % 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 1057 ns 1057 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 1058 ns 1058 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 38.9 ns 38.9 ns 10
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 3.68 % 3.68 % 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 929 ns 929 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 925 ns 925 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 22.0 ns 21.9 ns 10
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 2.36 % 2.36 % 10
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 19990 ns 19990 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_median 19963 ns 19963 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 939 ns 939 ns 10
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 4.70 % 4.70 % 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 3781 ns 3781 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 3755 ns 3755 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 158 ns 158 ns 10
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 4.19 % 4.19 % 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 8018 ns 8018 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 7947 ns 7947 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 213 ns 213 ns 10
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 2.66 % 2.66 % 10
|
||||
std::string str = std::format("test = {} times", k);_mean 5058 ns 5058 ns 10
|
||||
std::string str = std::format("test = {} times", k);_median 5013 ns 5013 ns 10
|
||||
std::string str = std::format("test = {} times", k);_stddev 252 ns 252 ns 10
|
||||
std::string str = std::format("test = {} times", k);_cv 4.98 % 4.98 % 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 7141 ns 7141 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 7164 ns 7164 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 186 ns 186 ns 10
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 2.60 % 2.60 % 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 5041 ns 5041 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 4992 ns 4992 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 144 ns 144 ns 10
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 2.86 % 2.86 % 10
|
||||
lstringa<8> str = "test = " + k + " times";_mean 1865 ns 1865 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_median 1834 ns 1834 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 81.0 ns 81.1 ns 10
|
||||
lstringa<8> str = "test = " + k + " times";_cv 4.35 % 4.35 % 10
|
||||
lstringa<32> str = "test = " + k + " times";_mean 1202 ns 1202 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_median 1208 ns 1208 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 33.4 ns 33.4 ns 10
|
||||
lstringa<32> str = "test = " + k + " times";_cv 2.78 % 2.78 % 10
|
||||
stringa str = "test = " + k + " times";_mean 1715 ns 1715 ns 10
|
||||
stringa str = "test = " + k + " times";_median 1691 ns 1691 ns 10
|
||||
stringa str = "test = " + k + " times";_stddev 87.3 ns 87.3 ns 10
|
||||
stringa str = "test = " + k + " times";_cv 5.09 % 5.09 % 10
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
std::string::find + substr + std::strtol_mean 1618 ns 1618 ns 10
|
||||
std::string::find + substr + std::strtol_median 1612 ns 1612 ns 10
|
||||
std::string::find + substr + std::strtol_stddev 62.7 ns 62.7 ns 10
|
||||
std::string::find + substr + std::strtol_cv 3.87 % 3.87 % 10
|
||||
ssa::splitter + ssa::as_int_mean 655 ns 655 ns 10
|
||||
ssa::splitter + ssa::as_int_median 657 ns 657 ns 10
|
||||
ssa::splitter + ssa::as_int_stddev 18.0 ns 18.0 ns 10
|
||||
ssa::splitter + ssa::as_int_cv 2.75 % 2.75 % 10
|
||||
ssa::splitf + functor_mean 899 ns 899 ns 10
|
||||
ssa::splitf + functor_median 894 ns 894 ns 10
|
||||
ssa::splitf + functor_stddev 33.7 ns 33.7 ns 10
|
||||
ssa::splitf + functor_cv 3.75 % 3.75 % 10
|
||||
-- Replace symbols in text ~400 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Naive (and wrong) replace symbols with std::string find + replace_mean 6193 ns 6193 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 6168 ns 6168 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 264 ns 264 ns 10
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 4.26 % 4.26 % 10
|
||||
replace symbols with std::string find_first_of + replace_mean 9978 ns 9978 ns 10
|
||||
replace symbols with std::string find_first_of + replace_median 9940 ns 9940 ns 10
|
||||
replace symbols with std::string find_first_of + replace_stddev 147 ns 147 ns 10
|
||||
replace symbols with std::string find_first_of + replace_cv 1.48 % 1.48 % 10
|
||||
replace symbols with std::string_view find_first_of + copy_mean 10198 ns 10198 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_median 10229 ns 10229 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 361 ns 361 ns 10
|
||||
replace symbols with std::string_view find_first_of + copy_cv 3.54 % 3.54 % 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 5706 ns 5706 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 5705 ns 5705 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 208 ns 208 ns 10
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 3.65 % 3.65 % 10
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 5029 ns 5029 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_median 5010 ns 5010 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 172 ns 172 ns 10
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 3.41 % 3.41 % 10
|
||||
replace const symbols with string expressions and without remembering all search results_mean 4946 ns 4946 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_median 4876 ns 4876 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 239 ns 239 ns 10
|
||||
replace const symbols with string expressions and without remembering all search results_cv 4.84 % 4.84 % 10
|
||||
replace const symbols with string expressions and memorization of all search results_mean 4198 ns 4198 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_median 4225 ns 4225 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 117 ns 117 ns 10
|
||||
replace const symbols with string expressions and memorization of all search results_cv 2.78 % 2.78 % 10
|
||||
-- Replace symbols in text ~40 symbols --/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_mean 1016 ns 1016 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 1026 ns 1026 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 47.9 ns 47.9 ns 10
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 4.71 % 4.71 % 10
|
||||
Short replace symbols with std::string find_first_of + replace_mean 1431 ns 1431 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_median 1441 ns 1441 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 65.0 ns 65.0 ns 10
|
||||
Short replace symbols with std::string find_first_of + replace_cv 4.54 % 4.54 % 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 1417 ns 1417 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 1410 ns 1410 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 50.9 ns 50.9 ns 10
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 3.59 % 3.59 % 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 795 ns 795 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 800 ns 800 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 30.4 ns 30.5 ns 10
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 3.83 % 3.83 % 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 847 ns 847 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 844 ns 844 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 15.6 ns 15.6 ns 10
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 1.84 % 1.84 % 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 626 ns 626 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 624 ns 624 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 22.5 ns 22.5 ns 10
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 3.60 % 3.60 % 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 706 ns 706 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 696 ns 696 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 33.5 ns 33.5 ns 10
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 4.75 % 4.75 % 10
|
||||
----- Replace All Str To Longer Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to ---- in std::string|64_mean 832 ns 832 ns 10
|
||||
replace bb to ---- in std::string|64_median 840 ns 840 ns 10
|
||||
replace bb to ---- in std::string|64_stddev 48.0 ns 48.0 ns 10
|
||||
replace bb to ---- in std::string|64_cv 5.77 % 5.77 % 10
|
||||
replace bb to ---- in std::string|256_mean 2559 ns 2559 ns 10
|
||||
replace bb to ---- in std::string|256_median 2526 ns 2526 ns 10
|
||||
replace bb to ---- in std::string|256_stddev 150 ns 150 ns 10
|
||||
replace bb to ---- in std::string|256_cv 5.88 % 5.88 % 10
|
||||
replace bb to ---- in std::string|512_mean 4466 ns 4466 ns 10
|
||||
replace bb to ---- in std::string|512_median 4489 ns 4489 ns 10
|
||||
replace bb to ---- in std::string|512_stddev 88.8 ns 88.8 ns 10
|
||||
replace bb to ---- in std::string|512_cv 1.99 % 1.99 % 10
|
||||
replace bb to ---- in std::string|1024_mean 8916 ns 8916 ns 10
|
||||
replace bb to ---- in std::string|1024_median 8819 ns 8819 ns 10
|
||||
replace bb to ---- in std::string|1024_stddev 415 ns 415 ns 10
|
||||
replace bb to ---- in std::string|1024_cv 4.65 % 4.65 % 10
|
||||
replace bb to ---- in std::string|2048_mean 19324 ns 19324 ns 10
|
||||
replace bb to ---- in std::string|2048_median 19249 ns 19249 ns 10
|
||||
replace bb to ---- in std::string|2048_stddev 511 ns 511 ns 10
|
||||
replace bb to ---- in std::string|2048_cv 2.65 % 2.65 % 10
|
||||
replace bb to ---- in lstringa<8>|64_mean 749 ns 749 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_median 752 ns 752 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_stddev 17.0 ns 17.0 ns 10
|
||||
replace bb to ---- in lstringa<8>|64_cv 2.28 % 2.28 % 10
|
||||
replace bb to ---- in lstringa<8>|256_mean 2053 ns 2053 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_median 2088 ns 2088 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_stddev 98.5 ns 98.5 ns 10
|
||||
replace bb to ---- in lstringa<8>|256_cv 4.80 % 4.80 % 10
|
||||
replace bb to ---- in lstringa<8>|512_mean 3754 ns 3754 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_median 3695 ns 3695 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_stddev 162 ns 162 ns 10
|
||||
replace bb to ---- in lstringa<8>|512_cv 4.32 % 4.32 % 10
|
||||
replace bb to ---- in lstringa<8>|1024_mean 6775 ns 6775 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_median 6776 ns 6776 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 196 ns 196 ns 10
|
||||
replace bb to ---- in lstringa<8>|1024_cv 2.89 % 2.89 % 10
|
||||
replace bb to ---- in lstringa<8>|2048_mean 13478 ns 13478 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_median 13420 ns 13421 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 436 ns 436 ns 10
|
||||
replace bb to ---- in lstringa<8>|2048_cv 3.24 % 3.24 % 10
|
||||
replace bb to ---- by init stringa|64_mean 503 ns 503 ns 10
|
||||
replace bb to ---- by init stringa|64_median 504 ns 504 ns 10
|
||||
replace bb to ---- by init stringa|64_stddev 19.5 ns 19.5 ns 10
|
||||
replace bb to ---- by init stringa|64_cv 3.86 % 3.86 % 10
|
||||
replace bb to ---- by init stringa|256_mean 1848 ns 1848 ns 10
|
||||
replace bb to ---- by init stringa|256_median 1828 ns 1828 ns 10
|
||||
replace bb to ---- by init stringa|256_stddev 80.6 ns 80.6 ns 10
|
||||
replace bb to ---- by init stringa|256_cv 4.36 % 4.36 % 10
|
||||
replace bb to ---- by init stringa|512_mean 3537 ns 3537 ns 10
|
||||
replace bb to ---- by init stringa|512_median 3552 ns 3552 ns 10
|
||||
replace bb to ---- by init stringa|512_stddev 85.6 ns 85.6 ns 10
|
||||
replace bb to ---- by init stringa|512_cv 2.42 % 2.42 % 10
|
||||
replace bb to ---- by init stringa|1024_mean 6923 ns 6923 ns 10
|
||||
replace bb to ---- by init stringa|1024_median 6991 ns 6991 ns 10
|
||||
replace bb to ---- by init stringa|1024_stddev 177 ns 177 ns 10
|
||||
replace bb to ---- by init stringa|1024_cv 2.55 % 2.55 % 10
|
||||
replace bb to ---- by init stringa|2048_mean 13739 ns 13739 ns 10
|
||||
replace bb to ---- by init stringa|2048_median 13659 ns 13660 ns 10
|
||||
replace bb to ---- by init stringa|2048_stddev 473 ns 473 ns 10
|
||||
replace bb to ---- by init stringa|2048_cv 3.44 % 3.44 % 10
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
replace bb to -- in std::string|64_mean 570 ns 570 ns 10
|
||||
replace bb to -- in std::string|64_median 565 ns 565 ns 10
|
||||
replace bb to -- in std::string|64_stddev 20.7 ns 20.7 ns 10
|
||||
replace bb to -- in std::string|64_cv 3.63 % 3.63 % 10
|
||||
replace bb to -- in std::string|256_mean 1885 ns 1885 ns 10
|
||||
replace bb to -- in std::string|256_median 1910 ns 1910 ns 10
|
||||
replace bb to -- in std::string|256_stddev 84.9 ns 84.8 ns 10
|
||||
replace bb to -- in std::string|256_cv 4.50 % 4.50 % 10
|
||||
replace bb to -- in std::string|512_mean 3523 ns 3523 ns 10
|
||||
replace bb to -- in std::string|512_median 3551 ns 3551 ns 10
|
||||
replace bb to -- in std::string|512_stddev 110 ns 110 ns 10
|
||||
replace bb to -- in std::string|512_cv 3.13 % 3.13 % 10
|
||||
replace bb to -- in std::string|1024_mean 6916 ns 6916 ns 10
|
||||
replace bb to -- in std::string|1024_median 6933 ns 6933 ns 10
|
||||
replace bb to -- in std::string|1024_stddev 153 ns 153 ns 10
|
||||
replace bb to -- in std::string|1024_cv 2.21 % 2.21 % 10
|
||||
replace bb to -- in std::string|2048_mean 13510 ns 13510 ns 10
|
||||
replace bb to -- in std::string|2048_median 13336 ns 13336 ns 10
|
||||
replace bb to -- in std::string|2048_stddev 539 ns 539 ns 10
|
||||
replace bb to -- in std::string|2048_cv 3.99 % 3.99 % 10
|
||||
replace bb to -- in lstringa<8>|64_mean 482 ns 482 ns 10
|
||||
replace bb to -- in lstringa<8>|64_median 481 ns 481 ns 10
|
||||
replace bb to -- in lstringa<8>|64_stddev 9.24 ns 9.24 ns 10
|
||||
replace bb to -- in lstringa<8>|64_cv 1.92 % 1.92 % 10
|
||||
replace bb to -- in lstringa<8>|256_mean 1565 ns 1565 ns 10
|
||||
replace bb to -- in lstringa<8>|256_median 1571 ns 1571 ns 10
|
||||
replace bb to -- in lstringa<8>|256_stddev 44.1 ns 44.1 ns 10
|
||||
replace bb to -- in lstringa<8>|256_cv 2.82 % 2.82 % 10
|
||||
replace bb to -- in lstringa<8>|512_mean 2921 ns 2921 ns 10
|
||||
replace bb to -- in lstringa<8>|512_median 2922 ns 2922 ns 10
|
||||
replace bb to -- in lstringa<8>|512_stddev 85.4 ns 85.4 ns 10
|
||||
replace bb to -- in lstringa<8>|512_cv 2.92 % 2.92 % 10
|
||||
replace bb to -- in lstringa<8>|1024_mean 5594 ns 5594 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_median 5521 ns 5521 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_stddev 211 ns 211 ns 10
|
||||
replace bb to -- in lstringa<8>|1024_cv 3.78 % 3.78 % 10
|
||||
replace bb to -- in lstringa<8>|2048_mean 10928 ns 10928 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_median 10821 ns 10821 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_stddev 362 ns 362 ns 10
|
||||
replace bb to -- in lstringa<8>|2048_cv 3.32 % 3.32 % 10
|
||||
replace bb to -- by init stringa|64_mean 366 ns 366 ns 10
|
||||
replace bb to -- by init stringa|64_median 366 ns 366 ns 10
|
||||
replace bb to -- by init stringa|64_stddev 7.95 ns 7.95 ns 10
|
||||
replace bb to -- by init stringa|64_cv 2.17 % 2.17 % 10
|
||||
replace bb to -- by init stringa|256_mean 1224 ns 1224 ns 10
|
||||
replace bb to -- by init stringa|256_median 1222 ns 1222 ns 10
|
||||
replace bb to -- by init stringa|256_stddev 47.7 ns 47.7 ns 10
|
||||
replace bb to -- by init stringa|256_cv 3.90 % 3.90 % 10
|
||||
replace bb to -- by init stringa|512_mean 2221 ns 2221 ns 10
|
||||
replace bb to -- by init stringa|512_median 2224 ns 2224 ns 10
|
||||
replace bb to -- by init stringa|512_stddev 51.5 ns 51.5 ns 10
|
||||
replace bb to -- by init stringa|512_cv 2.32 % 2.32 % 10
|
||||
replace bb to -- by init stringa|1024_mean 4235 ns 4235 ns 10
|
||||
replace bb to -- by init stringa|1024_median 4272 ns 4272 ns 10
|
||||
replace bb to -- by init stringa|1024_stddev 139 ns 139 ns 10
|
||||
replace bb to -- by init stringa|1024_cv 3.29 % 3.29 % 10
|
||||
replace bb to -- by init stringa|2048_mean 8496 ns 8496 ns 10
|
||||
replace bb to -- by init stringa|2048_median 8383 ns 8383 ns 10
|
||||
replace bb to -- by init stringa|2048_stddev 251 ns 251 ns 10
|
||||
replace bb to -- by init stringa|2048_cv 2.95 % 2.95 % 10
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 5327536 ns 5327558 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 5331817 ns 5331835 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 108137 ns 108137 ns 10
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 2.03 % 2.03 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 6172235 ns 6172321 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 6158878 ns 6158954 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 213624 ns 213652 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 3.46 % 3.46 % 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 5318092 ns 5318133 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 5302064 ns 5302156 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 102639 ns 102632 ns 10
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 1.93 % 1.93 % 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 7002408 ns 7002477 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 6998707 ns 6998736 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 160708 ns 160734 ns 10
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 2.30 % 2.30 % 10
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000
|
||||
Build func full name std::string;_mean 5576 ns 5576 ns 10
|
||||
Build func full name std::string;_median 5532 ns 5532 ns 10
|
||||
Build func full name std::string;_stddev 298 ns 298 ns 10
|
||||
Build func full name std::string;_cv 5.35 % 5.35 % 10
|
||||
Build func full name std::string 1;_mean 5877 ns 5877 ns 10
|
||||
Build func full name std::string 1;_median 5896 ns 5896 ns 10
|
||||
Build func full name std::string 1;_stddev 247 ns 247 ns 10
|
||||
Build func full name std::string 1;_cv 4.20 % 4.20 % 10
|
||||
Build func full name std::stream;_mean 16604 ns 16604 ns 10
|
||||
Build func full name std::stream;_median 16552 ns 16552 ns 10
|
||||
Build func full name std::stream;_stddev 530 ns 530 ns 10
|
||||
Build func full name std::stream;_cv 3.19 % 3.19 % 10
|
||||
Build func full name stringa;_mean 2780 ns 2780 ns 10
|
||||
Build func full name stringa;_median 2749 ns 2749 ns 10
|
||||
Build func full name stringa;_stddev 87.2 ns 87.2 ns 10
|
||||
Build func full name stringa;_cv 3.13 % 3.14 % 10
|
||||
Build func full name stringa 1;_mean 3249 ns 3249 ns 10
|
||||
Build func full name stringa 1;_median 3205 ns 3205 ns 10
|
||||
Build func full name stringa 1;_stddev 137 ns 137 ns 10
|
||||
Build func full name stringa 1;_cv 4.22 % 4.22 % 10
|
||||
|
|
@ -0,0 +1,987 @@
|
|||
Benchmarks of simstr, version 1.8.1
|
||||
Sources: https://github.com/orefkov/simstr
|
||||
Results: https://orefkov.github.io/simstr/results.html
|
||||
Compiler MSVC 19.44.35213.0
|
||||
2026-03-22T13:57:22+03:00
|
||||
Running benchStr.exe
|
||||
Run on (32 X 2494 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)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Benchmark Time CPU Iterations
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
----- Concatenate email ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat email std::format_mean 256 ns 255 ns 4
|
||||
Concat email std::format_median 256 ns 257 ns 4
|
||||
Concat email std::format_stddev 5.69 ns 2.79 ns 4
|
||||
Concat email std::format_cv 2.22 % 1.09 % 4
|
||||
Concat email std::stringstream_mean 940 ns 942 ns 4
|
||||
Concat email std::stringstream_median 934 ns 942 ns 4
|
||||
Concat email std::stringstream_stddev 17.4 ns 14.2 ns 4
|
||||
Concat email std::stringstream_cv 1.85 % 1.51 % 4
|
||||
Concat email stringzilla append_mean 287 ns 286 ns 4
|
||||
Concat email stringzilla append_median 286 ns 289 ns 4
|
||||
Concat email stringzilla append_stddev 22.9 ns 21.4 ns 4
|
||||
Concat email stringzilla append_cv 7.97 % 7.51 % 4
|
||||
Concat email stringzilla concat_mean 134 ns 135 ns 4
|
||||
Concat email stringzilla concat_median 134 ns 135 ns 4
|
||||
Concat email stringzilla concat_stddev 5.29 ns 5.75 ns 4
|
||||
Concat email stringzilla concat_cv 3.94 % 4.27 % 4
|
||||
Concat email std::string append_mean 200 ns 201 ns 4
|
||||
Concat email std::string append_median 201 ns 202 ns 4
|
||||
Concat email std::string append_stddev 4.82 ns 4.34 ns 4
|
||||
Concat email std::string append_cv 2.41 % 2.16 % 4
|
||||
Concat email std::string by strexpr_mean 113 ns 114 ns 4
|
||||
Concat email std::string by strexpr_median 114 ns 114 ns 4
|
||||
Concat email std::string by strexpr_stddev 3.52 ns 3.57 ns 4
|
||||
Concat email std::string by strexpr_cv 3.10 % 3.15 % 4
|
||||
Concat email stringa_mean 106 ns 106 ns 4
|
||||
Concat email stringa_median 102 ns 103 ns 4
|
||||
Concat email stringa_stddev 8.27 ns 6.28 ns 4
|
||||
Concat email stringa_cv 7.77 % 5.94 % 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 333 ns 333 ns 4
|
||||
Concat std::string and number by std to std::string_median 333 ns 333 ns 4
|
||||
Concat std::string and number by std to std::string_stddev 3.36 ns 4.23 ns 4
|
||||
Concat std::string and number by std to std::string_cv 1.01 % 1.27 % 4
|
||||
Concat std::string and number by StrExpr to std::string_mean 219 ns 217 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_median 220 ns 213 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_stddev 3.90 ns 6.80 ns 4
|
||||
Concat std::string and number by StrExpr to std::string_cv 1.78 % 3.14 % 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_mean 109 ns 109 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_median 109 ns 109 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_stddev 2.59 ns 2.34 ns 4
|
||||
Concat stringa and number by StrExpr to simstr::stringa_cv 2.37 % 2.14 % 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_mean 121 ns 121 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_median 122 ns 121 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_stddev 1.61 ns 2.34 ns 4
|
||||
Concat stringa and number by e_concat to simstr::stringa_cv 1.33 % 1.92 % 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 1030 ns 1031 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_median 1029 ns 1025 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_stddev 9.52 ns 10.5 ns 4
|
||||
Concat std::string and format hex number and literal to std::string_cv 0.92 % 1.02 % 4
|
||||
std::format std::string and hex number by literal to std::string_mean 1872 ns 1862 ns 4
|
||||
std::format std::string and hex number by literal to std::string_median 1870 ns 1862 ns 4
|
||||
std::format std::string and hex number by literal to std::string_stddev 44.1 ns 54.0 ns 4
|
||||
std::format std::string and hex number by literal to std::string_cv 2.35 % 2.90 % 4
|
||||
Concat std::string and std::to_chars and string to std::string_mean 252 ns 253 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_median 252 ns 251 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_stddev 2.77 ns 2.79 ns 4
|
||||
Concat std::string and std::to_chars and string to std::string_cv 1.10 % 1.10 % 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_mean 115 ns 115 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_median 115 ns 116 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_stddev 3.10 ns 3.45 ns 4
|
||||
Concat std::string and hex number and literal by StrExpr to std::string_cv 2.71 % 3.01 % 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_mean 101 ns 101 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_median 102 ns 103 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_stddev 2.17 ns 2.09 ns 4
|
||||
Concat stringa and hex number and literal by StrExpr to simstr::stringa_cv 2.14 % 2.06 % 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_mean 108 ns 107 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_median 108 ns 107 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_stddev 1.81 ns 1.99 ns 4
|
||||
Concat stringa and hex number and literal by e_concat to simstr::stringa_cv 1.68 % 1.86 % 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_mean 173 ns 172 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_median 171 ns 171 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_stddev 4.43 ns 2.44 ns 4
|
||||
Subst stringa and hex number by e_subst literal to simstr::stringa_cv 2.57 % 1.42 % 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_mean 361 ns 361 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_median 362 ns 361 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_stddev 5.97 ns 6.55 ns 4
|
||||
Subst stringa and hex number by e_vsubst stra to simstr::stringa_cv 1.66 % 1.81 % 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 702 ns 702 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_median 704 ns 706 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_stddev 15.7 ns 16.7 ns 4
|
||||
"abcdefghihklmopqr "_ss + i / 0x8a010_fmt + " end"_cv 2.23 % 2.38 % 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_mean 810 ns 802 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_median 808 ns 802 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_stddev 12.5 ns 14.2 ns 4
|
||||
e_subst("abcdefghihklmopqr {} end", i / 0x8a010_fmt)_cv 1.55 % 1.77 % 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_mean 1144 ns 1144 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_median 1148 ns 1144 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_stddev 12.7 ns 22.8 ns 4
|
||||
e_vsubst(pattern, i / 0x8a010_fmt)_cv 1.11 % 1.99 % 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_mean 1583 ns 1569 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_median 1577 ns 1569 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_stddev 19.1 ns 28.5 ns 4
|
||||
fmt::format(FMT_COMPILE("abcdefghihklmopqr {:#010o} end"), i)_cv 1.21 % 1.81 % 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_mean 1596 ns 1587 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_median 1597 ns 1587 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_stddev 35.4 ns 45.0 ns 4
|
||||
fmt::format("abcdefghihklmopqr {:#010o} end", i)_cv 2.22 % 2.84 % 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_mean 1946 ns 1916 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_median 1941 ns 1904 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_stddev 30.6 ns 22.7 ns 4
|
||||
std::format("abcdefghihklmopqr {:#010o} end", i)_cv 1.57 % 1.18 % 4
|
||||
std::vformat(pattern, std::make_format_args(i))_mean 1990 ns 1978 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_median 1972 ns 1967 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_stddev 63.3 ns 62.8 ns 4
|
||||
std::vformat(pattern, std::make_format_args(i))_cv 3.18 % 3.17 % 4
|
||||
std::format with std::formatted_size_mean 2922 ns 2932 ns 4
|
||||
std::format with std::formatted_size_median 2925 ns 2916 ns 4
|
||||
std::format with std::formatted_size_stddev 31.5 ns 33.1 ns 4
|
||||
std::format with std::formatted_size_cv 1.08 % 1.13 % 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_mean 7026 ns 6975 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_median 7003 ns 6975 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_stddev 173 ns 142 ns 4
|
||||
strm << "abcdefghihklmopqr 0" << std::oct << std::setw(9) << std::setfill('0') << i << " end"_cv 2.46 % 2.04 % 4
|
||||
----- Concatenate string + "Literal" ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat std::string by std to std::string_mean 55.5 ns 55.2 ns 4
|
||||
Concat std::string by std to std::string_median 55.4 ns 54.9 ns 4
|
||||
Concat std::string by std to std::string_stddev 1.50 ns 1.16 ns 4
|
||||
Concat std::string by std to std::string_cv 2.71 % 2.09 % 4
|
||||
Concat std::string by StrExpr to std::string_mean 77.4 ns 77.6 ns 4
|
||||
Concat std::string by StrExpr to std::string_median 77.4 ns 77.6 ns 4
|
||||
Concat std::string by StrExpr to std::string_stddev 0.605 ns 1.01 ns 4
|
||||
Concat std::string by StrExpr to std::string_cv 0.78 % 1.30 % 4
|
||||
Concat stringa by StrExpr to stringa_mean 52.2 ns 51.6 ns 4
|
||||
Concat stringa by StrExpr to stringa_median 52.4 ns 51.6 ns 4
|
||||
Concat stringa by StrExpr to stringa_stddev 0.927 ns 1.28 ns 4
|
||||
Concat stringa by StrExpr to stringa_cv 1.77 % 2.47 % 4
|
||||
----- Find three concatenated string in string_view -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Find concat three std::string_mean 230 ns 229 ns 4
|
||||
Find concat three std::string_median 229 ns 228 ns 4
|
||||
Find concat three std::string_stddev 3.20 ns 5.01 ns 4
|
||||
Find concat three std::string_cv 1.39 % 2.19 % 4
|
||||
Find concat three strexpr_mean 138 ns 134 ns 4
|
||||
Find concat three strexpr_median 127 ns 127 ns 4
|
||||
Find concat three strexpr_stddev 22.1 ns 15.2 ns 4
|
||||
Find concat three strexpr_cv 16.06 % 11.36 % 4
|
||||
Find concat three simstr_mean 28.3 ns 28.2 ns 4
|
||||
Find concat three simstr_median 28.3 ns 28.2 ns 4
|
||||
Find concat three simstr_stddev 0.625 ns 0.342 ns 4
|
||||
Find concat three simstr_cv 2.21 % 1.22 % 4
|
||||
Find concat three stringzilla string_mean 232 ns 231 ns 4
|
||||
Find concat three stringzilla string_median 231 ns 229 ns 4
|
||||
Find concat three stringzilla string_stddev 4.72 ns 2.44 ns 4
|
||||
Find concat three stringzilla string_cv 2.03 % 1.06 % 4
|
||||
----- Build Type Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
BuildTypeNameStr 0/0_mean 17.8 ns 17.8 ns 4
|
||||
BuildTypeNameStr 0/0_median 17.9 ns 18.0 ns 4
|
||||
BuildTypeNameStr 0/0_stddev 0.258 ns 0.419 ns 4
|
||||
BuildTypeNameStr 0/0_cv 1.45 % 2.35 % 4
|
||||
BuildTypeNameExp 0/0_mean 14.4 ns 14.4 ns 4
|
||||
BuildTypeNameExp 0/0_median 14.4 ns 14.4 ns 4
|
||||
BuildTypeNameExp 0/0_stddev 0.177 ns 0.256 ns 4
|
||||
BuildTypeNameExp 0/0_cv 1.23 % 1.77 % 4
|
||||
BuildTypeNameSim 0/0_mean 15.4 ns 15.3 ns 4
|
||||
BuildTypeNameSim 0/0_median 15.3 ns 15.2 ns 4
|
||||
BuildTypeNameSim 0/0_stddev 0.562 ns 0.596 ns 4
|
||||
BuildTypeNameSim 0/0_cv 3.66 % 3.90 % 4
|
||||
BuildTypeNameStr 10/10_mean 80.1 ns 80.0 ns 4
|
||||
BuildTypeNameStr 10/10_median 79.7 ns 80.6 ns 4
|
||||
BuildTypeNameStr 10/10_stddev 1.34 ns 2.00 ns 4
|
||||
BuildTypeNameStr 10/10_cv 1.67 % 2.50 % 4
|
||||
BuildTypeNameExp 10/10_mean 39.4 ns 39.6 ns 4
|
||||
BuildTypeNameExp 10/10_median 39.3 ns 39.3 ns 4
|
||||
BuildTypeNameExp 10/10_stddev 0.579 ns 0.419 ns 4
|
||||
BuildTypeNameExp 10/10_cv 1.47 % 1.06 % 4
|
||||
BuildTypeNameSim 10/10_mean 38.8 ns 38.6 ns 4
|
||||
BuildTypeNameSim 10/10_median 38.9 ns 38.4 ns 4
|
||||
BuildTypeNameSim 10/10_stddev 0.643 ns 0.436 ns 4
|
||||
BuildTypeNameSim 10/10_cv 1.66 % 1.13 % 4
|
||||
----- Replace string by copy -----/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Concat with replace str_mean 352 ns 351 ns 4
|
||||
Concat with replace str_median 353 ns 353 ns 4
|
||||
Concat with replace str_stddev 8.02 ns 10.1 ns 4
|
||||
Concat with replace str_cv 2.28 % 2.88 % 4
|
||||
Concat with replace exp_mean 222 ns 222 ns 4
|
||||
Concat with replace exp_median 222 ns 222 ns 4
|
||||
Concat with replace exp_stddev 3.00 ns 3.02 ns 4
|
||||
Concat with replace exp_cv 1.35 % 1.36 % 4
|
||||
----- Create Empty Str ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e;_mean 2.58 ns 2.58 ns 4
|
||||
std::string e;_median 2.58 ns 2.57 ns 4
|
||||
std::string e;_stddev 0.033 ns 0.028 ns 4
|
||||
std::string e;_cv 1.28 % 1.08 % 4
|
||||
std::string_view e;_mean 1.84 ns 1.84 ns 4
|
||||
std::string_view e;_median 1.85 ns 1.84 ns 4
|
||||
std::string_view e;_stddev 0.022 ns 0.034 ns 4
|
||||
std::string_view e;_cv 1.20 % 1.86 % 4
|
||||
ssa e;_mean 1.86 ns 1.84 ns 4
|
||||
ssa e;_median 1.86 ns 1.84 ns 4
|
||||
ssa e;_stddev 0.010 ns 0.034 ns 4
|
||||
ssa e;_cv 0.53 % 1.86 % 4
|
||||
stringa e;_mean 2.22 ns 2.22 ns 4
|
||||
stringa e;_median 2.22 ns 2.22 ns 4
|
||||
stringa e;_stddev 0.020 ns 0.000 ns 4
|
||||
stringa e;_cv 0.92 % 0.00 % 4
|
||||
lstringa<20> e;_mean 2.55 ns 2.55 ns 4
|
||||
lstringa<20> e;_median 2.55 ns 2.55 ns 4
|
||||
lstringa<20> e;_stddev 0.035 ns 0.048 ns 4
|
||||
lstringa<20> e;_cv 1.39 % 1.90 % 4
|
||||
lstringa<40> e;_mean 2.57 ns 2.55 ns 4
|
||||
lstringa<40> e;_median 2.57 ns 2.57 ns 4
|
||||
lstringa<40> e;_stddev 0.038 ns 0.028 ns 4
|
||||
lstringa<40> e;_cv 1.48 % 1.09 % 4
|
||||
----- Create Str from short literal (9 symbols) --------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "Test text";_mean 2.57 ns 2.57 ns 4
|
||||
std::string e = "Test text";_median 2.57 ns 2.57 ns 4
|
||||
std::string e = "Test text";_stddev 0.053 ns 0.046 ns 4
|
||||
std::string e = "Test text";_cv 2.07 % 1.77 % 4
|
||||
std::string_view e = "Test text";_mean 1.84 ns 1.84 ns 4
|
||||
std::string_view e = "Test text";_median 1.84 ns 1.84 ns 4
|
||||
std::string_view e = "Test text";_stddev 0.022 ns 0.034 ns 4
|
||||
std::string_view e = "Test text";_cv 1.22 % 1.86 % 4
|
||||
ssa e = "Test text";_mean 1.84 ns 1.84 ns 4
|
||||
ssa e = "Test text";_median 1.84 ns 1.84 ns 4
|
||||
ssa e = "Test text";_stddev 0.010 ns 0.000 ns 4
|
||||
ssa e = "Test text";_cv 0.55 % 0.00 % 4
|
||||
stringa e = "Test text";_mean 2.57 ns 2.55 ns 4
|
||||
stringa e = "Test text";_median 2.57 ns 2.55 ns 4
|
||||
stringa e = "Test text";_stddev 0.026 ns 0.048 ns 4
|
||||
stringa e = "Test text";_cv 1.01 % 1.90 % 4
|
||||
lstringa<20> e = "Test text";_mean 2.60 ns 2.61 ns 4
|
||||
lstringa<20> e = "Test text";_median 2.59 ns 2.62 ns 4
|
||||
lstringa<20> e = "Test text";_stddev 0.045 ns 0.028 ns 4
|
||||
lstringa<20> e = "Test text";_cv 1.73 % 1.07 % 4
|
||||
lstringa<40> e = "Test text";_mean 2.58 ns 2.55 ns 4
|
||||
lstringa<40> e = "Test text";_median 2.60 ns 2.55 ns 4
|
||||
lstringa<40> e = "Test text";_stddev 0.034 ns 0.048 ns 4
|
||||
lstringa<40> e = "Test text";_cv 1.33 % 1.90 % 4
|
||||
----- Create Str from long literal (30 symbols) ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string e = "123456789012345678901234567890";_mean 79.3 ns 79.3 ns 4
|
||||
std::string e = "123456789012345678901234567890";_median 78.4 ns 78.5 ns 4
|
||||
std::string e = "123456789012345678901234567890";_stddev 2.83 ns 3.02 ns 4
|
||||
std::string e = "123456789012345678901234567890";_cv 3.57 % 3.81 % 4
|
||||
std::string_view e = "123456789012345678901234567890";_mean 1.86 ns 1.85 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_median 1.86 ns 1.84 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_stddev 0.015 ns 0.021 ns 4
|
||||
std::string_view e = "123456789012345678901234567890";_cv 0.80 % 1.13 % 4
|
||||
ssa e = "123456789012345678901234567890";_mean 1.86 ns 1.85 ns 4
|
||||
ssa e = "123456789012345678901234567890";_median 1.83 ns 1.84 ns 4
|
||||
ssa e = "123456789012345678901234567890";_stddev 0.065 ns 0.086 ns 4
|
||||
ssa e = "123456789012345678901234567890";_cv 3.49 % 4.66 % 4
|
||||
stringa e = "123456789012345678901234567890";_mean 2.24 ns 2.22 ns 4
|
||||
stringa e = "123456789012345678901234567890";_median 2.24 ns 2.20 ns 4
|
||||
stringa e = "123456789012345678901234567890";_stddev 0.026 ns 0.049 ns 4
|
||||
stringa e = "123456789012345678901234567890";_cv 1.18 % 2.20 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_mean 72.7 ns 72.8 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_median 73.0 ns 73.2 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_stddev 0.990 ns 0.872 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890";_cv 1.36 % 1.20 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_mean 3.32 ns 3.33 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_median 3.31 ns 3.30 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_stddev 0.085 ns 0.073 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890";_cv 2.56 % 2.20 % 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 5.40 ns 5.41 ns 4
|
||||
std::string e = "Test text"; auto c{e};_median 5.39 ns 5.44 ns 4
|
||||
std::string e = "Test text"; auto c{e};_stddev 0.067 ns 0.070 ns 4
|
||||
std::string e = "Test text"; auto c{e};_cv 1.24 % 1.29 % 4
|
||||
std::string_view e = "Test text"; auto c{e};_mean 2.95 ns 2.90 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_median 2.96 ns 2.92 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_stddev 0.021 ns 0.083 ns 4
|
||||
std::string_view e = "Test text"; auto c{e};_cv 0.72 % 2.88 % 4
|
||||
ssa e = "Test text"; auto c{e};_mean 2.95 ns 2.95 ns 4
|
||||
ssa e = "Test text"; auto c{e};_median 2.95 ns 2.92 ns 4
|
||||
ssa e = "Test text"; auto c{e};_stddev 0.058 ns 0.066 ns 4
|
||||
ssa e = "Test text"; auto c{e};_cv 1.98 % 2.25 % 4
|
||||
stringa e = "Test text"; auto c{e};_mean 4.12 ns 4.10 ns 4
|
||||
stringa e = "Test text"; auto c{e};_median 4.11 ns 4.08 ns 4
|
||||
stringa e = "Test text"; auto c{e};_stddev 0.046 ns 0.045 ns 4
|
||||
stringa e = "Test text"; auto c{e};_cv 1.12 % 1.10 % 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_mean 4.78 ns 4.74 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_median 4.76 ns 4.74 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_stddev 0.071 ns 0.114 ns 4
|
||||
lstringa<20> e = "Test text"; auto c{e};_cv 1.48 % 2.40 % 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_mean 5.49 ns 5.48 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_median 5.49 ns 5.44 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_stddev 0.036 ns 0.070 ns 4
|
||||
lstringa<40> e = "Test text"; auto c{e};_cv 0.66 % 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 78.8 ns 78.5 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_median 78.5 ns 78.5 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_stddev 2.38 ns 3.18 ns 4
|
||||
std::string e = "123456789012345678901234567890"; auto c{e};_cv 3.03 % 4.06 % 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_mean 1.50 ns 1.49 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_median 1.50 ns 1.49 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_stddev 0.015 ns 0.018 ns 4
|
||||
std::string_view e = "123456789012345678901234567890"; auto c{e};_cv 0.99 % 1.22 % 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_mean 1.47 ns 1.47 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_median 1.46 ns 1.46 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_stddev 0.019 ns 0.030 ns 4
|
||||
ssa e = "123456789012345678901234567890"; auto c{e};_cv 1.30 % 2.05 % 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_mean 2.98 ns 2.97 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_median 3.00 ns 2.95 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_stddev 0.039 ns 0.031 ns 4
|
||||
stringa e = "123456789012345678901234567890"; auto c{e};_cv 1.31 % 1.06 % 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_mean 82.9 ns 82.4 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_median 83.1 ns 82.8 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_stddev 0.866 ns 1.67 ns 4
|
||||
lstringa<20> e = "123456789012345678901234567890"; auto c{e};_cv 1.04 % 2.03 % 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_mean 7.41 ns 7.39 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_median 7.38 ns 7.39 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_stddev 0.131 ns 0.114 ns 4
|
||||
lstringa<40> e = "123456789012345678901234567890"; auto c{e};_cv 1.77 % 1.54 % 4
|
||||
----- Find 9 symbols text in end of 99 symbols text ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
sz::string::find;_mean 117 ns 117 ns 4
|
||||
sz::string::find;_median 117 ns 117 ns 4
|
||||
sz::string::find;_stddev 0.763 ns 1.99 ns 4
|
||||
sz::string::find;_cv 0.65 % 1.70 % 4
|
||||
std::string::find;_mean 40.3 ns 40.1 ns 4
|
||||
std::string::find;_median 40.2 ns 39.9 ns 4
|
||||
std::string::find;_stddev 0.623 ns 0.453 ns 4
|
||||
std::string::find;_cv 1.54 % 1.13 % 4
|
||||
std::string_view::find;_mean 39.8 ns 39.5 ns 4
|
||||
std::string_view::find;_median 39.8 ns 39.7 ns 4
|
||||
std::string_view::find;_stddev 0.318 ns 0.835 ns 4
|
||||
std::string_view::find;_cv 0.80 % 2.12 % 4
|
||||
ssa::find;_mean 21.9 ns 21.9 ns 4
|
||||
ssa::find;_median 21.9 ns 22.0 ns 4
|
||||
ssa::find;_stddev 0.213 ns 0.244 ns 4
|
||||
ssa::find;_cv 0.97 % 1.12 % 4
|
||||
stringa::find;_mean 29.4 ns 29.0 ns 4
|
||||
stringa::find;_median 29.5 ns 29.5 ns 4
|
||||
stringa::find;_stddev 0.245 ns 1.25 ns 4
|
||||
stringa::find;_cv 0.83 % 4.33 % 4
|
||||
lstringa<20>::find;_mean 24.4 ns 23.9 ns 4
|
||||
lstringa<20>::find;_median 23.4 ns 22.5 ns 4
|
||||
lstringa<20>::find;_stddev 3.47 ns 3.63 ns 4
|
||||
lstringa<20>::find;_cv 14.22 % 15.18 % 4
|
||||
lstringa<40>::find;_mean 23.1 ns 23.0 ns 4
|
||||
lstringa<40>::find;_median 23.0 ns 22.8 ns 4
|
||||
lstringa<40>::find;_stddev 0.931 ns 0.740 ns 4
|
||||
lstringa<40>::find;_cv 4.04 % 3.21 % 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 5.18 ns 5.20 ns 4
|
||||
std::string copy{str_with_len_N};/15_median 5.13 ns 5.16 ns 4
|
||||
std::string copy{str_with_len_N};/15_stddev 0.143 ns 0.078 ns 4
|
||||
std::string copy{str_with_len_N};/15_cv 2.76 % 1.50 % 4
|
||||
std::string copy{str_with_len_N};/16_mean 83.5 ns 83.7 ns 4
|
||||
std::string copy{str_with_len_N};/16_median 83.4 ns 83.7 ns 4
|
||||
std::string copy{str_with_len_N};/16_stddev 1.76 ns 2.01 ns 4
|
||||
std::string copy{str_with_len_N};/16_cv 2.11 % 2.41 % 4
|
||||
std::string copy{str_with_len_N};/23_mean 82.0 ns 82.0 ns 4
|
||||
std::string copy{str_with_len_N};/23_median 81.8 ns 82.0 ns 4
|
||||
std::string copy{str_with_len_N};/23_stddev 1.56 ns 2.01 ns 4
|
||||
std::string copy{str_with_len_N};/23_cv 1.90 % 2.46 % 4
|
||||
std::string copy{str_with_len_N};/24_mean 83.5 ns 83.7 ns 4
|
||||
std::string copy{str_with_len_N};/24_median 83.4 ns 83.7 ns 4
|
||||
std::string copy{str_with_len_N};/24_stddev 0.829 ns 1.42 ns 4
|
||||
std::string copy{str_with_len_N};/24_cv 0.99 % 1.70 % 4
|
||||
std::string copy{str_with_len_N};/32_mean 89.4 ns 88.5 ns 4
|
||||
std::string copy{str_with_len_N};/32_median 89.9 ns 88.1 ns 4
|
||||
std::string copy{str_with_len_N};/32_stddev 1.35 ns 1.67 ns 4
|
||||
std::string copy{str_with_len_N};/32_cv 1.50 % 1.89 % 4
|
||||
std::string copy{str_with_len_N};/64_mean 90.6 ns 90.5 ns 4
|
||||
std::string copy{str_with_len_N};/64_median 86.7 ns 86.8 ns 4
|
||||
std::string copy{str_with_len_N};/64_stddev 9.13 ns 9.57 ns 4
|
||||
std::string copy{str_with_len_N};/64_cv 10.07 % 10.57 % 4
|
||||
std::string copy{str_with_len_N};/128_mean 90.0 ns 90.0 ns 4
|
||||
std::string copy{str_with_len_N};/128_median 89.9 ns 90.0 ns 4
|
||||
std::string copy{str_with_len_N};/128_stddev 0.893 ns 1.71 ns 4
|
||||
std::string copy{str_with_len_N};/128_cv 0.99 % 1.90 % 4
|
||||
std::string copy{str_with_len_N};/256_mean 91.8 ns 92.0 ns 4
|
||||
std::string copy{str_with_len_N};/256_median 91.7 ns 91.6 ns 4
|
||||
std::string copy{str_with_len_N};/256_stddev 3.06 ns 3.60 ns 4
|
||||
std::string copy{str_with_len_N};/256_cv 3.34 % 3.91 % 4
|
||||
std::string copy{str_with_len_N};/512_mean 96.2 ns 95.7 ns 4
|
||||
std::string copy{str_with_len_N};/512_median 95.8 ns 96.3 ns 4
|
||||
std::string copy{str_with_len_N};/512_stddev 1.01 ns 1.05 ns 4
|
||||
std::string copy{str_with_len_N};/512_cv 1.05 % 1.09 % 4
|
||||
std::string copy{str_with_len_N};/1024_mean 102 ns 102 ns 4
|
||||
std::string copy{str_with_len_N};/1024_median 102 ns 103 ns 4
|
||||
std::string copy{str_with_len_N};/1024_stddev 5.76 ns 5.50 ns 4
|
||||
std::string copy{str_with_len_N};/1024_cv 5.65 % 5.39 % 4
|
||||
std::string copy{str_with_len_N};/2048_mean 132 ns 132 ns 4
|
||||
std::string copy{str_with_len_N};/2048_median 132 ns 131 ns 4
|
||||
std::string copy{str_with_len_N};/2048_stddev 2.82 ns 4.19 ns 4
|
||||
std::string copy{str_with_len_N};/2048_cv 2.13 % 3.17 % 4
|
||||
std::string copy{str_with_len_N};/4096_mean 184 ns 182 ns 4
|
||||
std::string copy{str_with_len_N};/4096_median 182 ns 182 ns 4
|
||||
std::string copy{str_with_len_N};/4096_stddev 4.95 ns 4.95 ns 4
|
||||
std::string copy{str_with_len_N};/4096_cv 2.69 % 2.72 % 4
|
||||
stringa copy{str_with_len_N};/15_mean 4.04 ns 4.01 ns 4
|
||||
stringa copy{str_with_len_N};/15_median 4.05 ns 4.01 ns 4
|
||||
stringa copy{str_with_len_N};/15_stddev 0.033 ns 0.071 ns 4
|
||||
stringa copy{str_with_len_N};/15_cv 0.83 % 1.77 % 4
|
||||
stringa copy{str_with_len_N};/16_mean 4.07 ns 4.08 ns 4
|
||||
stringa copy{str_with_len_N};/16_median 4.08 ns 4.05 ns 4
|
||||
stringa copy{str_with_len_N};/16_stddev 0.086 ns 0.083 ns 4
|
||||
stringa copy{str_with_len_N};/16_cv 2.11 % 2.05 % 4
|
||||
stringa copy{str_with_len_N};/23_mean 4.09 ns 4.08 ns 4
|
||||
stringa copy{str_with_len_N};/23_median 4.09 ns 4.08 ns 4
|
||||
stringa copy{str_with_len_N};/23_stddev 0.073 ns 0.074 ns 4
|
||||
stringa copy{str_with_len_N};/23_cv 1.79 % 1.81 % 4
|
||||
stringa copy{str_with_len_N};/24_mean 18.8 ns 18.6 ns 4
|
||||
stringa copy{str_with_len_N};/24_median 18.8 ns 18.8 ns 4
|
||||
stringa copy{str_with_len_N};/24_stddev 0.284 ns 0.384 ns 4
|
||||
stringa copy{str_with_len_N};/24_cv 1.51 % 2.06 % 4
|
||||
stringa copy{str_with_len_N};/32_mean 18.6 ns 18.5 ns 4
|
||||
stringa copy{str_with_len_N};/32_median 18.5 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/32_stddev 0.266 ns 0.209 ns 4
|
||||
stringa copy{str_with_len_N};/32_cv 1.43 % 1.13 % 4
|
||||
stringa copy{str_with_len_N};/64_mean 18.6 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/64_median 18.6 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/64_stddev 0.088 ns 0.342 ns 4
|
||||
stringa copy{str_with_len_N};/64_cv 0.47 % 1.86 % 4
|
||||
stringa copy{str_with_len_N};/128_mean 18.6 ns 18.6 ns 4
|
||||
stringa copy{str_with_len_N};/128_median 18.6 ns 18.6 ns 4
|
||||
stringa copy{str_with_len_N};/128_stddev 0.111 ns 0.242 ns 4
|
||||
stringa copy{str_with_len_N};/128_cv 0.60 % 1.30 % 4
|
||||
stringa copy{str_with_len_N};/256_mean 18.7 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/256_median 18.7 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/256_stddev 0.154 ns 0.342 ns 4
|
||||
stringa copy{str_with_len_N};/256_cv 0.82 % 1.86 % 4
|
||||
stringa copy{str_with_len_N};/512_mean 19.1 ns 18.9 ns 4
|
||||
stringa copy{str_with_len_N};/512_median 18.7 ns 18.8 ns 4
|
||||
stringa copy{str_with_len_N};/512_stddev 0.790 ns 0.527 ns 4
|
||||
stringa copy{str_with_len_N};/512_cv 4.14 % 2.78 % 4
|
||||
stringa copy{str_with_len_N};/1024_mean 18.7 ns 18.5 ns 4
|
||||
stringa copy{str_with_len_N};/1024_median 18.7 ns 18.4 ns 4
|
||||
stringa copy{str_with_len_N};/1024_stddev 0.105 ns 0.209 ns 4
|
||||
stringa copy{str_with_len_N};/1024_cv 0.56 % 1.13 % 4
|
||||
stringa copy{str_with_len_N};/2048_mean 18.7 ns 18.6 ns 4
|
||||
stringa copy{str_with_len_N};/2048_median 18.7 ns 18.6 ns 4
|
||||
stringa copy{str_with_len_N};/2048_stddev 0.170 ns 0.242 ns 4
|
||||
stringa copy{str_with_len_N};/2048_cv 0.91 % 1.30 % 4
|
||||
stringa copy{str_with_len_N};/4096_mean 18.7 ns 18.7 ns 4
|
||||
stringa copy{str_with_len_N};/4096_median 18.7 ns 18.8 ns 4
|
||||
stringa copy{str_with_len_N};/4096_stddev 0.084 ns 0.192 ns 4
|
||||
stringa copy{str_with_len_N};/4096_cv 0.45 % 1.03 % 4
|
||||
lstringa<16> copy{str_with_len_N};/15_mean 4.06 ns 4.06 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_median 4.05 ns 4.04 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_stddev 0.063 ns 0.087 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/15_cv 1.55 % 2.14 % 4
|
||||
lstringa<16> copy{str_with_len_N};/16_mean 8.48 ns 8.46 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_median 8.49 ns 8.46 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_stddev 0.137 ns 0.101 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/16_cv 1.61 % 1.19 % 4
|
||||
lstringa<16> copy{str_with_len_N};/23_mean 8.54 ns 8.50 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_median 8.56 ns 8.54 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_stddev 0.063 ns 0.087 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/23_cv 0.73 % 1.03 % 4
|
||||
lstringa<16> copy{str_with_len_N};/24_mean 81.2 ns 81.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_median 80.9 ns 81.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_stddev 2.04 ns 2.25 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/24_cv 2.51 % 2.78 % 4
|
||||
lstringa<16> copy{str_with_len_N};/32_mean 84.1 ns 84.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_median 84.2 ns 83.7 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_stddev 0.339 ns 0.872 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/32_cv 0.40 % 1.04 % 4
|
||||
lstringa<16> copy{str_with_len_N};/64_mean 82.4 ns 82.1 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_median 82.3 ns 81.6 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_stddev 1.06 ns 1.05 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/64_cv 1.29 % 1.27 % 4
|
||||
lstringa<16> copy{str_with_len_N};/128_mean 85.6 ns 85.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_median 85.4 ns 85.4 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_stddev 1.42 ns 1.42 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/128_cv 1.66 % 1.67 % 4
|
||||
lstringa<16> copy{str_with_len_N};/256_mean 87.1 ns 86.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_median 87.3 ns 85.8 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_stddev 1.57 ns 2.09 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/256_cv 1.80 % 2.41 % 4
|
||||
lstringa<16> copy{str_with_len_N};/512_mean 90.7 ns 90.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_median 91.2 ns 90.0 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_stddev 1.60 ns 1.71 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/512_cv 1.77 % 1.90 % 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_mean 101 ns 101 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_median 100 ns 100 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_stddev 5.75 ns 6.21 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/1024_cv 5.68 % 6.14 % 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_mean 135 ns 133 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_median 136 ns 133 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_stddev 5.54 ns 3.60 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/2048_cv 4.11 % 2.72 % 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_mean 196 ns 195 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_median 196 ns 195 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_stddev 2.72 ns 2.42 ns 4
|
||||
lstringa<16> copy{str_with_len_N};/4096_cv 1.39 % 1.24 % 4
|
||||
lstringa<512> copy{str_with_len_N};/15_mean 4.46 ns 4.45 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_median 4.47 ns 4.45 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_stddev 0.048 ns 0.083 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/15_cv 1.08 % 1.86 % 4
|
||||
lstringa<512> copy{str_with_len_N};/16_mean 8.96 ns 8.89 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_median 9.02 ns 8.89 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_stddev 0.201 ns 0.121 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/16_cv 2.24 % 1.36 % 4
|
||||
lstringa<512> copy{str_with_len_N};/23_mean 8.92 ns 8.89 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_median 8.89 ns 8.89 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_stddev 0.096 ns 0.121 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/23_cv 1.08 % 1.36 % 4
|
||||
lstringa<512> copy{str_with_len_N};/24_mean 9.07 ns 9.00 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_median 9.14 ns 9.00 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_stddev 0.274 ns 0.342 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/24_cv 3.02 % 3.80 % 4
|
||||
lstringa<512> copy{str_with_len_N};/32_mean 12.6 ns 12.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_median 12.6 ns 12.7 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_stddev 0.121 ns 0.267 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/32_cv 0.96 % 2.12 % 4
|
||||
lstringa<512> copy{str_with_len_N};/64_mean 12.5 ns 12.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_median 12.5 ns 12.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_stddev 0.075 ns 0.000 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/64_cv 0.60 % 0.00 % 4
|
||||
lstringa<512> copy{str_with_len_N};/128_mean 12.9 ns 12.9 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_median 12.9 ns 12.8 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_stddev 0.117 ns 0.140 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/128_cv 0.91 % 1.08 % 4
|
||||
lstringa<512> copy{str_with_len_N};/256_mean 14.0 ns 14.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_median 14.0 ns 14.0 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_stddev 0.180 ns 0.140 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/256_cv 1.28 % 1.00 % 4
|
||||
lstringa<512> copy{str_with_len_N};/512_mean 15.7 ns 15.6 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_median 15.6 ns 15.3 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_stddev 0.330 ns 0.575 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/512_cv 2.10 % 3.68 % 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_mean 95.0 ns 95.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_median 94.7 ns 95.2 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_stddev 1.84 ns 2.70 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/1024_cv 1.93 % 2.84 % 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_mean 128 ns 127 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_median 128 ns 127 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_stddev 3.74 ns 4.83 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/2048_cv 2.93 % 3.81 % 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_mean 193 ns 194 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_median 193 ns 193 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_stddev 1.56 ns 2.09 ns 4
|
||||
lstringa<512> copy{str_with_len_N};/4096_cv 0.81 % 1.08 % 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 31.9 ns 31.9 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_median 31.9 ns 31.7 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_stddev 0.552 ns 0.668 ns 4
|
||||
std::string s = "123456789"; int res = std::strtol(s.c_str(), 0, 10);_cv 1.73 % 2.09 % 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_mean 11.8 ns 11.8 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_median 11.8 ns 11.7 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_stddev 0.239 ns 0.140 ns 4
|
||||
std::string_view s = "123456789"; std::from_chars(s.data(), s.data() + s.size(), res, 10);_cv 2.02 % 1.18 % 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 16.8 ns 16.7 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 16.8 ns 16.7 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.164 ns 0.222 ns 4
|
||||
stringa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 0.98 % 1.33 % 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 15.6 ns 15.5 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_median 15.5 ns 15.5 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.378 ns 0.201 ns 4
|
||||
ssa s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.43 % 1.30 % 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_mean 14.8 ns 14.6 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_median 14.8 ns 14.6 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_stddev 0.360 ns 0.174 ns 4
|
||||
lstringa<20> s = "123456789"; int res = s.to_int<int, true, 10, false>_cv 2.43 % 1.20 % 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 35.5 ns 35.5 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_median 35.4 ns 35.7 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_stddev 0.552 ns 0.768 ns 4
|
||||
std::string s = "abcDef"; int res = std::strtol(s.c_str(), 0, 16);_cv 1.55 % 2.16 % 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_mean 8.96 ns 9.00 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_median 8.95 ns 9.00 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_stddev 0.173 ns 0.242 ns 4
|
||||
std::string_view s = "abcDef"; std::from_chars(s.data(), s.data() + s.size(), res, 16);_cv 1.93 % 2.69 % 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 14.5 ns 14.5 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 14.5 ns 14.6 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.173 ns 0.301 ns 4
|
||||
stringa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.20 % 2.07 % 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 13.3 ns 13.3 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 13.4 ns 13.3 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.191 ns 0.267 ns 4
|
||||
ssa s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.43 % 2.01 % 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_mean 12.7 ns 12.6 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_median 12.6 ns 12.6 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_stddev 0.165 ns 0.140 ns 4
|
||||
lstringa<20> s = "abcDef"; int res = s.to_int<int, true, 16, false>_cv 1.30 % 1.10 % 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 45.6 ns 45.3 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_median 45.6 ns 45.5 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_stddev 0.831 ns 1.00 ns 4
|
||||
std::string s = " 123456789"; int res = std::strtol(s.c_str(), 0, 0);_cv 1.82 % 2.21 % 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_mean 22.4 ns 22.2 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_median 22.4 ns 22.2 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_stddev 0.187 ns 0.302 ns 4
|
||||
stringa s = " 123456789"; int res = s.to_int<int>; // Check overflow_cv 0.84 % 1.36 % 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_mean 19.1 ns 19.1 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_median 19.1 ns 19.3 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_stddev 0.164 ns 0.209 ns 4
|
||||
ssa s = " 123456789"; int res = s.to_int<int, false>; // No check overflow_cv 0.86 % 1.09 % 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 103 ns 103 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_median 103 ns 103 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_stddev 0.220 ns 0.000 ns 4
|
||||
std::string s = "1234.567e10"; double res = std::strtod(s.c_str(), nullptr);_cv 0.21 % 0.00 % 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_mean 82.7 ns 82.0 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_median 83.0 ns 82.0 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_stddev 1.72 ns 2.01 ns 4
|
||||
std::string_view s = "1234.567e10"; std::from_chars(s.data(), s.data() + s.size(), res);_cv 2.08 % 2.46 % 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_mean 37.7 ns 37.8 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_median 37.7 ns 37.6 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_stddev 0.248 ns 0.384 ns 4
|
||||
ssa s = "1234.567e10"; double res = *s.to_double()_cv 0.66 % 1.02 % 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 5722 ns 5685 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_median 5712 ns 5650 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_stddev 62.9 ns 134 ns 4
|
||||
std::stringstream str; ... str << "abbaabbaabbaabba";_cv 1.10 % 2.35 % 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_mean 1306 ns 1295 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_median 1306 ns 1303 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_stddev 20.8 ns 30.1 ns 4
|
||||
std::string str; ... str += "abbaabbaabbaabba";_cv 1.60 % 2.32 % 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_mean 914 ns 905 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_median 917 ns 910 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_stddev 13.5 ns 20.0 ns 4
|
||||
lstringa<8> str; ... str += "abbaabbaabbaabba";_cv 1.48 % 2.21 % 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_mean 542 ns 539 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_median 537 ns 539 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_stddev 12.9 ns 9.02 ns 4
|
||||
lstringa<128> str; ... str += "abbaabbaabbaabba";_cv 2.38 % 1.67 % 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_mean 364 ns 361 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_median 366 ns 361 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_stddev 6.93 ns 6.26 ns 4
|
||||
lstringa<512> str; ... str += "abbaabbaabbaabba";_cv 1.90 % 1.74 % 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_mean 230 ns 229 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_median 231 ns 229 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_stddev 5.37 ns 3.99 ns 4
|
||||
lstringa<1024> str; ... str += "abbaabbaabbaabba";_cv 2.34 % 1.74 % 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 5665 ns 5580 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_median 5665 ns 5580 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_stddev 178 ns 255 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba";_cv 3.15 % 4.56 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_mean 3902 ns 3902 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_median 3908 ns 3880 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_stddev 74.9 ns 83.5 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba";_cv 1.92 % 2.14 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_mean 822 ns 820 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_median 822 ns 820 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_stddev 13.8 ns 20.1 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.68 % 2.46 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_mean 535 ns 535 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_median 535 ns 531 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_stddev 10.9 ns 7.81 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba";_cv 2.03 % 1.46 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_mean 377 ns 377 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_median 376 ns 377 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_stddev 5.35 ns 6.83 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.42 % 1.81 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_mean 286 ns 285 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_median 285 ns 285 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_stddev 3.20 ns 5.41 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba";_cv 1.12 % 1.90 % 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 295560 ns 295048 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_median 291197 ns 288771 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_stddev 13899 ns 17000 ns 4
|
||||
std::stringstream str; ... str << str_var << "abbaabbaabbaabba"; 2048 times_cv 4.70 % 5.76 % 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 199734 ns 194972 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 200341 ns 194972 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 4028 ns 3702 ns 4
|
||||
std::string str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.02 % 1.90 % 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 25221 ns 25251 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 25305 ns 25391 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 392 ns 534 ns 4
|
||||
lstringa<8> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.55 % 2.12 % 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 23191 ns 23123 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 23387 ns 23350 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 674 ns 641 ns 4
|
||||
lstringa<128> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 2.90 % 2.77 % 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 21887 ns 21711 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 21799 ns 21711 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 298 ns 302 ns 4
|
||||
lstringa<512> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.36 % 1.39 % 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_mean 22577 ns 22496 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_median 22602 ns 22496 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_stddev 279 ns 0.000 ns 4
|
||||
lstringa<1024> str; ... str += str_var + "abbaabbaabbaabba"; 2048 times_cv 1.24 % 0.00 % 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 5538 ns 5547 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_median 5547 ns 5547 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_stddev 115 ns 90.2 ns 4
|
||||
std::stringstream str; ... str << str_var1 << str_var2;_cv 2.08 % 1.63 % 4
|
||||
std::string str; ... str += str_var1 + str_var2;_mean 4019 ns 4013 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_median 4019 ns 3990 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_stddev 40.6 ns 45.3 ns 4
|
||||
std::string str; ... str += str_var1 + str_var2;_cv 1.01 % 1.13 % 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_mean 900 ns 902 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_median 900 ns 907 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_stddev 17.6 ns 8.72 ns 4
|
||||
lstringa<16> str; ... str += str_var1 + str_var2;_cv 1.95 % 0.97 % 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_mean 641 ns 638 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_median 644 ns 642 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_stddev 8.08 ns 6.98 ns 4
|
||||
lstringa<128> str; ... str += str_var1 + str_var2;_cv 1.26 % 1.09 % 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_mean 482 ns 476 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_median 478 ns 476 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_stddev 8.41 ns 8.83 ns 4
|
||||
lstringa<512> str; ... str += str_var1 + str_var2;_cv 1.75 % 1.86 % 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_mean 365 ns 365 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_median 366 ns 365 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_stddev 5.82 ns 4.63 ns 4
|
||||
lstringa<1024> str; ... str += str_var1 + str_var2;_cv 1.59 % 1.27 % 4
|
||||
-- Append text, number, text --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::stringstream str; str << "test = " << k << " times";_mean 11725 ns 11719 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_median 11720 ns 11719 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_stddev 134 ns 199 ns 4
|
||||
std::stringstream str; str << "test = " << k << " times";_cv 1.14 % 1.70 % 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_mean 1226 ns 1228 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_median 1223 ns 1228 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_stddev 27.1 ns 32.2 ns 4
|
||||
std::string str = "test = " + std::to_string(k) + " times";_cv 2.21 % 2.62 % 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_mean 2815 ns 2802 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_median 2819 ns 2787 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_stddev 70.6 ns 74.6 ns 4
|
||||
char buf[100]; sprintf(buf, "test = %u times", k); std::string str = buf;_cv 2.51 % 2.66 % 4
|
||||
std::string str = std::format("test = {} times", k);_mean 2391 ns 2367 ns 4
|
||||
std::string str = std::format("test = {} times", k);_median 2379 ns 2354 ns 4
|
||||
std::string str = std::format("test = {} times", k);_stddev 26.5 ns 65.8 ns 4
|
||||
std::string str = std::format("test = {} times", k);_cv 1.11 % 2.78 % 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_mean 2677 ns 2653 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_median 2681 ns 2668 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_stddev 35.4 ns 88.9 ns 4
|
||||
lstringa<8> str; str.format("test = {} times", k);_cv 1.32 % 3.35 % 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_mean 1480 ns 1483 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_median 1477 ns 1475 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_stddev 14.2 ns 15.7 ns 4
|
||||
lstringa<32> str; str.format("test = {} times", k);_cv 0.96 % 1.06 % 4
|
||||
lstringa<8> str = "test = " + k + " times";_mean 890 ns 889 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_median 891 ns 889 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_stddev 14.0 ns 14.2 ns 4
|
||||
lstringa<8> str = "test = " + k + " times";_cv 1.58 % 1.60 % 4
|
||||
lstringa<32> str = "test = " + k + " times";_mean 180 ns 179 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_median 180 ns 180 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_stddev 3.64 ns 4.83 ns 4
|
||||
lstringa<32> str = "test = " + k + " times";_cv 2.02 % 2.69 % 4
|
||||
stringa str = "test = " + k + " times";_mean 172 ns 170 ns 4
|
||||
stringa str = "test = " + k + " times";_median 172 ns 170 ns 4
|
||||
stringa str = "test = " + k + " times";_stddev 2.25 ns 2.42 ns 4
|
||||
stringa str = "test = " + k + " times";_cv 1.31 % 1.43 % 4
|
||||
-- Split text and convert to int --/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
std::string::find + substr + std::strtol_mean 573 ns 570 ns 4
|
||||
std::string::find + substr + std::strtol_median 566 ns 570 ns 4
|
||||
std::string::find + substr + std::strtol_stddev 23.5 ns 32.5 ns 4
|
||||
std::string::find + substr + std::strtol_cv 4.09 % 5.70 % 4
|
||||
ssa::splitter + ssa::as_int_mean 304 ns 303 ns 4
|
||||
ssa::splitter + ssa::as_int_median 304 ns 303 ns 4
|
||||
ssa::splitter + ssa::as_int_stddev 5.71 ns 9.01 ns 4
|
||||
ssa::splitter + ssa::as_int_cv 1.88 % 2.97 % 4
|
||||
ssa::splitf + functor_mean 218 ns 216 ns 4
|
||||
ssa::splitf + functor_median 218 ns 215 ns 4
|
||||
ssa::splitf + functor_stddev 4.32 ns 6.14 ns 4
|
||||
ssa::splitf + functor_cv 1.98 % 2.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 1206 ns 1207 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_median 1198 ns 1200 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_stddev 33.2 ns 35.1 ns 4
|
||||
Naive (and wrong) replace symbols with std::string find + replace_cv 2.76 % 2.91 % 4
|
||||
replace symbols with std::string find_first_of + replace_mean 2200 ns 2197 ns 4
|
||||
replace symbols with std::string find_first_of + replace_median 2200 ns 2197 ns 4
|
||||
replace symbols with std::string find_first_of + replace_stddev 7.02 ns 0.000 ns 4
|
||||
replace symbols with std::string find_first_of + replace_cv 0.32 % 0.00 % 4
|
||||
replace symbols with std::string_view find_first_of + copy_mean 2544 ns 2520 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_median 2549 ns 2520 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_stddev 15.3 ns 76.5 ns 4
|
||||
replace symbols with std::string_view find_first_of + copy_cv 0.60 % 3.04 % 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_mean 1663 ns 1659 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_median 1668 ns 1650 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_stddev 23.0 ns 19.2 ns 4
|
||||
replace runtime symbols with string expressions and without remembering all search results_cv 1.38 % 1.16 % 4
|
||||
replace runtime symbols with simstr and memorization of all search results_mean 1442 ns 1444 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_median 1435 ns 1444 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_stddev 18.5 ns 25.6 ns 4
|
||||
replace runtime symbols with simstr and memorization of all search results_cv 1.28 % 1.77 % 4
|
||||
replace const symbols with string expressions and without remembering all search results_mean 1293 ns 1283 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_median 1299 ns 1283 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_stddev 18.4 ns 22.8 ns 4
|
||||
replace const symbols with string expressions and without remembering all search results_cv 1.43 % 1.77 % 4
|
||||
replace const symbols with string expressions and memorization of all search results_mean 1213 ns 1214 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_median 1201 ns 1200 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_stddev 28.8 ns 27.9 ns 4
|
||||
replace const symbols with string expressions and memorization of all search results_cv 2.37 % 2.30 % 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 328 ns 324 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_median 331 ns 326 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_stddev 6.41 ns 7.01 ns 4
|
||||
Short Naive (and wrong) replace symbols with std::string find + replace_cv 1.95 % 2.16 % 4
|
||||
Short replace symbols with std::string find_first_of + replace_mean 420 ns 422 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_median 417 ns 422 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_stddev 5.55 ns 11.7 ns 4
|
||||
Short replace symbols with std::string find_first_of + replace_cv 1.32 % 2.78 % 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_mean 333 ns 332 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_median 333 ns 330 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_stddev 3.60 ns 3.84 ns 4
|
||||
Short replace symbols with std::string_view find_first_of + copy_cv 1.08 % 1.16 % 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_mean 310 ns 308 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_median 309 ns 308 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_stddev 3.87 ns 3.83 ns 4
|
||||
Short replace runtime symbols with string expressions and without remembering all search results_cv 1.25 % 1.24 % 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_mean 401 ns 399 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_median 399 ns 397 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_stddev 9.40 ns 8.35 ns 4
|
||||
Short replace runtime symbols with simstr and memorization of all search results_cv 2.35 % 2.09 % 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_mean 254 ns 254 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_median 252 ns 251 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_stddev 6.10 ns 9.06 ns 4
|
||||
Short replace const symbols with string expressions and without remembering all search results_cv 2.40 % 3.57 % 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_mean 334 ns 335 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_median 333 ns 337 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_stddev 2.88 ns 3.66 ns 4
|
||||
Short replace const symbols with string expressions and memorization of all search results_cv 0.86 % 1.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 242 ns 243 ns 4
|
||||
replace bb to ---- in std::string|64_median 242 ns 243 ns 4
|
||||
replace bb to ---- in std::string|64_stddev 2.02 ns 0.000 ns 4
|
||||
replace bb to ---- in std::string|64_cv 0.83 % 0.00 % 4
|
||||
replace bb to ---- in std::string|256_mean 791 ns 793 ns 4
|
||||
replace bb to ---- in std::string|256_median 792 ns 793 ns 4
|
||||
replace bb to ---- in std::string|256_stddev 10.1 ns 10.1 ns 4
|
||||
replace bb to ---- in std::string|256_cv 1.27 % 1.27 % 4
|
||||
replace bb to ---- in std::string|512_mean 1464 ns 1460 ns 4
|
||||
replace bb to ---- in std::string|512_median 1469 ns 1460 ns 4
|
||||
replace bb to ---- in std::string|512_stddev 13.2 ns 18.1 ns 4
|
||||
replace bb to ---- in std::string|512_cv 0.90 % 1.24 % 4
|
||||
replace bb to ---- in std::string|1024_mean 3204 ns 3209 ns 4
|
||||
replace bb to ---- in std::string|1024_median 3216 ns 3209 ns 4
|
||||
replace bb to ---- in std::string|1024_stddev 60.8 ns 57.0 ns 4
|
||||
replace bb to ---- in std::string|1024_cv 1.90 % 1.77 % 4
|
||||
replace bb to ---- in std::string|2048_mean 8080 ns 8057 ns 4
|
||||
replace bb to ---- in std::string|2048_median 8073 ns 8057 ns 4
|
||||
replace bb to ---- in std::string|2048_stddev 177 ns 270 ns 4
|
||||
replace bb to ---- in std::string|2048_cv 2.19 % 3.35 % 4
|
||||
replace bb to ---- in lstringa<8>|64_mean 225 ns 224 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_median 224 ns 220 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_stddev 7.34 ns 7.85 ns 4
|
||||
replace bb to ---- in lstringa<8>|64_cv 3.26 % 3.51 % 4
|
||||
replace bb to ---- in lstringa<8>|256_mean 655 ns 649 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_median 653 ns 649 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_stddev 10.5 ns 8.05 ns 4
|
||||
replace bb to ---- in lstringa<8>|256_cv 1.60 % 1.24 % 4
|
||||
replace bb to ---- in lstringa<8>|512_mean 1124 ns 1123 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_median 1124 ns 1123 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_stddev 20.7 ns 19.9 ns 4
|
||||
replace bb to ---- in lstringa<8>|512_cv 1.85 % 1.77 % 4
|
||||
replace bb to ---- in lstringa<8>|1024_mean 2038 ns 2040 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_median 2043 ns 2063 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_stddev 39.0 ns 64.1 ns 4
|
||||
replace bb to ---- in lstringa<8>|1024_cv 1.91 % 3.14 % 4
|
||||
replace bb to ---- in lstringa<8>|2048_mean 3964 ns 3899 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_median 3929 ns 3899 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_stddev 127 ns 74.0 ns 4
|
||||
replace bb to ---- in lstringa<8>|2048_cv 3.21 % 1.90 % 4
|
||||
replace bb to ---- by init stringa|64_mean 196 ns 196 ns 4
|
||||
replace bb to ---- by init stringa|64_median 198 ns 197 ns 4
|
||||
replace bb to ---- by init stringa|64_stddev 4.79 ns 5.27 ns 4
|
||||
replace bb to ---- by init stringa|64_cv 2.44 % 2.69 % 4
|
||||
replace bb to ---- by init stringa|256_mean 456 ns 453 ns 4
|
||||
replace bb to ---- by init stringa|256_median 454 ns 455 ns 4
|
||||
replace bb to ---- by init stringa|256_stddev 12.3 ns 10.0 ns 4
|
||||
replace bb to ---- by init stringa|256_cv 2.71 % 2.21 % 4
|
||||
replace bb to ---- by init stringa|512_mean 1064 ns 1057 ns 4
|
||||
replace bb to ---- by init stringa|512_median 1056 ns 1057 ns 4
|
||||
replace bb to ---- by init stringa|512_stddev 18.6 ns 12.1 ns 4
|
||||
replace bb to ---- by init stringa|512_cv 1.75 % 1.14 % 4
|
||||
replace bb to ---- by init stringa|1024_mean 2161 ns 2148 ns 4
|
||||
replace bb to ---- by init stringa|1024_median 2146 ns 2148 ns 4
|
||||
replace bb to ---- by init stringa|1024_stddev 37.6 ns 0.000 ns 4
|
||||
replace bb to ---- by init stringa|1024_cv 1.74 % 0.00 % 4
|
||||
replace bb to ---- by init stringa|2048_mean 4481 ns 4476 ns 4
|
||||
replace bb to ---- by init stringa|2048_median 4468 ns 4501 ns 4
|
||||
replace bb to ---- by init stringa|2048_stddev 83.1 ns 96.8 ns 4
|
||||
replace bb to ---- by init stringa|2048_cv 1.86 % 2.16 % 4
|
||||
----- Replace All Str To Same Size ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
replace bb to -- in std::string|64_mean 198 ns 198 ns 4
|
||||
replace bb to -- in std::string|64_median 196 ns 195 ns 4
|
||||
replace bb to -- in std::string|64_stddev 7.58 ns 9.35 ns 4
|
||||
replace bb to -- in std::string|64_cv 3.84 % 4.73 % 4
|
||||
replace bb to -- in std::string|256_mean 520 ns 520 ns 4
|
||||
replace bb to -- in std::string|256_median 517 ns 516 ns 4
|
||||
replace bb to -- in std::string|256_stddev 13.7 ns 17.6 ns 4
|
||||
replace bb to -- in std::string|256_cv 2.64 % 3.38 % 4
|
||||
replace bb to -- in std::string|512_mean 928 ns 921 ns 4
|
||||
replace bb to -- in std::string|512_median 924 ns 921 ns 4
|
||||
replace bb to -- in std::string|512_stddev 14.1 ns 17.1 ns 4
|
||||
replace bb to -- in std::string|512_cv 1.52 % 1.86 % 4
|
||||
replace bb to -- in std::string|1024_mean 1750 ns 1755 ns 4
|
||||
replace bb to -- in std::string|1024_median 1751 ns 1746 ns 4
|
||||
replace bb to -- in std::string|1024_stddev 33.9 ns 36.7 ns 4
|
||||
replace bb to -- in std::string|1024_cv 1.94 % 2.09 % 4
|
||||
replace bb to -- in std::string|2048_mean 3402 ns 3395 ns 4
|
||||
replace bb to -- in std::string|2048_median 3388 ns 3376 ns 4
|
||||
replace bb to -- in std::string|2048_stddev 44.1 ns 38.4 ns 4
|
||||
replace bb to -- in std::string|2048_cv 1.30 % 1.13 % 4
|
||||
replace bb to -- in lstringa<8>|64_mean 186 ns 185 ns 4
|
||||
replace bb to -- in lstringa<8>|64_median 185 ns 184 ns 4
|
||||
replace bb to -- in lstringa<8>|64_stddev 2.11 ns 5.27 ns 4
|
||||
replace bb to -- in lstringa<8>|64_cv 1.13 % 2.84 % 4
|
||||
replace bb to -- in lstringa<8>|256_mean 442 ns 432 ns 4
|
||||
replace bb to -- in lstringa<8>|256_median 442 ns 435 ns 4
|
||||
replace bb to -- in lstringa<8>|256_stddev 4.20 ns 9.35 ns 4
|
||||
replace bb to -- in lstringa<8>|256_cv 0.95 % 2.16 % 4
|
||||
replace bb to -- in lstringa<8>|512_mean 771 ns 767 ns 4
|
||||
replace bb to -- in lstringa<8>|512_median 772 ns 767 ns 4
|
||||
replace bb to -- in lstringa<8>|512_stddev 8.00 ns 14.2 ns 4
|
||||
replace bb to -- in lstringa<8>|512_cv 1.04 % 1.86 % 4
|
||||
replace bb to -- in lstringa<8>|1024_mean 1457 ns 1456 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_median 1454 ns 1465 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_stddev 11.9 ns 17.4 ns 4
|
||||
replace bb to -- in lstringa<8>|1024_cv 0.82 % 1.20 % 4
|
||||
replace bb to -- in lstringa<8>|2048_mean 2800 ns 2802 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_median 2804 ns 2816 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_stddev 36.9 ns 56.8 ns 4
|
||||
replace bb to -- in lstringa<8>|2048_cv 1.32 % 2.03 % 4
|
||||
replace bb to -- by init stringa|64_mean 165 ns 163 ns 4
|
||||
replace bb to -- by init stringa|64_median 164 ns 164 ns 4
|
||||
replace bb to -- by init stringa|64_stddev 0.342 ns 1.74 ns 4
|
||||
replace bb to -- by init stringa|64_cv 0.21 % 1.07 % 4
|
||||
replace bb to -- by init stringa|256_mean 367 ns 366 ns 4
|
||||
replace bb to -- by init stringa|256_median 369 ns 368 ns 4
|
||||
replace bb to -- by init stringa|256_stddev 3.87 ns 4.19 ns 4
|
||||
replace bb to -- by init stringa|256_cv 1.05 % 1.14 % 4
|
||||
replace bb to -- by init stringa|512_mean 632 ns 628 ns 4
|
||||
replace bb to -- by init stringa|512_median 625 ns 621 ns 4
|
||||
replace bb to -- by init stringa|512_stddev 20.0 ns 19.7 ns 4
|
||||
replace bb to -- by init stringa|512_cv 3.16 % 3.14 % 4
|
||||
replace bb to -- by init stringa|1024_mean 1108 ns 1111 ns 4
|
||||
replace bb to -- by init stringa|1024_median 1113 ns 1123 ns 4
|
||||
replace bb to -- by init stringa|1024_stddev 17.8 ns 24.4 ns 4
|
||||
replace bb to -- by init stringa|1024_cv 1.61 % 2.20 % 4
|
||||
replace bb to -- by init stringa|2048_mean 2118 ns 2120 ns 4
|
||||
replace bb to -- by init stringa|2048_median 2129 ns 2131 ns 4
|
||||
replace bb to -- by init stringa|2048_stddev 52.1 ns 57.1 ns 4
|
||||
replace bb to -- by init stringa|2048_cv 2.46 % 2.69 % 4
|
||||
----- Hash Map insert and find ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
hashStrMapA<size_t> emplace & find stringa;_mean 4479657 ns 4464286 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_median 4475352 ns 4464286 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_stddev 66831 ns 82843 ns 4
|
||||
hashStrMapA<size_t> emplace & find stringa;_cv 1.49 % 1.86 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_mean 6065832 ns 6054688 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_median 6124586 ns 6171875 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_stddev 197357 ns 295776 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string;_cv 3.25 % 4.89 % 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_mean 4127357 ns 4110647 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_median 4151725 ns 4133358 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_stddev 108956 ns 86976 ns 4
|
||||
hashStrMapA<size_t> emplace & find ssa;_cv 2.64 % 2.12 % 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_mean 6592167 ns 6487165 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_median 6513210 ns 6556920 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_stddev 328075 ns 139509 ns 4
|
||||
std::unordered_map<std::string, size_t> emplace & find std::string_view;_cv 4.98 % 2.15 % 4
|
||||
----- Build Full Func Name ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
Build func full name std::string;_mean 1622 ns 1617 ns 4
|
||||
Build func full name std::string;_median 1619 ns 1632 ns 4
|
||||
Build func full name std::string;_stddev 25.8 ns 31.4 ns 4
|
||||
Build func full name std::string;_cv 1.59 % 1.94 % 4
|
||||
Build func full name std::string 1;_mean 1697 ns 1678 ns 4
|
||||
Build func full name std::string 1;_median 1703 ns 1669 ns 4
|
||||
Build func full name std::string 1;_stddev 17.8 ns 36.7 ns 4
|
||||
Build func full name std::string 1;_cv 1.05 % 2.19 % 4
|
||||
Build func full name std::stream;_mean 9698 ns 9644 ns 4
|
||||
Build func full name std::stream;_median 9701 ns 9521 ns 4
|
||||
Build func full name std::stream;_stddev 143 ns 244 ns 4
|
||||
Build func full name std::stream;_cv 1.47 % 2.53 % 4
|
||||
Build func full name stringa;_mean 867 ns 868 ns 4
|
||||
Build func full name stringa;_median 868 ns 868 ns 4
|
||||
Build func full name stringa;_stddev 21.8 ns 12.1 ns 4
|
||||
Build func full name stringa;_cv 2.51 % 1.39 % 4
|
||||
Build func full name stringa 1;_mean 996 ns 994 ns 4
|
||||
Build func full name stringa 1;_median 997 ns 994 ns 4
|
||||
Build func full name stringa 1;_stddev 10.2 ns 12.1 ns 4
|
||||
Build func full name stringa 1;_cv 1.02 % 1.22 % 4
|
||||
----- Make Upper ---------/repeats:1 0.000 ns 0.000 ns 1000000000000
|
||||
To upper case std::wstring_mean 1438 ns 1428 ns 4
|
||||
To upper case std::wstring_median 1439 ns 1428 ns 4
|
||||
To upper case std::wstring_stddev 11.0 ns 18.1 ns 4
|
||||
To upper case std::wstring_cv 0.76 % 1.27 % 4
|
||||
To upper case lstringw<15>_mean 44.4 ns 44.3 ns 4
|
||||
To upper case lstringw<15>_median 44.4 ns 44.7 ns 4
|
||||
To upper case lstringw<15>_stddev 0.322 ns 1.33 ns 4
|
||||
To upper case lstringw<15>_cv 0.73 % 3.01 % 4
|
||||
|
|
@ -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.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
|
||||
|
|
@ -74,7 +74,7 @@ PROJECT_ICON =
|
|||
# entered, it will be relative to the location where Doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = ../_build/docs
|
||||
OUTPUT_DIRECTORY = ../_build/docs/en
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096
|
||||
# sub-directories (in 2 levels) under the output directory of each output format
|
||||
|
|
@ -119,7 +119,7 @@ ALLOW_UNICODE_NAMES = NO
|
|||
# Swedish, Turkish, Ukrainian and Vietnamese.
|
||||
# The default value is: English.
|
||||
|
||||
OUTPUT_LANGUAGE = Russian
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
# If the BRIEF_MEMBER_DESC tag is set to YES, Doxygen will include brief member
|
||||
# descriptions after the members that are listed in the file and class
|
||||
|
|
@ -290,7 +290,8 @@ TAB_SIZE = 4
|
|||
# with the commands \{ and \} for these it is advised to use the version @{ and
|
||||
# @} or use a double escape (\\{ and \\})
|
||||
|
||||
ALIASES =
|
||||
ALIASES = ru=\~russian \
|
||||
en=\~english
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
|
|
@ -991,7 +992,7 @@ WARN_LOGFILE =
|
|||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = ../src ../include
|
||||
INPUT = ../src ../include ../tests
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
|
|
@ -1126,7 +1127,7 @@ EXCLUDE_SYMBOLS =
|
|||
# that contain example code fragments that are included (see the \include
|
||||
# command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATH = ../tests
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
||||
|
|
@ -1389,7 +1390,7 @@ GENERATE_HTML = YES
|
|||
# The default directory is: html.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_OUTPUT = html
|
||||
HTML_OUTPUT = .
|
||||
|
||||
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
|
||||
# generated HTML page (for example: .htm, .php, .asp).
|
||||
|
|
@ -2927,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.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
689
docs/overview.md
689
docs/overview.md
|
|
@ -1,30 +1,31 @@
|
|||
# Строки в С++
|
||||
(, что с вами не так?)
|
||||
# Strings in C++
|
||||
(, what's wrong with you?)
|
||||
|
||||
<span class="obfuscator"><a href="overview_ru.md">On Russian | По-русски</a></span>
|
||||
|
||||
<cite>
|
||||
В ретроспективе 1991 года по истории C++ его создатель Бьярне Страуструп назвал отсутствие стандартного строкового типа
|
||||
(и некоторых других стандартных типов) в C++ 1.0 худшей ошибкой, которую он допустил при его разработке:
|
||||
"the absence of those led to everybody re-inventing the wheel and to an unnecessary diversity in the most fundamental classes"
|
||||
(«Их отсутствие привело к тому, что все заново изобретали велосипед, и к ненужному разнообразию в самых фундаментальных классах»).
|
||||
In a 1991 retrospective on the history of C++, its creator Bjarne Stroustrup called the lack of a standard string type
|
||||
(and some other standard types) in C++ 1.0 the worst mistake he made in its development:
|
||||
"Their absence led to everyone reinventing the wheel and to an unnecessary diversity in the most fundamental classes"
|
||||
</cite>
|
||||
|
||||
## Что было и есть
|
||||
Во вступительной части я хочу немного описать, каково ныне состояние со строками в С++, как мы к нему докатились и почему оно таково.
|
||||
А также описать недостатки текущих реализаций, чтобы были понятны решения, которые я использую в своей библиотеке строк.
|
||||
## What was and is
|
||||
In the introductory part, I want to briefly describe the current state of strings in C++, how we got to it, and why it is so.
|
||||
I will also describe the shortcomings of current implementations so that the solutions I use in my string library are clear.
|
||||
|
||||
Собственно, изначально как такового стандартного типа для строк в С++ не было.
|
||||
Для работы со строками использовался подход из C – строка есть указатель на массив байтов, оканчивающихся нулём.
|
||||
Недостатки таких строк — невозможно в строке использовать байт `0`, т. е. не подходит для бинарных данных,
|
||||
непонятна стратегия управления/владения ресурсами, ну и основной недостаток — длину строки приходится вычислять каждый раз,
|
||||
перебирая все её символы.
|
||||
Actually, initially there was no standard type for strings in C++.
|
||||
The approach from C was used to work with strings – a string is a pointer to an array of bytes ending in zero.
|
||||
The disadvantages of such strings are that it is impossible to use the byte `0` in the string, i.e. it is not suitable for binary data,
|
||||
the resource management/ownership strategy is unclear, and the main disadvantage is that the length of the string has to be calculated each time,
|
||||
iterating over all its characters.
|
||||
|
||||
Откуда ноги растут у такого решения вполне понятно — со времён динозавров: как динозавры были большие, с маленьким мозгом и
|
||||
короткими ручками, так и компьютеры были большие, память у них была маленькая, а строки короткими. Сэкономить память на хранении длины строки было важнее, чем потерять время на повторный подсчет длины.
|
||||
The origin of this solution is quite clear – from the time of the dinosaurs: just as dinosaurs were large, with small brains and
|
||||
short arms, so computers were large, memory was small, and strings were short. Saving memory on storing the length of a string was more important than losing time on repeatedly calculating the length.
|
||||
|
||||
Первые попытки стандартизировать строки как класс начались только в С++98 - std::string появился, как часть STL, и как
|
||||
многое из STL, крайне неоднозначно воспринимался программистами.
|
||||
The first attempts to standardize strings as a class began only in C++98 - std::string appeared as part of STL, and like
|
||||
much of STL, it was extremely ambiguously perceived by programmers.
|
||||
|
||||
И первое, что приходит в голову при улучшении C-строк — надо хранить длину строки:
|
||||
And the first thing that comes to mind when improving C-strings is that you need to store the length of the string:
|
||||
```cpp
|
||||
struct simple_string {
|
||||
const char* data;
|
||||
|
|
@ -32,92 +33,92 @@
|
|||
};
|
||||
```
|
||||
|
||||
При наличии такой строки, уже множество алгоритмов значительно оптимизируются.
|
||||
Например, при сравнении двух строк на равенство мы можем даже не начинать сравнивать их символы, если длины строк не равны.
|
||||
Более того, этих данных абсолютно достаточно для всех методов, которые не модифицируют строку.
|
||||
Также заметим, что такой объект на современных 64-битных архитектурах прекрасно передается в функции по значению —
|
||||
оба его поля укладываются в регистры (ну, кроме windows), что облегчает работу оптимизатору компилятора.
|
||||
With such a string, many algorithms are significantly optimized.
|
||||
For example, when comparing two strings for equality, we may not even start comparing their characters if the lengths of the strings are not equal.
|
||||
Moreover, this data is absolutely sufficient for all methods that do not modify the string.
|
||||
Also note that such an object on modern 64-bit architectures is perfectly passed to functions by value –
|
||||
both of its fields fit into registers (well, except for Windows), which makes it easier for the compiler optimizer to work.
|
||||
|
||||
Между тем, такое решение попало в стандарт только аж в С++17, в виде `std::string_view`.
|
||||
Видимо, только тогда до комитета смогли донести мысль, что строки строкам рознь, и использовать только один универсальный объект
|
||||
для строк — по меньшей мере может приводить к уменьшению производительности, а также нарушает принцип «не плати за то,
|
||||
чем не пользуешься». Почему же «строки строкам рознь» и почему нам мало одного типа для строки, рассмотрим как раз далее.
|
||||
Meanwhile, such a solution only made it into the standard in C++17, in the form of `std::string_view`.
|
||||
Apparently, only then could the committee be convinced that strings are different, and using only one universal object
|
||||
for strings – at the very least, can lead to a decrease in performance, and also violates the principle of "don't pay for what you
|
||||
don't use". Why are "strings different" and why is one type of string not enough for us, we will consider just below.
|
||||
|
||||
### Ресурсы
|
||||
И следующий вопрос, возникающий со строками — это владение ресурсами.
|
||||
Практически каждый крупный фреймворк решал эту задачу самостоятельно, изобретая свои велосипеды.
|
||||
У нас есть `std::string`, в QT у нас `QString`, в MFC - `CString`, в ATL - `CAtlString`, свои строки есть в Folly,
|
||||
в общем, “тысячи их”, любой игровой движок начинают с того, чтобы написать свои строки.
|
||||
### Resources
|
||||
And the next question that arises with strings is resource ownership.
|
||||
Almost every major framework solved this problem on its own, inventing its own bicycles.
|
||||
We have `std::string`, in QT we have `QString`, in MFC - `CString`, in ATL - `CAtlString`, there are own strings in Folly,
|
||||
in general, "thousands of them", any game engine starts with writing its own strings.
|
||||
|
||||
Многие из этих реализаций в аспекте управления ресурсами для улучшения производительности использовали подход
|
||||
**COW** – “Copy On Write”. При этом объект строки ссылался на некий разделяемый между несколькими объектами буфер с символами
|
||||
строки и счётчиком ссылок на этот буфер, что позволяло быстро создавать копию строки, а реально копировать символы только
|
||||
при её модификации.
|
||||
Many of these implementations in the aspect of resource management used the approach to improve performance
|
||||
**COW** – “Copy On Write”. In this case, the string object referred to a buffer shared between several objects with the characters
|
||||
of the string and a reference counter to this buffer, which allowed you to quickly create a copy of the string, and actually copy the characters only
|
||||
when it is modified.
|
||||
|
||||
Но все они совпадали в одном — строка всегда предполагалась мутабельной, то есть что мы можем модифицировать символы в буфере строки.
|
||||
But they all coincided in one thing – the string was always assumed to be mutable, that is, we can modify the characters in the string buffer.
|
||||
|
||||
### Мутабельность / иммутабельность
|
||||
Из-за этого подход **COW** умер к С++11: при каждой операции, могущей модифицировать символы строки приходилось проверять,
|
||||
не ссылаемся ли мы на разделяемый буфер и если да, то копировать символы в другой буфер.
|
||||
В многопоточной же среде потом ещё и проверять, не надо ли теперь освобождать старый буфер, и естественно всё это обмазавшись
|
||||
локами или атомиками, что тоже не бесплатно.
|
||||
Поэтому, начиная с С++11 `std::string` не использует **COW**, и каждое копирование объекта строки приводит и к копированию
|
||||
всех символов строки в другой буфер.
|
||||
### Mutability / immutability
|
||||
Because of this, the **COW** approach died by C++11: for each operation that could modify the characters of the string, it was necessary to check
|
||||
whether we are referring to a shared buffer, and if so, copy the characters to another buffer.
|
||||
In a multithreaded environment, you also need to check whether you now need to free the old buffer, and of course, all this is smeared with
|
||||
locks or atomics, which is also not free.
|
||||
Therefore, starting with C++11, `std::string` does not use **COW**, and each copying of a string object also leads to copying
|
||||
all the characters of the string to another buffer.
|
||||
|
||||
Естественно, что каждый новый буфер требует аллокации памяти, что пытаются немного оптимизировать за счёт **SSO** –
|
||||
“Small String Optimization”, когда объект строки содержит внутри себя небольшой буфер и символы коротких строк
|
||||
располагаются прямо в нём.
|
||||
Но это уже зависит от реализации: в одних библиотеках помещают в объект строки до 15 байт, в некоторых до 23.
|
||||
Однако эта оптимизация тоже палка о двух концах, и может в различных реализациях усложнить перемещение строки - если она хранит
|
||||
указатель на свой внутренний буфер, его придётся корректировать.
|
||||
Naturally, each new buffer requires memory allocation, which they are trying to slightly optimize through **SSO** –
|
||||
“Small String Optimization”, when the string object contains a small buffer inside itself and the characters of short strings
|
||||
are located directly in it.
|
||||
But this already depends on the implementation: in some libraries they place up to 15 bytes in the string object, in some up to 23.
|
||||
However, this optimization is also a double-edged sword, and in various implementations it can complicate the movement of a string - if it stores
|
||||
a pointer to its internal buffer, it will have to be adjusted.
|
||||
|
||||
А без COW мутабельность строк приводит к тому, что любая инициализация объекта строки приводит к копированию байтов.
|
||||
Посмотрим такой код:
|
||||
And without COW, the mutability of strings leads to the fact that any initialization of a string object leads to copying bytes.
|
||||
Let's look at this code:
|
||||
```cpp
|
||||
const char* text1 = "Hello, World"; // ничего не стоит
|
||||
std::string_view text2 = "Hello, World"; // Ничего не стоит, вычисляет длину строки при компиляции
|
||||
std::string text3 = "Hello, World"; // В рантайме каждый раз копирует символы строки
|
||||
const char* text1 = "Hello, World"; // costs nothing
|
||||
std::string_view text2 = "Hello, World"; // Costs nothing, calculates the length of the string at compile time
|
||||
std::string text3 = "Hello, World"; // Copies the characters of the string every time at runtime
|
||||
```
|
||||
|
||||
(Удостоверится в правдивости комментариев можно на https://godbolt.org/z/51oKGWT5T )
|
||||
(You can verify the truth of the comments at https://godbolt.org/z/51oKGWT5T )
|
||||
|
||||
Но если нам дальше по коду не нужно никак модифицировать строку, мы зря платим за аллокацию, копирование символов,
|
||||
а также за деструктор строки. То есть хотелось бы иметь как минимум два варианта строк — мутабельные и иммутабельные,
|
||||
чтобы явно дать понять компилятору, что мы не собираемся модифицировать строку.
|
||||
Или банальный пример — мы парсим какой-то входящий буфер данных, нам нужно проверить, равен ли некий кусок буфера строке
|
||||
”hello” на «чистом С++», т. е. без всяких memcmp и strcmp. До появления string_view приходилось делать примерно так:
|
||||
But if we don’t need to modify the string in any way further in the code, we are wasting money on allocation, copying characters,
|
||||
as well as on the string destructor. That is, I would like to have at least two versions of strings – mutable and immutable,
|
||||
to explicitly make it clear to the compiler that we are not going to modify the string.
|
||||
Or a banal example – we are parsing some incoming data buffer, we need to check whether a certain piece of the buffer is equal to the string
|
||||
"hello" in "pure C++", i.e. without any memcmp and strcmp. Before the advent of string_view, it had to be done something like this:
|
||||
```cpp
|
||||
bool is_part_buffer_equal_hello(const char* data, int start, int end) {
|
||||
return std::string(data + start, end - start) == "hello";
|
||||
}
|
||||
```
|
||||
Тут получается, сначала копируются символы из буфера data в буфер временной строки, возможно с аллокацией памяти, и лишь
|
||||
потом временная строка сравнивается с ”hello”, а потом ещё и деструктор и раскрутка стека на случай исключения.
|
||||
Here it turns out that first the characters from the data buffer are copied to the buffer of the temporary string, possibly with memory allocation, and only
|
||||
then the temporary string is compared with "hello", and then also the destructor and stack unwinding in case of an exception.
|
||||
|
||||
При использовании же вместо `std::string` `std::string_view` – код на C++ почти не меняется:
|
||||
When using `std::string_view` instead of `std::string` – the code in C++ almost does not change:
|
||||
```cpp
|
||||
bool is_part_buffer_equal_hello_view(const char* data, int start, int end) {
|
||||
return std::string_view(data + start, end - start) == "hello";
|
||||
}
|
||||
```
|
||||
Однако генерируемый машинный код значительно преобразуется, достигая уровня ручного С-кода — там просто сравнивается,
|
||||
что end – start == 5 и дальше кусок начального буфера сравнивается через memcmp со строкой ”hello”
|
||||
(при -O2 c константами 1819043176 (’hell’) и 111 (’o’)).
|
||||
Ни создания временного объекта, ни копирования байтов, ни деструктора, ни раскрутки стека для исключений.
|
||||
Убедится можно на https://godbolt.org/z/9fo188e7c
|
||||
However, the generated machine code is significantly transformed, reaching the level of manual C-code – there it is simply compared
|
||||
that end – start == 5 and then a piece of the initial buffer is compared via memcmp with the string "hello"
|
||||
(with -O2 with constants 1819043176 ('hell') and 111 ('o')).
|
||||
No creation of a temporary object, no copying of bytes, no destructor, no stack unwinding for exceptions.
|
||||
You can verify this at https://godbolt.org/z/9fo188e7c
|
||||
|
||||
Казалось бы, ну вот же в С++17 появился `string_view`, пожалуйста, используй его в параметрах своих функций вместо `const std::string&`,
|
||||
и будет счастье. Но тут тоже есть нюанс — всё отлично работает, пока нам не нужно передать строку в стороннее C-API: string_view не даёт
|
||||
гарантий нуль-терминированности строки, поэтому его data() нельзя передать в стороннее C-API, и потому всё-равно придётся сначала
|
||||
скопировать его в `std::string`. А раз нужен `std::string`, то и параметром функции оптимальнее cделать `const std::string&`
|
||||
и далее по цепочке, все параметры вновь станут `const std::string&`.
|
||||
It would seem, well, `string_view` appeared in C++17, please, use it in the parameters of your functions instead of `const std::string&`,
|
||||
and there will be happiness. But there is also a nuance here – everything works fine, as long as we don’t need to pass the string to a third-party C-API: string_view does not give
|
||||
guarantees of null-termination of the string, therefore its data() cannot be passed to a third-party C-API, and therefore you will still have to
|
||||
copy it to `std::string` first. And since `std::string` is needed, then it is more optimal to make `const std::string&` the parameter of the function
|
||||
and further down the chain, all parameters will again become `const std::string&`.
|
||||
|
||||
### Конкатенация строк
|
||||
Далее, после инициализации строки, самая частая мутабельная операция с ними, скорее всего конкатенация строк, либо в виде просто
|
||||
сложения строк, либо добавления строки к строке. И именно она легко может вызывать как неоптимальную производительность при неграмотном
|
||||
использовании, так и оверхед по памяти, даже при грамотном использовании.
|
||||
### String concatenation
|
||||
Next, after initializing a string, the most frequent mutable operation with them is most likely string concatenation, either in the form of simply
|
||||
adding strings, or adding a string to a string. And it is she who can easily cause both suboptimal performance with illiterate
|
||||
use, and memory overhead, even with competent use.
|
||||
|
||||
Рассмотрим простой код ( https://godbolt.org/z/odx7W1Pv7 )
|
||||
Consider a simple code ( https://godbolt.org/z/odx7W1Pv7 )
|
||||
```cpp
|
||||
#include <string>
|
||||
void some_outer_function(const std::string&);
|
||||
|
|
@ -127,9 +128,9 @@
|
|||
some_outer_function(concat);
|
||||
}
|
||||
```
|
||||
Как видим, и в clang, и в GCC создается несколько временных объектов, в которые последовательно перекладываются символы строк,
|
||||
и как результат — мы получаем несколько лишних аллокаций для промежуточных буферов, символы из строк копируются несколько лишних
|
||||
раз из промежуточных буферов. В идеале для лучшей производительности такой код нужно переписать так:
|
||||
As we can see, both in clang and in GCC, several temporary objects are created, into which the characters of the strings are sequentially shifted,
|
||||
and as a result – we get several extra allocations for intermediate buffers, the characters from the strings are copied several extra
|
||||
times from intermediate buffers. Ideally, for better performance, this code needs to be rewritten like this:
|
||||
```cpp
|
||||
#include <string>
|
||||
void some_outer_function(const std::string&);
|
||||
|
|
@ -145,180 +146,187 @@
|
|||
}
|
||||
```
|
||||
|
||||
К сожалению, пока ни один компилятор не оптимизирует первый простой код до уровня второго более оптимального кода, а писать
|
||||
такой код каждый раз руками довольно неудобно. То есть опять приходится платить за то, чем не пользуешься.
|
||||
Да и в этом случае вполне может возникнуть оверхед по памяти — операции добавления строки обычно во всех реализациях увеличивают
|
||||
размер буфера строки не меньше, чем в два раза, считая, что скоро к строке могут снова что-нибудь добавить.
|
||||
Поэтому если строку не планируется более модифицировать, но время её жизни ещё не подошло к концу (например, это поле
|
||||
какого-либо класса), нужно ещё не забыть сделать на ней `shrink_to_fit`.
|
||||
Unfortunately, so far no compiler optimizes the first simple code to the level of the second more optimal code, and writing
|
||||
such code every time by hand is quite inconvenient. That is, again you have to pay for what you don’t use.
|
||||
And in this case, memory overhead may well occur – string addition operations usually increase
|
||||
the size of the string buffer in all implementations by at least two times, assuming that something may soon be added to the string again.
|
||||
Therefore, if the string is no longer planned to be modified, but its lifetime has not yet come to an end (for example, this is a field
|
||||
of some class), you should not forget to do `shrink_to_fit` on it.
|
||||
|
||||
Между тем, часто основной сценарий использования строк — это как раз некая подготовка строки путём нескольких модификаций и конкатенаций,
|
||||
а затем она где-то хранится, более не меняясь. При этом программист обычно знает, примерно какой размер строк ожидается в этом месте,
|
||||
и мог бы выделить буфер для этих промежуточных модификаций прямо на стеке, прибегая к динамической аллокации только при превышении
|
||||
размера этого буфера. Однако с текущей реализацией строк это сделать довольно проблематично, либо неудобно.
|
||||
Meanwhile, often the main scenario for using strings is just some preparation of the string by several modifications and concatenations,
|
||||
and then it is stored somewhere, no longer changing. In this case, the programmer usually knows approximately what size of strings is expected in this place,
|
||||
and could allocate a buffer for these intermediate modifications directly on the stack, resorting to dynamic allocation only when exceeding
|
||||
the size of this buffer. However, with the current implementation of strings, this is quite problematic, or inconvenient.
|
||||
|
||||
Подытожим, что имеем на данный момент:
|
||||
Let's summarize what we have at the moment:
|
||||
|
||||
- «Из коробки» в С++ для работы со строками сейчас имеется `std::string`.
|
||||
- Строки подразумеваются мутабельными, что приводит к обязательному копированию всех символов строки при инициализации и
|
||||
копировании объектов строк.
|
||||
- Соответственно, не имеем возможности быстрого копирования строк, даже если не планируем потом менять копию.
|
||||
- Конкатенация нескольких строк — задача, могущая выполнятся неоптимально, приводить к оверхеду по памяти, написать оптимальный код сложно.
|
||||
- Есть костыль для иммутабельных строк в виде `std::string_view`, однако он не решает вопросы владения строкой, поэтому по сути
|
||||
годится только как тип для передачи параметров в функции, не меняющие строки, с оговоркой, что не может использоваться в функциях,
|
||||
вызывающих C-API, так как не даёт гарантий нуль-терминированности.
|
||||
- Ну и к `std::string` есть вопросы, что несмотря на то, что это класс для строк, собственно для работы со строками в нём крайне куцый
|
||||
функционал по сравнению с тем, к чему привыкли в других языках — к примеру нет замены подстрок по шаблону (в других языках это обычно
|
||||
replace, но в С++ эта функция делает совершенно другое), trim, split, join, upper, lower и т. п.
|
||||
Эти функции приходится каждый раз писать самому, и не факт, что у всех это получится оптимально.
|
||||
- "Out of the box" in C++ for working with strings there is now `std::string`.
|
||||
- Strings are assumed to be mutable, which leads to mandatory copying of all characters of the string during initialization and
|
||||
copying of string objects.
|
||||
- Accordingly, we do not have the ability to quickly copy strings, even if we do not plan to change the copy later.
|
||||
- Concatenating several strings is a task that can be performed suboptimally, lead to memory overhead, and it is difficult to write optimal code.
|
||||
- There is a crutch for immutable strings in the form of `std::string_view`, but it does not solve the issues of string ownership, so in fact
|
||||
it is only suitable as a type for passing parameters to functions that do not change strings, with the caveat that it cannot be used in functions
|
||||
calling C-API, since it does not guarantee null-termination.
|
||||
- Well, and there are questions to `std::string` that despite the fact that this is a class for strings, in fact, for working with strings it has an extremely meager
|
||||
functionality compared to what they are used to in other languages – for example, there is no replacement of substrings by a pattern (in other languages this is usually
|
||||
replace, but in C++ this function does something completely different), trim, split, join, upper, lower, etc.
|
||||
These functions have to be written by yourself every time, and it is not a fact that everyone will be able to do this optimally.
|
||||
|
||||
Надеюсь, после этого небольшого вступления вам будет более понятно, какие проблемы я решал своей строковой библиотекой и каким образом.
|
||||
I hope that after this small introduction you will better understand what problems I solved with my string library and how.
|
||||
|
||||
## Библиотека simstr
|
||||
Собственно, нельзя сказать, что «я свелосипедил свою реализацию класса для строк».
|
||||
Как я ранее показал, сложно, а то и даже невозможно написать один единый строковый класс, хорошо подходящий для всех сценариев
|
||||
использования. Именно поэтому у меня не строковый класс, а строковая библиотека, которая содержит несколько разных строковых типов,
|
||||
от более простых к более сложным, каждый из которых имеет свои сильные и слабые стороны, и пользователю нужно грамотно подходить к
|
||||
вопросу, какой из этих классов в каком случае стоит использовать.
|
||||
## Simstr library
|
||||
Actually, you can't say that "I reinvented my implementation of the class for strings."
|
||||
As I showed earlier, it is difficult, or even impossible, to write one single string class that is well suited for all scenarios
|
||||
of use. That is why I don’t have a string class, but a string library, which contains several different string types,
|
||||
from simpler to more complex, each of which has its own strengths and weaknesses, and the user needs to competently approach the
|
||||
question of which of these classes should be used in which case.
|
||||
|
||||
Саму библиотеку я начал потихоньку разрабатывать ещё в 2011-2012 годах, когда у нас уже появилась семантика перемещения, но ещё
|
||||
не было std::string_view. Однако сейчас минимальная версия стандарта для работы библиотеки: **C++20** – используются концепты и \<format\>.
|
||||
I started developing the library itself little by little back in 2011-2012, when we already had move semantics, but not yet
|
||||
there was std::string_view. However, now the minimum standard version for the library to work is: **C++20** – concepts and \<format\> are used.
|
||||
|
||||
Сначала я расскажу о классах библиотеки для самих строк, а потом о том, как в ней оптимально решается задача конкатенации строк.
|
||||
First, I will talk about the library classes for the strings themselves, and then about how the string concatenation problem is optimally solved in it.
|
||||
|
||||
Несколько общих моментов:
|
||||
- Все классы для работы со строками шаблонизированы типом символов, но подразумевается, что символы могут быть char, char16_t,
|
||||
char32_t, wchar_t.
|
||||
- Все строки имеют явную длину.
|
||||
- Классы владельцы строк хранят их с завершающим нулем в конце, который не входит в длину строки.
|
||||
- В самой строке могут содержаться нулевые символы, все алгоритмы работают только через длину строки, не обращая на них внимания.
|
||||
- Классы владельцы строк могут инициализироваться строками другого типа символов, выполняя конвертацию между UTF-8, UTF-16, UTF-32.
|
||||
- Для смены регистра символов и сравнения строк без учёта регистра используются встроенные таблицы для первой плоскости юникода
|
||||
(до 0xFFFF). Строки считаются представленными в кодировке UTF-8, UTF-16, UTF-32 соответственно.
|
||||
Однако не делается нормализация строк и не обрабатываются ситуации, когда смена регистра символа приводит к изменению их количества.
|
||||
То есть преобразование регистра символов соответствует `std::towupper`, `std::towlower` для unicode локали,
|
||||
только быстрее и может работать с любым видом символов.
|
||||
Если вам нужна строгая работа с юникодом, используйте другие средства, например ICU.
|
||||
Several general points:
|
||||
- All classes for working with strings are templated by the type of characters, but it is assumed that the characters can be `char`, `char8_t`, `char16_t`,
|
||||
`char32_t`, `wchar_t`.
|
||||
- All strings have an explicit length.
|
||||
- The string owner classes store them with a trailing zero at the end, which is not included in the length of the string.
|
||||
- The string itself can contain zero characters, all algorithms work only through the length of the string, without paying attention to them.
|
||||
- The library considers different string types to be "compatible" if they have the same character size.
|
||||
That is, `char` and `char8_t` are always identical, and also in Linux `wchar_t` and `char32_t` are identical, and in Windows `wchar_t` and `char16_t`.
|
||||
- The string owner classes can be initialized with strings of another character type, performing conversion between UTF-8, UTF-16, UTF-32.
|
||||
Moreover, if the strings are of different but compatible types, they are simply copied without conversion.
|
||||
- Built-in tables for the first plane of Unicode are used to change the case of characters and compare strings case-insensitively
|
||||
(up to 0xFFFF). Strings are considered to be represented in UTF-8, UTF-16, UTF-32 encoding, respectively.
|
||||
However, string normalization is not done and situations where changing the case of a character leads to a change in their number are not handled.
|
||||
That is, the case conversion of characters corresponds to `std::towupper`, `std::towlower` for the unicode locale,
|
||||
only faster and can work with any type of characters.
|
||||
If you need strict work with unicode, use other tools, such as ICU.
|
||||
|
||||
### Классы строк.
|
||||
### String classes.
|
||||
|
||||
#### Первый самый простой класс строки называется, естественно, `simple_str` :)
|
||||
#### The first simplest string class is called, of course, `simple_str` :)
|
||||
(simstr::simple_str)
|
||||
|
||||
Класс просто представляет собой указатель на начало константной строки и её длину, по сути то же самое, что `std::string_view`.
|
||||
Предназначен для работы с иммутабельными строками, не владеющий ими, то есть вы должны сами озаботиться тем, что реальная строка,
|
||||
представленная через `simple_str` – жива во время его использования.
|
||||
The class simply represents a pointer to the beginning of a constant string and its length, in fact the same as `std::string_view`.
|
||||
It is intended for working with immutable strings, not owning them, that is, you must take care that the real string,
|
||||
represented through `simple_str` – is alive during its use.
|
||||
|
||||
Реализует все строковые методы, не модифицирующие строку.
|
||||
Implements all string methods that do not modify the string.
|
||||
|
||||
Алиасы:
|
||||
- `ssa` для simple_str\<char\>
|
||||
- `ssu` для simple_str\<char16_t\>
|
||||
- `ssw` для simple_str\<wchar_t>
|
||||
- `ssuu` для simple_str\<char32_t\>
|
||||
Aliases:
|
||||
- `ssa` for simple_str\<char\>
|
||||
- `ssb` for simple_str\<char8_t\>
|
||||
- `ssu` for simple_str\<char16_t\>
|
||||
- `ssw` for simple_str\<wchar_t>
|
||||
- `ssuu` for simple_str\<char32_t\>
|
||||
|
||||
Применяется в основном для передачи строк как параметр функций, не модифицирующих переданную строку, вместо `const std::string&`,
|
||||
а также для локальных переменных при работе с частями строк.
|
||||
It is used mainly for passing strings as a parameter to functions that do not modify the passed string, instead of `const std::string&`,
|
||||
as well as for local variables when working with parts of strings.
|
||||
|
||||
#### Второй класс — `simple_str_nt`
|
||||
#### The second class is `simple_str_nt`
|
||||
(simstr::simple_str_nt)
|
||||
|
||||
По устройству и назначению совпадает с `simple_str`, но дает гарантии нуль-терминированности строки.
|
||||
То есть если функции надо переданный параметр без изменений передать дальше как C-строку в какое то API, она должна использовать для
|
||||
параметра тип `simple_str_nt`.
|
||||
Все классы владеющих строк (simstr::sstring, simstr::lstring) могут быть преобразованы в `simple_str_nt`, так как хранят строки с завершающим нулём.
|
||||
Это позволяет писать функции с единым типом параметра, принимающим на вход любой тип владеющих строковых объектов.
|
||||
In terms of structure and purpose, it coincides with `simple_str`, but guarantees null-termination of the string.
|
||||
That is, if the function needs to pass the passed parameter further as a C-string to some API without changes, it should use the
|
||||
`simple_str_nt` type for the parameter.
|
||||
All classes of owning strings (simstr::sstring, simstr::lstring) can be converted to `simple_str_nt`, since they store strings with a trailing zero.
|
||||
This allows you to write functions with a single parameter type that accepts any type of owning string objects as input.
|
||||
|
||||
Алиасы:
|
||||
- `stra` для simple_str_nt\<char>
|
||||
- `stru` для simple_str_nt\<char16_t>
|
||||
- `strw` для simple_str_nt\<wchar_t>
|
||||
- `struu` для simple_str_nt\<char32_t>
|
||||
Aliases:
|
||||
- `stra` for simple_str_nt\<char>
|
||||
- `strb` for simple_str_nt\<char8_t>
|
||||
- `stru` for simple_str_nt\<char16_t>
|
||||
- `strw` for simple_str_nt\<wchar_t>
|
||||
- `struu` for simple_str_nt\<char32_t>
|
||||
|
||||
Может инициализироваться строковыми литералами:
|
||||
Can be initialized with string literals:
|
||||
```cpp
|
||||
stra text = "Text";
|
||||
```
|
||||
Длина в этом случае вычисляется сразу при компиляции. Аналогично `simple_str_nt` создается с помощью `operator""_ss`:
|
||||
In this case, the length is calculated immediately at compile time. Similarly, `simple_str_nt` is created using `operator""_ss`:
|
||||
|
||||
```cpp
|
||||
stringa result = "Count: "_ss + count;
|
||||
```
|
||||
|
||||
#### Класс sstring (shared string).
|
||||
#### Sstring class (shared string).
|
||||
(simstr::sstring)
|
||||
|
||||
Класс, умеющий хранить иммутабельную строку.
|
||||
То есть ему можно присвоить некую строку только целиком, модифицировать символы строки нельзя.
|
||||
A class that can store an immutable string.
|
||||
That is, you can only assign a string to it entirely, you cannot modify the characters of the string.
|
||||
|
||||
Владеет строкой, управляет памятью для символов строки.
|
||||
Хранит со строками завершающий нуль, и может быть источником для `simple_str_nt`, для передачи в C-API.
|
||||
Так же, как и `simple_str`, реализует все методы, не модифицирующие строку.
|
||||
Owns the string, manages the memory for the characters of the string.
|
||||
Stores a trailing zero with the strings, and can be a source for `simple_str_nt`, for passing to C-API.
|
||||
Like `simple_str`, it implements all methods that do not modify the string.
|
||||
|
||||
Алиасы:
|
||||
- `stringa` для sstring\<char>
|
||||
- `stringu` для sstring\<char16_t>
|
||||
- `stringw` для sstring\<wchar_t>
|
||||
- `stringuu` для sstring\<char32_t>
|
||||
Aliases:
|
||||
- `stringa` for sstring\<char>
|
||||
- `stringb` for sstring\<char8_t>
|
||||
- `stringu` for sstring\<char16_t>
|
||||
- `stringw` for sstring\<wchar_t>
|
||||
- `stringuu` for sstring\<char32_t>
|
||||
|
||||
|
||||
То, что хранимая строка иммутабельна, позволяет применить ряд оптимизаций:
|
||||
- Для строк, не подходящих для SSO, использует общий разделяемый буфер с атомарным счётчиком ссылок.
|
||||
Позволяет быстро копировать строку без необходимости блокировок доступа к содержимому буфера.
|
||||
- Нет необходимости хранить размер буфера (capacity) — всё равно мы ничего не дописываем в буфер.
|
||||
- Позволяет просто ссылаться на литералы программы, не копируя их символы в какой-либо буфер:
|
||||
The fact that the stored string is immutable allows you to apply a number of optimizations:
|
||||
- For strings that are not suitable for SSO, it uses a common shared buffer with an atomic reference counter.
|
||||
Allows you to quickly copy a string without the need to block access to the contents of the buffer.
|
||||
- There is no need to store the buffer size (capacity) – we are not adding anything to the buffer anyway.
|
||||
- Allows you to simply refer to program literals without copying their characters to any buffer:
|
||||
```cpp
|
||||
stringa str = "Hello!"; // Ничего не стоит, не копирует байты строки
|
||||
stringa ltr = stra{"Hello!"}; // А вот тут копирует байты строки в ltr
|
||||
stringa str = "Hello!"; // Costs nothing, does not copy the bytes of the string
|
||||
stringa ltr = stra{"Hello!"}; // But here it copies the bytes of the string to ltr
|
||||
```
|
||||
|
||||
Также в классе применяется **SSO** – Small String Optimization.
|
||||
Короткие строки помещаются внутри самого объекта во внутренний буфер.
|
||||
The class also uses **SSO** – Small String Optimization.
|
||||
Short strings are placed inside the object itself in an internal buffer.
|
||||
|
||||
Размеры:
|
||||
Sizes:
|
||||
|
||||
Для 64 бит:
|
||||
- `stringa` – класс 24 байта, SSO до 23 символов.
|
||||
- `stringu` – класс 32 байта, SSO до 15 символов.
|
||||
- `stringuu` – класс 32 байта, SSO до 7 символов.
|
||||
For 64 bits:
|
||||
- `stringa` – class 24 bytes, SSO up to 23 characters.
|
||||
- `stringu` – class 32 bytes, SSO up to 15 characters.
|
||||
- `stringuu` – class 32 bytes, SSO up to 7 characters.
|
||||
|
||||
Для 32 бит:
|
||||
- `stringa` – класс 16 байт, SSO до 15 символов.
|
||||
- `stringu` – класс 24 байта, SSO до 11 символов.
|
||||
- `stringuu` – класс 24 байта, SSO до 5 символов.
|
||||
For 32 bits:
|
||||
- `stringa` – class 16 bytes, SSO up to 15 characters.
|
||||
- `stringu` – class 24 bytes, SSO up to 11 characters.
|
||||
- `stringuu` – class 24 bytes, SSO up to 5 characters.
|
||||
|
||||
#### Класс lstring<K, N, forShared> (local string)
|
||||
#### Class lstring<K, N, forShared> (local string)
|
||||
(simstr::lstring)
|
||||
|
||||
Класс, хранящий строку и позволяющий её модифицировать.
|
||||
Владеет строкой, управляет памятью для символов строки.
|
||||
Хранит со строками завершающий нуль, и может быть источником для `simple_str_nt`, для передачи в C-API.
|
||||
Как и все остальные классы, реализует все методы, не модифицирующие строку.
|
||||
A class that stores a string and allows it to be modified.
|
||||
Owns the string, manages the memory for the characters of the string.
|
||||
Stores a trailing zero with the strings, and can be a source for `simple_str_nt`, for passing to C-API.
|
||||
Like all other classes, it implements all methods that do not modify the string.
|
||||
|
||||
В качестве `N` в параметре шаблона задаётся размер внутреннего буфера для хранения символов.
|
||||
Строки длиной до N символов хранятся внутри объекта, а при превышении этого количества — аллоцируется динамический буфер,
|
||||
в который сохраняются символы. При копировании объекта все символы также всегда копируются.
|
||||
The size of the internal buffer for storing characters is specified as `N` in the template parameter.
|
||||
Strings up to N characters long are stored inside the object, and when this number is exceeded, a dynamic buffer is allocated,
|
||||
in which the characters are saved. When copying an object, all characters are also always copied.
|
||||
|
||||
Если `forShare` == true и символы не помещаются в локальный буфер, то динамический буфер создается с дополнительным местом,
|
||||
так чтобы совпадать по структуре с буфером `sstring`. Тогда при перемещении `lstring` в `sstring` – переместится только указатель
|
||||
на буфер, без излишнего копирования символов.
|
||||
If `forShare` == true and the characters do not fit into the local buffer, then a dynamic buffer is created with additional space,
|
||||
so that it matches the structure of the `sstring` buffer. Then, when moving `lstring` to `sstring` – only the pointer will move
|
||||
to the buffer, without unnecessary copying of characters.
|
||||
|
||||
Этот класс удобен для работы со строками как локальная переменная на стеке.
|
||||
Обычно мы предполагаем примерный размер строк, с котороми будем работать, и можем создать локальную строку с буфером на стеке,
|
||||
и работать с ней. При этом не опасаясь переполнения буфера, так как в этом случае строка переключится на динамический буфер.
|
||||
This class is convenient for working with strings as a local variable on the stack.
|
||||
Usually we assume the approximate size of the strings we will be working with, and we can create a local string with a buffer on the stack,
|
||||
and work with it. At the same time, without fear of buffer overflow, since in this case the string will switch to a dynamic buffer.
|
||||
|
||||
Алиасы:
|
||||
- `lstringa<N=16>` для lsrting\<char, N, false>
|
||||
- `lstringu<N=16>` для lsrting\<char16_t, N, false>
|
||||
- `lstringw<N=16>` для lsrting\<wchar_t, N, false>
|
||||
- `lstringuu<N=16>` для lsrting\<char32_t, N, false>
|
||||
- `lstringsa<N=16>` для lsrting\<char, N, true>
|
||||
- `lstringsu<N=16>` для lsrting\<char16_t, N, true>
|
||||
- `lstringsw<N=16>` для lsrting\<wchar_t, N, true>
|
||||
- `lstringsuu<N=16>` для lsrting\<char32_t, N, true>
|
||||
Aliases:
|
||||
- `lstringa<N=15>` for lsrting\<char, N, false>
|
||||
- `lstringb<N=15>` for lsrting\<char8_t, N, false>
|
||||
- `lstringu<N=15>` for lsrting\<char16_t, N, false>
|
||||
- `lstringw<N=15>` for lsrting\<wchar_t, N, false>
|
||||
- `lstringuu<N=15>` for lsrting\<char32_t, N, false>
|
||||
- `lstringsa<N=15>` for lsrting\<char, N, true>
|
||||
- `lstringsb<N=15>` for lsrting\<char8_t, N, true>
|
||||
- `lstringsu<N=15>` for lsrting\<char16_t, N, true>
|
||||
- `lstringsw<N=15>` for lsrting\<wchar_t, N, true>
|
||||
- `lstringsuu<N=15>` for lsrting\<char32_t, N, true>
|
||||
|
||||
|
||||
Небольшой пример использования с пояснениями:
|
||||
A small example of use with explanations:
|
||||
```cpp
|
||||
#ifdef _WIN32
|
||||
const char path_separator = '\\';
|
||||
|
|
@ -329,13 +337,13 @@
|
|||
|
||||
auto get_current_dir() {
|
||||
#ifdef _WIN32
|
||||
/* заполняем буфер wchar_t строки lstringw<MAX_PATH> из GetCurrentDirectoryW с возможным
|
||||
увеличением буфера и конвертируем в ut8 char. В конструкторе используется то, что появилось
|
||||
только в С++23 как `resize_and_overwrite`, а у нас было изначально :) */
|
||||
/* fills the buffer of the wchar_t string lstringw<MAX_PATH> from GetCurrentDirectoryW with possible
|
||||
increasing the buffer and converting to ut8 char. The constructor uses what appeared
|
||||
only in C++23 as `resize_and_overwrite`, and we had it originally :) */
|
||||
|
||||
lstringa<MAX_PATH> path{lstringw<MAX_PATH>{ [](auto p, auto s) { return GetCurrentDirectoryW(DWORD(s + 1), p); }}};
|
||||
|
||||
/* Эта одна строчка делает примерно то же самое, что и вот такой код.
|
||||
/* This one line does approximately the same thing as this code.
|
||||
typedef struct lstringa_MAX_PATH_t {
|
||||
char* data;
|
||||
size_t length;
|
||||
|
|
@ -347,11 +355,11 @@
|
|||
wchar_t buffer[MAX_PATH + 1], *buf = buffer;
|
||||
DWORD size = sizeof(buffer) / sizeof(wchar_t), lengthOfpath;
|
||||
for (;;) {
|
||||
// Возвращает либо количество скопированных символов без учёта завершающего нуля,
|
||||
// либо если буфер мал, то нужный размер буфера вместе с завершающим нулём
|
||||
// Returns either the number of copied characters without taking into account the trailing zero,
|
||||
// or if the buffer is small, then the required buffer size along with the trailing zero
|
||||
DWORD ret = GetCurrentDirectoryW(size, buf);
|
||||
if (ret < size) {
|
||||
// Влезло в буфер, хотя в Windows пути могут быть и длиннее, чем MAX_PATH, если начинаются с \\?\
|
||||
// Fits into the buffer, although in Windows paths can be longer than MAX_PATH if they start with \\?\
|
||||
// https://learn.microsoft.com/ru-ru/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
|
||||
lenOfpath = ret;
|
||||
break;
|
||||
|
|
@ -371,14 +379,14 @@
|
|||
lstringa<MAX_PATH> path{ [](char* p, size_t s) {
|
||||
const char* res = getcwd(p, s + 1);
|
||||
if (res) {
|
||||
return stra{res}.length(); // Возвращаем длину строки
|
||||
return stra{res}.length(); // Returns the length of the string
|
||||
}
|
||||
if (errno == ERANGE) // Не влезло в буфер, попробуем в два раза больше
|
||||
if (errno == ERANGE) // Did not fit into the buffer, let's try twice as much
|
||||
return s * 2;
|
||||
return 0ul;
|
||||
}};
|
||||
#endif
|
||||
// Удостоверимся, что строка будет заканчиваться разделителем директорий
|
||||
// Let's make sure that the string will end with a directory separator
|
||||
if (!path.length() || path.at(-1) != path_separator) {
|
||||
path += e_c(1, path_separator);
|
||||
}
|
||||
|
|
@ -388,37 +396,43 @@
|
|||
stringa build_full_path(ssa fileName) {
|
||||
return get_current_dir() + fileName + ".txt";
|
||||
/*
|
||||
Здесь сначала на стеке создастся временный объект lstringa<MAX_PATH> для вызова get_current_dir.
|
||||
Функция get_current_dir заполнит его названием текущего каталога.
|
||||
В 99.9% случаев для этого хватит локального буфера на стеке.
|
||||
После рассчитывается общая длина для результата: длина current_dir + длина fileName + 4.
|
||||
Определяется буфер для строки конечного результата - если длина меньше 24 — строка будет размещена прямо в stringa,
|
||||
иначе аллоцируется буфер для результирующей строки сразу нужного размера.
|
||||
Затем в буфер результирующей строки последовательно копируются символы из current_dir, file_name, ".txt";
|
||||
Ну и благодаря RVO - место для самого результата (stringa) - отводится в вызывающей функции,
|
||||
то есть никакого дополнительного копирования при возврате не будет.
|
||||
Here, a temporary lstringa<MAX_PATH> object will first be created on the stack to call get_current_dir.
|
||||
The get_current_dir function will fill it with the name of the current directory.
|
||||
In 99.9% of cases, the local buffer on the stack will be enough for this.
|
||||
After that, the total length for the result is calculated: the length of current_dir + the length of fileName + 4.
|
||||
The buffer for the string of the final result is determined - if the length is less than 24 - the string will be placed directly in stringa,
|
||||
otherwise a buffer for the resulting string is allocated immediately of the required size.
|
||||
Then the characters from current_dir, file_name, ".txt" are sequentially copied to the buffer of the resulting string;
|
||||
Well, thanks to RVO - the place for the result itself (stringa) - is allocated in the calling function,
|
||||
that is, there will be no additional copying upon return.
|
||||
|
||||
Таким образом, будет максимум всего две аллокации памяти (если current_dir не влезет в MAX_PATH),
|
||||
или одна, если результирующая строка длиннее 23 символов, при этом эта аллокация будет сразу нужного размера.
|
||||
Thus, there will be a maximum of only two memory allocations (if current_dir does not fit into MAX_PATH),
|
||||
or one, if the resulting string is longer than 23 characters, while this allocation will be immediately of the required size.
|
||||
*/
|
||||
}
|
||||
```
|
||||
|
||||
В этом примере вы наверняка заметили, как конкатенируются строки и задались вопросом — как же при двух сложениях считалась
|
||||
длина всего результата, чтобы выделить необходимое место сразу за один раз, без промежуточных буферов?
|
||||
In this example, you probably noticed how strings are concatenated and wondered – how was the
|
||||
length of the entire result calculated with two additions in order to allocate the necessary space at once, without intermediate buffers?
|
||||
|
||||
Ответ на этот вопрос:
|
||||
The answer to this question:
|
||||
|
||||
### Строковые выражения
|
||||
Дело в том, что в библиотеке нет сложения строковых объектов как такового. Сложение выполняется для «строковых выражений».
|
||||
### String Expressions
|
||||
The fact is that there is no addition of string objects as such in the library. Addition is performed for "string expressions".
|
||||
|
||||
*Строковое выражение* — это любой объект произвольного типа, имеющий функции `length` и `place`.
|
||||
Функция `length` – возвращает длину строки, функция `place` – помещает символы строки в переданный ей буфер.
|
||||
A *string expression* is any object of arbitrary type that has `length` and `place` functions.
|
||||
The `length` function returns the length of the string, and the `place` function places the characters of the string into the buffer passed to it.
|
||||
|
||||
Любая владеющая строка (simstr::sstring, simstr::lstring) может инициализироваться строковым выражением — она запрашивает у него длину,
|
||||
выделяет место для хранения символов, и передает это место строковому выражению, вызывая его функцию place.
|
||||
Any owning string (simstr::sstring, simstr::lstring) can be initialized with a string expression — it requests its length,
|
||||
allocates space for storing characters, and passes this space to the string expression, calling its place function.
|
||||
|
||||
Для строковых выражений определена шаблонная функция сложения:
|
||||
In addition, all string expressions included in `simstr` can be converted to standard strings (`std::basic_string`)
|
||||
compatible character types, which allows you to use fast concatenation where replacing `std::string` is not yet possible.
|
||||
Compatible character types are those that match in size.
|
||||
To get a standard string before C++23, using `resize`, and then fill it using `data()`, starting with C++23
|
||||
the more optimal `resize_and_overwrite` is used.
|
||||
|
||||
A template addition function is defined for string expressions:
|
||||
```cpp
|
||||
template<StrExpr A, StrExprForType<typename A::symb_type> B>
|
||||
inline auto operator + (const A& a, const B& b) {
|
||||
|
|
@ -426,10 +440,10 @@
|
|||
}
|
||||
```
|
||||
|
||||
`strexprjoin` – шаблонный тип, который сам является строковым выражением.
|
||||
В себе он хранит ссылки на два переданных ему строковых выражения.
|
||||
При запросе длины он выдает сумму длин двух строковых выражений, а при размещении символов — сначала размещает
|
||||
в переданном буфере первое выражение, затем второе.
|
||||
`strexprjoin` is a template type that is itself a string expression.
|
||||
It stores references to the two string expressions passed to it.
|
||||
When the length is requested, it returns the sum of the lengths of the two string expressions, and when placing characters, it first places
|
||||
the first expression in the passed buffer, then the second.
|
||||
```cpp
|
||||
template<StrExpr A, StrExprForType<typename A::symb_type> B>
|
||||
struct strexprjoin {
|
||||
|
|
@ -441,86 +455,113 @@
|
|||
constexpr symb_type* place(symb_type* p) const noexcept { return b.place(a.place(p)); }
|
||||
};
|
||||
```
|
||||
Таким образом, операция сложения строковых выражений создает объект, также являющийся строковым выражением,
|
||||
к которому также может быть применена следующая операция сложения, и который рекурсивно хранит ссылки на слагаемые части,
|
||||
каждая из которых знает свой размер и умеет размещать себя в буфере результата. И так далее, к каждому получаемому
|
||||
строковому выражению можно снова применить `operator +`, формируя цепочку из нескольких строковых выражений,
|
||||
и в итоге "материализовать" последний получившийся объект, который сначала посчитает размер всей общей памяти для
|
||||
конечного результата, а затем разместит вложенные подвыражения в один буфер.
|
||||
Thus, the addition operation of string expressions creates an object that is also a string expression,
|
||||
to which the next addition operation can also be applied, and which recursively stores references to the component parts,
|
||||
each of which knows its size and knows how to place itself in the result buffer. And so on, to each resulting
|
||||
string expression, you can reapply `operator +`, forming a chain of several string expressions,
|
||||
and eventually "materialize" the last resulting object, which first calculates the size of the entire total memory for
|
||||
the final result, and then places the nested subexpressions into one buffer.
|
||||
|
||||
Все строковые типы библиотеки сами являются строковыми выражениями, то есть могут служить слагаемыми в конкатенациях
|
||||
строковых выражений.
|
||||
The addition operation of string expressions allows you to concatenate string expressions of different but compatible types.
|
||||
That is, in one expression you can mix `""` and `u8""`, in Linux `L""` and `U""`, in Windows `L""` and `u""`
|
||||
character types. There are examples in `tests\test_str.cpp TEST(SimStr, StrPrintfU8)`.
|
||||
|
||||
Также `operator+` определён для строковых выражений и строковых литералов, строковых выражений и чисел (числа конвертируются
|
||||
в десятичное представление), а также вы можете сами добавить желаемые типы.
|
||||
All string types in the library are themselves string expressions, that is, they can serve as terms in concatenations
|
||||
of string expressions.
|
||||
|
||||
Пример:
|
||||
Also, `operator+` is defined for string expressions and string literals, string expressions and numbers (numbers are converted
|
||||
to decimal representation), and you can add the desired types yourself.
|
||||
|
||||
Example:
|
||||
```cpp
|
||||
stringa text = header + " count=" + count + ", done";
|
||||
```
|
||||
|
||||
Существует несколько типов строковых выражений "из коробки", для выполнения различных операций со строками:
|
||||
For standard strings (`std::basic_string` and `std::basic_string_view`) addition operators with strings have also been made
|
||||
expressions, so variables of these types also directly participate in concatenation operations.
|
||||
However, standard strings can only participate directly in string expressions when
|
||||
the other operand is also a string expression. If the other operand is not a string expression,
|
||||
use a unary `operator+` before standard strings to turn `std::basic_string` or `std::basic_string_view`
|
||||
to a string expression.
|
||||
|
||||
#### expr_spaces<ТипСимвола, КоличествоСимволов, Символ = ' '>{}
|
||||
Выдает строку длиной КоличествоСимволов, заполненную заданным символом. Количество символов и символ - константы времени
|
||||
компиляции. Для некоторых случаев есть сокращенная запись:
|
||||
Example:
|
||||
```cpp
|
||||
std::string make_text(const std::string& text, std::string_view what, int count) {
|
||||
// + turns text into a string expression, and then they are added together
|
||||
return +text + " " + count + " " + what + e_if(count > 1, "s");
|
||||
// what participates directly as an operand with a string expression
|
||||
}
|
||||
std::string make_answer(const std::string& text, std::string_view what, int count) {
|
||||
return "Answer is: " + +text + " " + count + " " + what + e_if(count > 1, "s");
|
||||
// + turns text into a string expression, and it can be added to the previous string literal
|
||||
}
|
||||
```
|
||||
That is, the unary `+` is only needed somewhere at the beginning of the expression if the other operand is not a string expression.
|
||||
|
||||
e_spca(КоличествоСимволов) - строка char пробелов
|
||||
e_spcw(КоличествоСимволов) - строка w_char пробелов
|
||||
There are several types of string expressions "out of the box" for performing various operations on strings:
|
||||
|
||||
#### expr_pad<ТипСимвола>{КоличествоСимволов, Символ = ' '}
|
||||
Выдает строку длиной КоличествоСимволов, заполненную заданным символом.
|
||||
Количество символов и символ могут задаваться в рантайме. Сокращенная запись:
|
||||
#### expr_spaces<CharacterType, NumberOfCharacters, Symbol = ' '>{}
|
||||
Returns a string of length NumberOfCharacters, filled with the specified character. The number of characters and the symbol are compile-time constants. For some cases, there is a shorthand notation:
|
||||
|
||||
e_c(КоличествоСимволов, Символ)
|
||||
e_spca(NumberOfCharacters) - string of char spaces
|
||||
e_spcw(NumberOfCharacters) - string of w_char spaces
|
||||
|
||||
#### expr_pad<CharacterType>{NumberOfCharacters, Symbol = ' '}
|
||||
Returns a string of length NumberOfCharacters, filled with the specified character.
|
||||
The number of characters and the symbol can be specified at runtime. Shorthand notation:
|
||||
|
||||
e_c(NumberOfCharacters, Symbol)
|
||||
|
||||
#### e_repeat{Str, count}
|
||||
Generates a repetition of a string literal or expression `Str` `count` times.
|
||||
|
||||
e_repeat("aa", 10);
|
||||
|
||||
#### e_choice(bool Condition, StrExpr1, StrExpr2)
|
||||
Если Condition == true, результат будет равен StrExpr1, иначе StrExpr2.
|
||||
If Condition == true, the result will be StrExpr1, otherwise StrExpr2.
|
||||
|
||||
#### e_if(bool Condition, StrExpr1)
|
||||
Если Condition == true, результат будет равен StrExpr1, иначе пустая строка.
|
||||
If Condition == true, the result will be StrExpr1, otherwise an empty string.
|
||||
|
||||
#### expr_num<ТипСимвола>(ЦелоеЧисло)
|
||||
Конвертирует число в десятичное представление. Редко используется, так как для строковых выражений и чисел
|
||||
переопределен оператор "+", и число можно просто написать как `text + number`;
|
||||
#### expr_num<CharacterType>(Integer)
|
||||
Converts a number to decimal representation. Rarely used, since the "+" operator is overloaded for string expressions and numbers, and the number can simply be written as `text + number`;
|
||||
|
||||
#### expr_real<ТипСимвола>(ВещественноеЧисло)
|
||||
конвертирует число в десятичное представление. Редко используется, так как для строковых выражений и чисел
|
||||
переопределен оператор "+", и число можно просто написать как `text + number`;
|
||||
#### expr_real<CharacterType>(RealNumber)
|
||||
converts a number to decimal representation. Rarely used, since the "+" operator is overloaded for string expressions and numbers, and the number can simply be written as `text + number`;
|
||||
|
||||
#### e_join<bool ПослеПоследнего = false, bool ТолькоНеПустые = false>(контейнер, "Разделитель")
|
||||
Конкатенирует все строки в контейнере, используя разделитель. Если ПослеПоследнего == true,
|
||||
то разделитель добавляется и после последнего элемента контейнера, иначе только между элементами.
|
||||
Если ТолькоНеПустые == true, то пустые строки пропускаются без добавления разделителя.
|
||||
#### e_join<bool AfterLast = false, bool OnlyNotEmpty = false>(container, "Separator")
|
||||
Concatenates all strings in the container, using a separator. If AfterLast == true,
|
||||
then the separator is added after the last element of the container as well, otherwise only between elements.
|
||||
If OnlyNotEmpty == true, then empty strings are skipped without adding a separator.
|
||||
|
||||
#### e_repl(ИсходнаяСтрока, "Искать", "Заменять")
|
||||
Заменяет в исходной строке вхождения "Искать" на "Заменять".
|
||||
Шаблоны поиска и замены - строковые литералы времени компиляции.
|
||||
#### e_repl(OriginalString, "Search", "Replace")
|
||||
Replaces occurrences of "Search" in the original string with "Replace".
|
||||
Search and replace patterns are compile-time string literals.
|
||||
|
||||
#### expr_replaced<ТипСимвола>{ИсходнаяСтрока, Искать, Заменять}
|
||||
Заменяет в исходной строке вхождения Искать на Заменять.
|
||||
Шаблоны поиска и замены - могут быть любыми строковыми объектами в рантайме.
|
||||
#### expr_replaced<CharacterType>{OriginalString, Search, Replace}
|
||||
Replaces occurrences of Search in the original string with Replace.
|
||||
Search and replace patterns can be any string objects at runtime.
|
||||
|
||||
#### empty_expr<ТипСимвола>
|
||||
Выдает пустую строку. Сокращённая запись — eea, eeu, eew, eeuu. Применяется если формирование строки начинается с числа и строкового литерала:
|
||||
#### empty_expr<CharacterType>
|
||||
Returns an empty string. Abbreviated notation — eea, eeu, eew, eeuu. Used if the string formation starts with a number and a string literal:
|
||||
```cpp
|
||||
str = eea + count + " times.";
|
||||
```
|
||||
так как оператор сложения определён только для сложения строкового выражения и числа.
|
||||
Также замечу, что существует `operator""_ss`, который превращает строковый литерал в объект `simple_str_nt`, который уже является строковым выражением:
|
||||
since the addition operator is only defined for adding a string expression and a number.
|
||||
I also note that there is `operator""_ss`, which turns a string literal into a `simple_str_nt` object, which is already a string expression:
|
||||
```cpp
|
||||
str = "Count = "_ss + count;
|
||||
...
|
||||
str = count + " times."_ss;
|
||||
```
|
||||
|
||||
#### Свои строковые выражения
|
||||
Вы можете сами создавать свои типы строковых выражений для оптимального формирования строк в нужных вам целях и алгоритмах.
|
||||
Для этого просто создайте тип с методами `length`, `place` и `typename symb_type`.
|
||||
Примеры создания и использования из реальных проектов:
|
||||
#### Your own string expressions
|
||||
You can create your own string expression types to optimally form strings for your specific purposes and algorithms.
|
||||
To do this, simply create a type with `length`, `place` and `typename symb_type` methods.
|
||||
Examples of creation and use from real projects:
|
||||
|
||||
```cpp
|
||||
/* Сформировать строку в JSON формате, в 16 битных символах */
|
||||
/* Form a string in JSON format, in 16-bit characters */
|
||||
struct expr_json_str {
|
||||
using symb_type = u16s;
|
||||
ssu text;
|
||||
|
|
@ -607,7 +648,7 @@ inline u16s* expr_json_str::place(u16s* ptr) const noexcept {
|
|||
}
|
||||
```
|
||||
|
||||
Использование:
|
||||
Usage:
|
||||
|
||||
```cpp
|
||||
........
|
||||
|
|
@ -617,9 +658,9 @@ vtText << uR"({"#type":"jxs:string","#value":")" + expr_json_str(name) + u"\"}";
|
|||
.......
|
||||
```
|
||||
|
||||
Ещё пример
|
||||
Another example
|
||||
```cpp
|
||||
/* Нужно сформировать бинарные данные в BASE64 формате, в 16 битных символах */
|
||||
/* Need to form binary data in BASE64 format, in 16-bit characters */
|
||||
struct expr_str_base64 {
|
||||
using symb_type = u16s;
|
||||
ssa text;
|
||||
|
|
@ -660,7 +701,7 @@ inline u16s* expr_str_base64::place(u16s* ptr) const noexcept {
|
|||
}
|
||||
```
|
||||
|
||||
Использование:
|
||||
Usage:
|
||||
```cpp
|
||||
......
|
||||
chunked_string_builder<u16s> vtText;
|
||||
|
|
@ -669,10 +710,10 @@ vtText << u"{\"#\",87126200-3e98-44e0-b931-ccb1d7edc497,{1,{#base64:" + expr_str
|
|||
......
|
||||
```
|
||||
|
||||
И ещё
|
||||
And more
|
||||
|
||||
```cpp
|
||||
/* Нужно преобразовать tm в строку даты/времени в 16-битных символах */
|
||||
/* Need to convert tm to a date/time string in 16-bit characters */
|
||||
struct expr_str_tm {
|
||||
using symb_type = u16s;
|
||||
const tm& t;
|
||||
|
|
@ -685,11 +726,11 @@ struct expr_str_tm {
|
|||
|
||||
inline u16s* expr_str_tm::place(u16s* ptr) const noexcept {
|
||||
if constexpr (sizeof(wchar_t) == 2) {
|
||||
// Под Windows можно сразу форматнуть строку в нужный буфер
|
||||
// Under Windows, you can immediately format the string into the desired buffer
|
||||
std::swprintf((wchar_t*)ptr, 20, L"%04i-%02i-%02i %02i:%02i:%02i", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec);
|
||||
} else {
|
||||
// Сначала форматнём в промежуточный буфер, потом скопируем в результат
|
||||
// First, format into an intermediate buffer, then copy to the result
|
||||
char buf[20];
|
||||
std::snprintf(buf, 20, "%04i-%02i-%02i %02i:%02i:%02i", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour,
|
||||
t.tm_min, t.tm_sec);
|
||||
|
|
@ -701,7 +742,7 @@ inline u16s* expr_str_tm::place(u16s* ptr) const noexcept {
|
|||
}
|
||||
```
|
||||
|
||||
Использование
|
||||
Usage
|
||||
|
||||
```cpp
|
||||
......
|
||||
|
|
@ -717,31 +758,31 @@ bool makeBind(SqliteQuery& query, tVariant& param, unsigned paramNum) {
|
|||
......
|
||||
```
|
||||
|
||||
ВНИМАНИЕ: обычно поля в объектах строковых выражений являются ссылками на исходные данные.
|
||||
И ссылки эти почти всегда ведут на локальные или временные объекты. Поэтому крайне рискованно возвращать строковые выражения
|
||||
из функций — надо сто раз проверить, что в них не попали ссылки на локальные или временные переменные.
|
||||
Возьмите за правило — можно легко передавать строковые выражения в функции, и опасно возвращать их из функций.
|
||||
Лучше при возврате материализовать строковое выражение в строковый объект, содержащий итоговую строку.
|
||||
При желании тип возвращаемой строки можно задать шаблонным параметром.
|
||||
ATTENTION: usually the fields in string expression objects are references to the source data.
|
||||
And these references almost always lead to local or temporary objects. Therefore, it is extremely risky to return string expressions
|
||||
from functions — you need to check a hundred times that they do not contain references to local or temporary variables.
|
||||
Make it a rule — you can easily pass string expressions to functions, and it is dangerous to return them from functions.
|
||||
It is better to materialize a string expression into a string object containing the final string when returning.
|
||||
If desired, the type of the returned string can be specified by a template parameter.
|
||||
|
||||
|
||||
### Класс chunked_string_builder
|
||||
### Class chunked_string_builder
|
||||
|
||||
Предназначен для конкатенации множества строк.
|
||||
Когда вам нужно последовательно формировать длинный текст из множества небольших кусочков (например, формируете html ответ
|
||||
и т. п.) - последовательно складывать всё в один строковый объект крайне неоптимально — будет много переаллокаций и
|
||||
перекопирования уже накопленных символов. В этом случае удобно использовать chunked_string_builder — всё, что он умеет,
|
||||
это прибавлять строку к накопленным символам. Однако делает он это не в единый последовательный буфер памяти, а в отдельные
|
||||
буфера, не меньше чем заданное выравнивание. При заполнении очередного буфера он просто создает ещё один буфер и продолжает
|
||||
складывать данные в него.
|
||||
Designed for concatenating multiple strings.
|
||||
When you need to sequentially form a long text from many small pieces (for example, you are forming an html response
|
||||
etc.) - sequentially adding everything to one string object is extremely suboptimal - there will be many reallocations and
|
||||
copying of already accumulated characters. In this case, it is convenient to use chunked_string_builder - all it can do is
|
||||
add a string to the accumulated characters. However, it does this not in a single sequential memory buffer, but in separate
|
||||
buffers, no less than the specified alignment. When filling the next buffer, it simply creates another buffer and continues
|
||||
to add data to it.
|
||||
|
||||
То есть допустим вы задали выравнивание 1024.
|
||||
Добавили несколько строк, заполнили буфер на 100 символов. И добавляете строку длинной 3000 символов.
|
||||
При этом 924 символа скопируются в первый буфер, заполнив его до конца.
|
||||
Для оставшихся 2076 создастся буфер размером 3072 символа, и они скопируются в него, в нём останется место для 996 символов.
|
||||
Так последовательно каждый буфер заполняется до конца, и имеет размер кратный заданному выравниванию.
|
||||
Таким образом избегаются переаллокации и перекопирование обработанных символов.
|
||||
That is, suppose you set the alignment to 1024.
|
||||
Added several strings, filled the buffer with 100 characters. And you add a string of 3000 characters long.
|
||||
In this case, 924 characters will be copied to the first buffer, filling it to the end.
|
||||
For the remaining 2076, a buffer of 3072 characters will be created, and they will be copied into it, leaving space for 996 characters in it.
|
||||
Thus, each buffer is sequentially filled to the end and has a size that is a multiple of the specified alignment.
|
||||
This avoids reallocations and copying of processed characters.
|
||||
|
||||
После окончательного заполнения вы можете работать с накопленными данными — либо слить все буфера в одну последовательную
|
||||
строку (размер для буфера которой вы теперь уже знаете), либо перебирать их по отдельности, например, посылая эти буфера
|
||||
в сеть. Либо последовательно копируя данные в буфер заданного размера.
|
||||
After the final filling, you can work with the accumulated data - either merge all the buffers into one sequential
|
||||
string (the size for the buffer of which you now already know), or iterate over them separately, for example, sending these buffers
|
||||
to the network. Or sequentially copying data into a buffer of a given size.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,793 @@
|
|||
# Строки в С++
|
||||
(, что с вами не так?)
|
||||
|
||||
<span class="obfuscator"><a href="overview.md">On English | По-английски</a></span>
|
||||
|
||||
<cite>
|
||||
В ретроспективе 1991 года по истории C++ его создатель Бьярне Страуструп назвал отсутствие стандартного строкового типа
|
||||
(и некоторых других стандартных типов) в C++ 1.0 худшей ошибкой, которую он допустил при его разработке:
|
||||
"the absence of those led to everybody re-inventing the wheel and to an unnecessary diversity in the most fundamental classes"
|
||||
(«Их отсутствие привело к тому, что все заново изобретали велосипед, и к ненужному разнообразию в самых фундаментальных классах»).
|
||||
</cite>
|
||||
|
||||
## Что было и есть
|
||||
Во вступительной части я хочу немного описать, каково ныне состояние со строками в С++, как мы к нему докатились и почему оно таково.
|
||||
А также описать недостатки текущих реализаций, чтобы были понятны решения, которые я использую в своей библиотеке строк.
|
||||
|
||||
Собственно, изначально как такового стандартного типа для строк в С++ не было.
|
||||
Для работы со строками использовался подход из C – строка есть указатель на массив байтов, оканчивающихся нулём.
|
||||
Недостатки таких строк — невозможно в строке использовать байт `0`, т. е. не подходит для бинарных данных,
|
||||
непонятна стратегия управления/владения ресурсами, ну и основной недостаток — длину строки приходится вычислять каждый раз,
|
||||
перебирая все её символы.
|
||||
|
||||
Откуда ноги растут у такого решения вполне понятно — со времён динозавров: как динозавры были большие, с маленьким мозгом и
|
||||
короткими ручками, так и компьютеры были большие, память у них была маленькая, а строки короткими. Сэкономить память на хранении длины строки было важнее, чем потерять время на повторный подсчет длины.
|
||||
|
||||
Первые попытки стандартизировать строки как класс начались только в С++98 - std::string появился, как часть STL, и как
|
||||
многое из STL, крайне неоднозначно воспринимался программистами.
|
||||
|
||||
И первое, что приходит в голову при улучшении C-строк — надо хранить длину строки:
|
||||
```cpp
|
||||
struct simple_string {
|
||||
const char* data;
|
||||
size_t length;
|
||||
};
|
||||
```
|
||||
|
||||
При наличии такой строки, уже множество алгоритмов значительно оптимизируются.
|
||||
Например, при сравнении двух строк на равенство мы можем даже не начинать сравнивать их символы, если длины строк не равны.
|
||||
Более того, этих данных абсолютно достаточно для всех методов, которые не модифицируют строку.
|
||||
Также заметим, что такой объект на современных 64-битных архитектурах прекрасно передается в функции по значению —
|
||||
оба его поля укладываются в регистры (ну, кроме windows), что облегчает работу оптимизатору компилятора.
|
||||
|
||||
Между тем, такое решение попало в стандарт только аж в С++17, в виде `std::string_view`.
|
||||
Видимо, только тогда до комитета смогли донести мысль, что строки строкам рознь, и использовать только один универсальный объект
|
||||
для строк — по меньшей мере может приводить к уменьшению производительности, а также нарушает принцип «не плати за то,
|
||||
чем не пользуешься». Почему же «строки строкам рознь» и почему нам мало одного типа для строки, рассмотрим как раз далее.
|
||||
|
||||
### Ресурсы
|
||||
И следующий вопрос, возникающий со строками — это владение ресурсами.
|
||||
Практически каждый крупный фреймворк решал эту задачу самостоятельно, изобретая свои велосипеды.
|
||||
У нас есть `std::string`, в QT у нас `QString`, в MFC - `CString`, в ATL - `CAtlString`, свои строки есть в Folly,
|
||||
в общем, “тысячи их”, любой игровой движок начинают с того, чтобы написать свои строки.
|
||||
|
||||
Многие из этих реализаций в аспекте управления ресурсами для улучшения производительности использовали подход
|
||||
**COW** – “Copy On Write”. При этом объект строки ссылался на некий разделяемый между несколькими объектами буфер с символами
|
||||
строки и счётчиком ссылок на этот буфер, что позволяло быстро создавать копию строки, а реально копировать символы только
|
||||
при её модификации.
|
||||
|
||||
Но все они совпадали в одном — строка всегда предполагалась мутабельной, то есть что мы можем модифицировать символы в буфере строки.
|
||||
|
||||
### Мутабельность / иммутабельность
|
||||
Из-за этого подход **COW** умер к С++11: при каждой операции, могущей модифицировать символы строки приходилось проверять,
|
||||
не ссылаемся ли мы на разделяемый буфер и если да, то копировать символы в другой буфер.
|
||||
В многопоточной же среде потом ещё и проверять, не надо ли теперь освобождать старый буфер, и естественно всё это обмазавшись
|
||||
локами или атомиками, что тоже не бесплатно.
|
||||
Поэтому, начиная с С++11 `std::string` не использует **COW**, и каждое копирование объекта строки приводит и к копированию
|
||||
всех символов строки в другой буфер.
|
||||
|
||||
Естественно, что каждый новый буфер требует аллокации памяти, что пытаются немного оптимизировать за счёт **SSO** –
|
||||
“Small String Optimization”, когда объект строки содержит внутри себя небольшой буфер и символы коротких строк
|
||||
располагаются прямо в нём.
|
||||
Но это уже зависит от реализации: в одних библиотеках помещают в объект строки до 15 байт, в некоторых до 23.
|
||||
Однако эта оптимизация тоже палка о двух концах, и может в различных реализациях усложнить перемещение строки - если она хранит
|
||||
указатель на свой внутренний буфер, его придётся корректировать.
|
||||
|
||||
А без COW мутабельность строк приводит к тому, что любая инициализация объекта строки приводит к копированию байтов.
|
||||
Посмотрим такой код:
|
||||
```cpp
|
||||
const char* text1 = "Hello, World"; // ничего не стоит
|
||||
std::string_view text2 = "Hello, World"; // Ничего не стоит, вычисляет длину строки при компиляции
|
||||
std::string text3 = "Hello, World"; // В рантайме каждый раз копирует символы строки
|
||||
```
|
||||
|
||||
(Удостоверится в правдивости комментариев можно на https://godbolt.org/z/51oKGWT5T )
|
||||
|
||||
Но если нам дальше по коду не нужно никак модифицировать строку, мы зря платим за аллокацию, копирование символов,
|
||||
а также за деструктор строки. То есть хотелось бы иметь как минимум два варианта строк — мутабельные и иммутабельные,
|
||||
чтобы явно дать понять компилятору, что мы не собираемся модифицировать строку.
|
||||
Или банальный пример — мы парсим какой-то входящий буфер данных, нам нужно проверить, равен ли некий кусок буфера строке
|
||||
”hello” на «чистом С++», т. е. без всяких memcmp и strcmp. До появления string_view приходилось делать примерно так:
|
||||
```cpp
|
||||
bool is_part_buffer_equal_hello(const char* data, int start, int end) {
|
||||
return std::string(data + start, end - start) == "hello";
|
||||
}
|
||||
```
|
||||
Тут получается, сначала копируются символы из буфера data в буфер временной строки, возможно с аллокацией памяти, и лишь
|
||||
потом временная строка сравнивается с ”hello”, а потом ещё и деструктор и раскрутка стека на случай исключения.
|
||||
|
||||
При использовании же вместо `std::string` `std::string_view` – код на C++ почти не меняется:
|
||||
```cpp
|
||||
bool is_part_buffer_equal_hello_view(const char* data, int start, int end) {
|
||||
return std::string_view(data + start, end - start) == "hello";
|
||||
}
|
||||
```
|
||||
Однако генерируемый машинный код значительно преобразуется, достигая уровня ручного С-кода — там просто сравнивается,
|
||||
что end – start == 5 и дальше кусок начального буфера сравнивается через memcmp со строкой ”hello”
|
||||
(при -O2 c константами 1819043176 (’hell’) и 111 (’o’)).
|
||||
Ни создания временного объекта, ни копирования байтов, ни деструктора, ни раскрутки стека для исключений.
|
||||
Убедится можно на https://godbolt.org/z/9fo188e7c
|
||||
|
||||
Казалось бы, ну вот же в С++17 появился `string_view`, пожалуйста, используй его в параметрах своих функций вместо `const std::string&`,
|
||||
и будет счастье. Но тут тоже есть нюанс — всё отлично работает, пока нам не нужно передать строку в стороннее C-API: string_view не даёт
|
||||
гарантий нуль-терминированности строки, поэтому его data() нельзя передать в стороннее C-API, и потому всё-равно придётся сначала
|
||||
скопировать его в `std::string`. А раз нужен `std::string`, то и параметром функции оптимальнее cделать `const std::string&`
|
||||
и далее по цепочке, все параметры вновь станут `const std::string&`.
|
||||
|
||||
### Конкатенация строк
|
||||
Далее, после инициализации строки, самая частая мутабельная операция с ними, скорее всего конкатенация строк, либо в виде просто
|
||||
сложения строк, либо добавления строки к строке. И именно она легко может вызывать как неоптимальную производительность при неграмотном
|
||||
использовании, так и оверхед по памяти, даже при грамотном использовании.
|
||||
|
||||
Рассмотрим простой код ( https://godbolt.org/z/odx7W1Pv7 )
|
||||
```cpp
|
||||
#include <string>
|
||||
void some_outer_function(const std::string&);
|
||||
|
||||
void func(const std::string& s1, const std::string& s2) {
|
||||
std::string concat = s1 + s2 + "hello";
|
||||
some_outer_function(concat);
|
||||
}
|
||||
```
|
||||
Как видим, и в clang, и в GCC создается несколько временных объектов, в которые последовательно перекладываются символы строк,
|
||||
и как результат — мы получаем несколько лишних аллокаций для промежуточных буферов, символы из строк копируются несколько лишних
|
||||
раз из промежуточных буферов. В идеале для лучшей производительности такой код нужно переписать так:
|
||||
```cpp
|
||||
#include <string>
|
||||
void some_outer_function(const std::string&);
|
||||
|
||||
void func(const std::string& s1, const std::string& s2) {
|
||||
static const std::string_view hello = "hello";
|
||||
std::string concat;
|
||||
concat.reserve(s1.size() + s2.size() + hello.size());
|
||||
concat += s1;
|
||||
concat += s2;
|
||||
concat += hello;
|
||||
some_outer_function(concat);
|
||||
}
|
||||
```
|
||||
|
||||
К сожалению, пока ни один компилятор не оптимизирует первый простой код до уровня второго более оптимального кода, а писать
|
||||
такой код каждый раз руками довольно неудобно. То есть опять приходится платить за то, чем не пользуешься.
|
||||
Да и в этом случае вполне может возникнуть оверхед по памяти — операции добавления строки обычно во всех реализациях увеличивают
|
||||
размер буфера строки не меньше, чем в два раза, считая, что скоро к строке могут снова что-нибудь добавить.
|
||||
Поэтому если строку не планируется более модифицировать, но время её жизни ещё не подошло к концу (например, это поле
|
||||
какого-либо класса), нужно ещё не забыть сделать на ней `shrink_to_fit`.
|
||||
|
||||
Между тем, часто основной сценарий использования строк — это как раз некая подготовка строки путём нескольких модификаций и конкатенаций,
|
||||
а затем она где-то хранится, более не меняясь. При этом программист обычно знает, примерно какой размер строк ожидается в этом месте,
|
||||
и мог бы выделить буфер для этих промежуточных модификаций прямо на стеке, прибегая к динамической аллокации только при превышении
|
||||
размера этого буфера. Однако с текущей реализацией строк это сделать довольно проблематично, либо неудобно.
|
||||
|
||||
Подытожим, что имеем на данный момент:
|
||||
|
||||
- «Из коробки» в С++ для работы со строками сейчас имеется `std::string`.
|
||||
- Строки подразумеваются мутабельными, что приводит к обязательному копированию всех символов строки при инициализации и
|
||||
копировании объектов строк.
|
||||
- Соответственно, не имеем возможности быстрого копирования строк, даже если не планируем потом менять копию.
|
||||
- Конкатенация нескольких строк — задача, могущая выполнятся неоптимально, приводить к оверхеду по памяти, написать оптимальный код сложно.
|
||||
- Есть костыль для иммутабельных строк в виде `std::string_view`, однако он не решает вопросы владения строкой, поэтому по сути
|
||||
годится только как тип для передачи параметров в функции, не меняющие строки, с оговоркой, что не может использоваться в функциях,
|
||||
вызывающих C-API, так как не даёт гарантий нуль-терминированности.
|
||||
- Ну и к `std::string` есть вопросы, что несмотря на то, что это класс для строк, собственно для работы со строками в нём крайне куцый
|
||||
функционал по сравнению с тем, к чему привыкли в других языках — к примеру нет замены подстрок по шаблону (в других языках это обычно
|
||||
replace, но в С++ эта функция делает совершенно другое), trim, split, join, upper, lower и т. п.
|
||||
Эти функции приходится каждый раз писать самому, и не факт, что у всех это получится оптимально.
|
||||
|
||||
Надеюсь, после этого небольшого вступления вам будет более понятно, какие проблемы я решал своей строковой библиотекой и каким образом.
|
||||
|
||||
## Библиотека simstr
|
||||
Собственно, нельзя сказать, что «я свелосипедил свою реализацию класса для строк».
|
||||
Как я ранее показал, сложно, а то и даже невозможно написать один единый строковый класс, хорошо подходящий для всех сценариев
|
||||
использования. Именно поэтому у меня не строковый класс, а строковая библиотека, которая содержит несколько разных строковых типов,
|
||||
от более простых к более сложным, каждый из которых имеет свои сильные и слабые стороны, и пользователю нужно грамотно подходить к
|
||||
вопросу, какой из этих классов в каком случае стоит использовать.
|
||||
|
||||
Саму библиотеку я начал потихоньку разрабатывать ещё в 2011-2012 годах, когда у нас уже появилась семантика перемещения, но ещё
|
||||
не было std::string_view. Однако сейчас минимальная версия стандарта для работы библиотеки: **C++20** – используются концепты и \<format\>.
|
||||
|
||||
Сначала я расскажу о классах библиотеки для самих строк, а потом о том, как в ней оптимально решается задача конкатенации строк.
|
||||
|
||||
Несколько общих моментов:
|
||||
- Все классы для работы со строками шаблонизированы типом символов, но подразумевается, что символы могут быть `char`, `char8_t`, `char16_t`,
|
||||
`char32_t`, `wchar_t`.
|
||||
- Все строки имеют явную длину.
|
||||
- Классы владельцы строк хранят их с завершающим нулем в конце, который не входит в длину строки.
|
||||
- В самой строке могут содержаться нулевые символы, все алгоритмы работают только через длину строки, не обращая на них внимания.
|
||||
- Библиотека считает разные строковые типы "совместимыми", если они имеют одинаковый размер символов.
|
||||
То есть `char` и `char8_t` всегда тождественны, а также в Linux тождественны `wchar_t` и `char32_t`, а в Windows `wchar_t` и `char16_t`.
|
||||
- Классы владельцы строк могут инициализироваться строками другого типа символов, выполняя конвертацию между UTF-8, UTF-16, UTF-32.
|
||||
При этом если строки разных, но совместимых типов, они просто копируются без конвертации.
|
||||
- Для смены регистра символов и сравнения строк без учёта регистра используются встроенные таблицы для первой плоскости юникода
|
||||
(до 0xFFFF). Строки считаются представленными в кодировке UTF-8, UTF-16, UTF-32 соответственно.
|
||||
Однако не делается нормализация строк и не обрабатываются ситуации, когда смена регистра символа приводит к изменению их количества.
|
||||
То есть преобразование регистра символов соответствует `std::towupper`, `std::towlower` для unicode локали,
|
||||
только быстрее и может работать с любым видом символов.
|
||||
Если вам нужна строгая работа с юникодом, используйте другие средства, например ICU.
|
||||
|
||||
### Классы строк.
|
||||
|
||||
#### Первый самый простой класс строки называется, естественно, `simple_str` :)
|
||||
(simstr::simple_str)
|
||||
|
||||
Класс просто представляет собой указатель на начало константной строки и её длину, по сути то же самое, что `std::string_view`.
|
||||
Предназначен для работы с иммутабельными строками, не владеющий ими, то есть вы должны сами озаботиться тем, что реальная строка,
|
||||
представленная через `simple_str` – жива во время его использования.
|
||||
|
||||
Реализует все строковые методы, не модифицирующие строку.
|
||||
|
||||
Алиасы:
|
||||
- `ssa` для simple_str\<char\>
|
||||
- `ssb` для simple_str\<char8_t\>
|
||||
- `ssu` для simple_str\<char16_t\>
|
||||
- `ssw` для simple_str\<wchar_t>
|
||||
- `ssuu` для simple_str\<char32_t\>
|
||||
|
||||
Применяется в основном для передачи строк как параметр функций, не модифицирующих переданную строку, вместо `const std::string&`,
|
||||
а также для локальных переменных при работе с частями строк.
|
||||
|
||||
#### Второй класс — `simple_str_nt`
|
||||
(simstr::simple_str_nt)
|
||||
|
||||
По устройству и назначению совпадает с `simple_str`, но дает гарантии нуль-терминированности строки.
|
||||
То есть если функции надо переданный параметр без изменений передать дальше как C-строку в какое то API, она должна использовать для
|
||||
параметра тип `simple_str_nt`.
|
||||
Все классы владеющих строк (simstr::sstring, simstr::lstring) могут быть преобразованы в `simple_str_nt`, так как хранят строки с завершающим нулём.
|
||||
Это позволяет писать функции с единым типом параметра, принимающим на вход любой тип владеющих строковых объектов.
|
||||
|
||||
Алиасы:
|
||||
- `stra` для simple_str_nt\<char>
|
||||
- `strb` для simple_str_nt\<char8_t>
|
||||
- `stru` для simple_str_nt\<char16_t>
|
||||
- `strw` для simple_str_nt\<wchar_t>
|
||||
- `struu` для simple_str_nt\<char32_t>
|
||||
|
||||
Может инициализироваться строковыми литералами:
|
||||
```cpp
|
||||
stra text = "Text";
|
||||
```
|
||||
Длина в этом случае вычисляется сразу при компиляции. Аналогично `simple_str_nt` создается с помощью `operator""_ss`:
|
||||
|
||||
```cpp
|
||||
stringa result = "Count: "_ss + count;
|
||||
```
|
||||
|
||||
#### Класс sstring (shared string).
|
||||
(simstr::sstring)
|
||||
|
||||
Класс, умеющий хранить иммутабельную строку.
|
||||
То есть ему можно присвоить некую строку только целиком, модифицировать символы строки нельзя.
|
||||
|
||||
Владеет строкой, управляет памятью для символов строки.
|
||||
Хранит со строками завершающий нуль, и может быть источником для `simple_str_nt`, для передачи в C-API.
|
||||
Так же, как и `simple_str`, реализует все методы, не модифицирующие строку.
|
||||
|
||||
Алиасы:
|
||||
- `stringa` для sstring\<char>
|
||||
- `stringb` для sstring\<char8_t>
|
||||
- `stringu` для sstring\<char16_t>
|
||||
- `stringw` для sstring\<wchar_t>
|
||||
- `stringuu` для sstring\<char32_t>
|
||||
|
||||
|
||||
То, что хранимая строка иммутабельна, позволяет применить ряд оптимизаций:
|
||||
- Для строк, не подходящих для SSO, использует общий разделяемый буфер с атомарным счётчиком ссылок.
|
||||
Позволяет быстро копировать строку без необходимости блокировок доступа к содержимому буфера.
|
||||
- Нет необходимости хранить размер буфера (capacity) — всё равно мы ничего не дописываем в буфер.
|
||||
- Позволяет просто ссылаться на литералы программы, не копируя их символы в какой-либо буфер:
|
||||
```cpp
|
||||
stringa str = "Hello!"; // Ничего не стоит, не копирует байты строки
|
||||
stringa ltr = stra{"Hello!"}; // А вот тут копирует байты строки в ltr
|
||||
```
|
||||
|
||||
Также в классе применяется **SSO** – Small String Optimization.
|
||||
Короткие строки помещаются внутри самого объекта во внутренний буфер.
|
||||
|
||||
Размеры:
|
||||
|
||||
Для 64 бит:
|
||||
- `stringa` – класс 24 байта, SSO до 23 символов.
|
||||
- `stringu` – класс 32 байта, SSO до 15 символов.
|
||||
- `stringuu` – класс 32 байта, SSO до 7 символов.
|
||||
|
||||
Для 32 бит:
|
||||
- `stringa` – класс 16 байт, SSO до 15 символов.
|
||||
- `stringu` – класс 24 байта, SSO до 11 символов.
|
||||
- `stringuu` – класс 24 байта, SSO до 5 символов.
|
||||
|
||||
#### Класс lstring<K, N, forShared> (local string)
|
||||
(simstr::lstring)
|
||||
|
||||
Класс, хранящий строку и позволяющий её модифицировать.
|
||||
Владеет строкой, управляет памятью для символов строки.
|
||||
Хранит со строками завершающий нуль, и может быть источником для `simple_str_nt`, для передачи в C-API.
|
||||
Как и все остальные классы, реализует все методы, не модифицирующие строку.
|
||||
|
||||
В качестве `N` в параметре шаблона задаётся размер внутреннего буфера для хранения символов.
|
||||
Строки длиной до N символов хранятся внутри объекта, а при превышении этого количества — аллоцируется динамический буфер,
|
||||
в который сохраняются символы. При копировании объекта все символы также всегда копируются.
|
||||
|
||||
Если `forShare` == true и символы не помещаются в локальный буфер, то динамический буфер создается с дополнительным местом,
|
||||
так чтобы совпадать по структуре с буфером `sstring`. Тогда при перемещении `lstring` в `sstring` – переместится только указатель
|
||||
на буфер, без излишнего копирования символов.
|
||||
|
||||
Этот класс удобен для работы со строками как локальная переменная на стеке.
|
||||
Обычно мы предполагаем примерный размер строк, с котороми будем работать, и можем создать локальную строку с буфером на стеке,
|
||||
и работать с ней. При этом не опасаясь переполнения буфера, так как в этом случае строка переключится на динамический буфер.
|
||||
|
||||
Алиасы:
|
||||
- `lstringa<N=15>` для lsrting\<char, N, false>
|
||||
- `lstringb<N=15>` для lsrting\<char8_t, N, false>
|
||||
- `lstringu<N=15>` для lsrting\<char16_t, N, false>
|
||||
- `lstringw<N=15>` для lsrting\<wchar_t, N, false>
|
||||
- `lstringuu<N=15>` для lsrting\<char32_t, N, false>
|
||||
- `lstringsa<N=15>` для lsrting\<char, N, true>
|
||||
- `lstringsb<N=15>` для lsrting\<char8_t, N, true>
|
||||
- `lstringsu<N=15>` для lsrting\<char16_t, N, true>
|
||||
- `lstringsw<N=15>` для lsrting\<wchar_t, N, true>
|
||||
- `lstringsuu<N=15>` для lsrting\<char32_t, N, true>
|
||||
|
||||
|
||||
Небольшой пример использования с пояснениями:
|
||||
```cpp
|
||||
#ifdef _WIN32
|
||||
const char path_separator = '\\';
|
||||
#else
|
||||
const size_t MAX_PATH = 260;
|
||||
const char path_separator = '/';
|
||||
#endif
|
||||
|
||||
auto get_current_dir() {
|
||||
#ifdef _WIN32
|
||||
/* заполняем буфер wchar_t строки lstringw<MAX_PATH> из GetCurrentDirectoryW с возможным
|
||||
увеличением буфера и конвертируем в ut8 char. В конструкторе используется то, что появилось
|
||||
только в С++23 как `resize_and_overwrite`, а у нас было изначально :) */
|
||||
|
||||
lstringa<MAX_PATH> path{lstringw<MAX_PATH>{ [](auto p, auto s) { return GetCurrentDirectoryW(DWORD(s + 1), p); }}};
|
||||
|
||||
/* Эта одна строчка делает примерно то же самое, что и вот такой код.
|
||||
typedef struct lstringa_MAX_PATH_t {
|
||||
char* data;
|
||||
size_t length;
|
||||
size_t capacity;
|
||||
char local_buffer[MAX_PATH + 1];
|
||||
} lstringa_MAX_PATH;
|
||||
|
||||
lstringa_MAX_PATH* get_current_dir(lstringa_MAX_PATH* result) {
|
||||
wchar_t buffer[MAX_PATH + 1], *buf = buffer;
|
||||
DWORD size = sizeof(buffer) / sizeof(wchar_t), lengthOfpath;
|
||||
for (;;) {
|
||||
// Возвращает либо количество скопированных символов без учёта завершающего нуля,
|
||||
// либо если буфер мал, то нужный размер буфера вместе с завершающим нулём
|
||||
DWORD ret = GetCurrentDirectoryW(size, buf);
|
||||
if (ret < size) {
|
||||
// Влезло в буфер, хотя в Windows пути могут быть и длиннее, чем MAX_PATH, если начинаются с \\?\
|
||||
// https://learn.microsoft.com/ru-ru/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
|
||||
lenOfpath = ret;
|
||||
break;
|
||||
}
|
||||
size = ret;
|
||||
if (buf != buffer)
|
||||
free(buf);
|
||||
buf = malloc(size);
|
||||
}
|
||||
utf16toUtf8(buf, lengthOfPath, result);
|
||||
if (buf != buffer)
|
||||
free(buf);
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
#else
|
||||
lstringa<MAX_PATH> path{ [](char* p, size_t s) {
|
||||
const char* res = getcwd(p, s + 1);
|
||||
if (res) {
|
||||
return stra{res}.length(); // Возвращаем длину строки
|
||||
}
|
||||
if (errno == ERANGE) // Не влезло в буфер, попробуем в два раза больше
|
||||
return s * 2;
|
||||
return 0ul;
|
||||
}};
|
||||
#endif
|
||||
// Удостоверимся, что строка будет заканчиваться разделителем директорий
|
||||
if (!path.length() || path.at(-1) != path_separator) {
|
||||
path += e_c(1, path_separator);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
stringa build_full_path(ssa fileName) {
|
||||
return get_current_dir() + fileName + ".txt";
|
||||
/*
|
||||
Здесь сначала на стеке создастся временный объект lstringa<MAX_PATH> для вызова get_current_dir.
|
||||
Функция get_current_dir заполнит его названием текущего каталога.
|
||||
В 99.9% случаев для этого хватит локального буфера на стеке.
|
||||
После рассчитывается общая длина для результата: длина current_dir + длина fileName + 4.
|
||||
Определяется буфер для строки конечного результата - если длина меньше 24 — строка будет размещена прямо в stringa,
|
||||
иначе аллоцируется буфер для результирующей строки сразу нужного размера.
|
||||
Затем в буфер результирующей строки последовательно копируются символы из current_dir, file_name, ".txt";
|
||||
Ну и благодаря RVO - место для самого результата (stringa) - отводится в вызывающей функции,
|
||||
то есть никакого дополнительного копирования при возврате не будет.
|
||||
|
||||
Таким образом, будет максимум всего две аллокации памяти (если current_dir не влезет в MAX_PATH),
|
||||
или одна, если результирующая строка длиннее 23 символов, при этом эта аллокация будет сразу нужного размера.
|
||||
*/
|
||||
}
|
||||
```
|
||||
|
||||
В этом примере вы наверняка заметили, как конкатенируются строки и задались вопросом — как же при двух сложениях считалась
|
||||
длина всего результата, чтобы выделить необходимое место сразу за один раз, без промежуточных буферов?
|
||||
|
||||
Ответ на этот вопрос:
|
||||
|
||||
### Строковые выражения
|
||||
Дело в том, что в библиотеке нет сложения строковых объектов как такового. Сложение выполняется для «строковых выражений».
|
||||
|
||||
*Строковое выражение* — это любой объект произвольного типа, имеющий функции `length` и `place`.
|
||||
Функция `length` – возвращает длину строки, функция `place` – помещает символы строки в переданный ей буфер.
|
||||
|
||||
Любая владеющая строка (simstr::sstring, simstr::lstring) может инициализироваться строковым выражением — она запрашивает у него длину,
|
||||
выделяет место для хранения символов, и передает это место строковому выражению, вызывая его функцию place.
|
||||
|
||||
Кроме того, все входящие в `simstr` строковые выражения могут преобразовываться в стандартные строки (`std::basic_string`)
|
||||
совместимых типов символов, что позволяет применять быструю конкатенацию там, где заменить `std::string` пока невозможно.
|
||||
Совместимые типы символов - такие, которые совпадают по размеру.
|
||||
Для получения стандартной строки до C++23 используется `resize`, а потом заполнение через `data()`, начиная с C++23
|
||||
используется более оптимальный `resize_and_overwrite`.
|
||||
|
||||
Для строковых выражений определена шаблонная функция сложения:
|
||||
```cpp
|
||||
template<StrExpr A, StrExprForType<typename A::symb_type> B>
|
||||
inline auto operator + (const A& a, const B& b) {
|
||||
return strexprjoin<A, B>{a, b};
|
||||
}
|
||||
```
|
||||
|
||||
`strexprjoin` – шаблонный тип, который сам является строковым выражением.
|
||||
В себе он хранит ссылки на два переданных ему строковых выражения.
|
||||
При запросе длины он выдает сумму длин двух строковых выражений, а при размещении символов — сначала размещает
|
||||
в переданном буфере первое выражение, затем второе.
|
||||
```cpp
|
||||
template<StrExpr A, StrExprForType<typename A::symb_type> B>
|
||||
struct strexprjoin {
|
||||
using symb_type = typename A::symb_type;
|
||||
const A& a;
|
||||
const B& b;
|
||||
constexpr strexprjoin(const A& a_, const B& b_) : a(a_), b(b_){}
|
||||
constexpr size_t length() const noexcept { return a.length() + b.length(); }
|
||||
constexpr symb_type* place(symb_type* p) const noexcept { return b.place(a.place(p)); }
|
||||
};
|
||||
```
|
||||
Таким образом, операция сложения строковых выражений создает объект, также являющийся строковым выражением,
|
||||
к которому также может быть применена следующая операция сложения, и который рекурсивно хранит ссылки на слагаемые части,
|
||||
каждая из которых знает свой размер и умеет размещать себя в буфере результата. И так далее, к каждому получаемому
|
||||
строковому выражению можно снова применить `operator +`, формируя цепочку из нескольких строковых выражений,
|
||||
и в итоге "материализовать" последний получившийся объект, который сначала посчитает размер всей общей памяти для
|
||||
конечного результата, а затем разместит вложенные подвыражения в один буфер.
|
||||
|
||||
Операция сложения строковых выражений позволяет конкатенировать строковые выражения разных, но совместимых типов.
|
||||
То есть в одном выражении вы можете смешивать `""` и `u8""`, в Linux `L""` и `U""`, в Windows `L""` и `u""`
|
||||
типы символов. Примеры есть в `tests\test_str.cpp TEST(SimStr, StrPrintfU8)`.
|
||||
|
||||
Все строковые типы библиотеки сами являются строковыми выражениями, то есть могут служить слагаемыми в конкатенациях
|
||||
строковых выражений.
|
||||
|
||||
Также `operator+` определён для строковых выражений и строковых литералов, строковых выражений и чисел (числа конвертируются
|
||||
в десятичное представление), а также вы можете сами добавить желаемые типы.
|
||||
|
||||
Пример:
|
||||
```cpp
|
||||
stringa text = header + " count=" + count + ", done";
|
||||
```
|
||||
|
||||
Для стандартных строк (`std::basic_string` и `std::basic_string_view`) также сделаны операторы сложения со строковыми
|
||||
выражениями, поэтому переменные этих типов также напрямую участвовать в операциях конкатенирования.
|
||||
Однако cтандартные строки могут напрямую участвовать в строковых выражениях только когда
|
||||
другой операнд тоже является строковым выражением. Если другой операнд - не строковое выражение,
|
||||
используйте перед стандартными строками унарный `operator+`, чтобы превратить `std::basic_string` или `std::basic_string_view`
|
||||
в строковое выражение.
|
||||
|
||||
Пример:
|
||||
```cpp
|
||||
std::string make_text(const std::string& text, std::string_view what, int count) {
|
||||
// + превращает text в строковое выражение, а дальше они уже складываются между собой
|
||||
return +text + " " + count + " " + what + e_if(count > 1, "s");
|
||||
// what участвует уже напрямую как операнд со стороковым выражением
|
||||
}
|
||||
std::string make_answer(const std::string& text, std::string_view what, int count) {
|
||||
return "Answer is: " + +text + " " + count + " " + what + e_if(count > 1, "s");
|
||||
// + превращает text в строковое выражени, и оно может быть сложено с предыдущим строковым литералом
|
||||
}
|
||||
```
|
||||
То есть унарный `+` нужен только где-то в начале выражения, если другой операнд не строковое выражение.
|
||||
|
||||
Существует несколько типов строковых выражений "из коробки", для выполнения различных операций со строками:
|
||||
|
||||
#### expr_spaces<ТипСимвола, КоличествоСимволов, Символ = ' '>{}
|
||||
Выдает строку длиной КоличествоСимволов, заполненную заданным символом. Количество символов и символ - константы времени
|
||||
компиляции. Для некоторых случаев есть сокращенная запись:
|
||||
|
||||
e_spca(КоличествоСимволов) - строка char пробелов
|
||||
e_spcw(КоличествоСимволов) - строка w_char пробелов
|
||||
|
||||
#### expr_pad<ТипСимвола>{КоличествоСимволов, Символ = ' '}
|
||||
Выдает строку длиной КоличествоСимволов, заполненную заданным символом.
|
||||
Количество символов и символ могут задаваться в рантайме. Сокращенная запись:
|
||||
|
||||
e_c(КоличествоСимволов, Символ)
|
||||
|
||||
#### e_repeat{Str, count}
|
||||
Генерирует повторение строкового литерала или выражения `Str` `count` раз.
|
||||
|
||||
e_repeat("aa", 10);
|
||||
|
||||
#### e_choice(bool Condition, StrExpr1, StrExpr2)
|
||||
Если Condition == true, результат будет равен StrExpr1, иначе StrExpr2.
|
||||
|
||||
#### e_if(bool Condition, StrExpr1)
|
||||
Если Condition == true, результат будет равен StrExpr1, иначе пустая строка.
|
||||
|
||||
#### expr_num<ТипСимвола>(ЦелоеЧисло)
|
||||
Конвертирует число в десятичное представление. Редко используется, так как для строковых выражений и чисел
|
||||
переопределен оператор "+", и число можно просто написать как `text + number`;
|
||||
|
||||
#### expr_real<ТипСимвола>(ВещественноеЧисло)
|
||||
конвертирует число в десятичное представление. Редко используется, так как для строковых выражений и чисел
|
||||
переопределен оператор "+", и число можно просто написать как `text + number`;
|
||||
|
||||
#### e_join<bool ПослеПоследнего = false, bool ТолькоНеПустые = false>(контейнер, "Разделитель")
|
||||
Конкатенирует все строки в контейнере, используя разделитель. Если ПослеПоследнего == true,
|
||||
то разделитель добавляется и после последнего элемента контейнера, иначе только между элементами.
|
||||
Если ТолькоНеПустые == true, то пустые строки пропускаются без добавления разделителя.
|
||||
|
||||
#### e_repl(ИсходнаяСтрока, "Искать", "Заменять")
|
||||
Заменяет в исходной строке вхождения "Искать" на "Заменять".
|
||||
Шаблоны поиска и замены - строковые литералы времени компиляции.
|
||||
|
||||
#### expr_replaced<ТипСимвола>{ИсходнаяСтрока, Искать, Заменять}
|
||||
Заменяет в исходной строке вхождения Искать на Заменять.
|
||||
Шаблоны поиска и замены - могут быть любыми строковыми объектами в рантайме.
|
||||
|
||||
#### empty_expr<ТипСимвола>
|
||||
Выдает пустую строку. Сокращённая запись — eea, eeu, eew, eeuu. Применяется если формирование строки начинается с числа и строкового литерала:
|
||||
```cpp
|
||||
str = eea + count + " times.";
|
||||
```
|
||||
так как оператор сложения определён только для сложения строкового выражения и числа.
|
||||
Также замечу, что существует `operator""_ss`, который превращает строковый литерал в объект `simple_str_nt`, который уже является строковым выражением:
|
||||
```cpp
|
||||
str = "Count = "_ss + count;
|
||||
...
|
||||
str = count + " times."_ss;
|
||||
```
|
||||
|
||||
#### Свои строковые выражения
|
||||
Вы можете сами создавать свои типы строковых выражений для оптимального формирования строк в нужных вам целях и алгоритмах.
|
||||
Для этого просто создайте тип с методами `length`, `place` и `typename symb_type`.
|
||||
Примеры создания и использования из реальных проектов:
|
||||
|
||||
```cpp
|
||||
/* Сформировать строку в JSON формате, в 16 битных символах */
|
||||
struct expr_json_str {
|
||||
using symb_type = u16s;
|
||||
ssu text;
|
||||
size_t l;
|
||||
size_t length() const noexcept {
|
||||
return l;
|
||||
}
|
||||
u16s* place(u16s* ptr) const noexcept;
|
||||
expr_json_str(ssu t);
|
||||
};
|
||||
|
||||
inline expr_json_str::expr_json_str(ssu t) : text(t) {
|
||||
const u16s* ptr = text.symbols();
|
||||
size_t add = 0;
|
||||
|
||||
for (size_t i = 0; i < text.length(); i++) {
|
||||
switch (*ptr++) {
|
||||
case '\b':
|
||||
case '\f':
|
||||
case '\r':
|
||||
case '\n':
|
||||
case '\t':
|
||||
case '\"':
|
||||
case '\\':
|
||||
add++;
|
||||
}
|
||||
}
|
||||
l = text.len + add;
|
||||
}
|
||||
|
||||
inline u16s* expr_json_str::place(u16s* ptr) const noexcept {
|
||||
const u16s *r = text.symbols();
|
||||
size_t lenOfText = text.length(), lenOfTail = l;
|
||||
while (lenOfTail > lenOfText) {
|
||||
u16s s = *r++;
|
||||
switch (s) {
|
||||
case '\b':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = 'b';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\f':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = 'f';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\r':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = 'r';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\n':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = 'n';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\t':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = 't';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\"':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = '\"';
|
||||
lenOfTail--;
|
||||
break;
|
||||
case '\\':
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = '\\';
|
||||
lenOfTail--;
|
||||
break;
|
||||
default:
|
||||
*ptr++ = s;
|
||||
break;
|
||||
}
|
||||
lenOfTail--;
|
||||
lenOfText--;
|
||||
}
|
||||
if (lenOfTail) {
|
||||
std::char_traits<u16s>::copy(ptr, r, lenOfTail);
|
||||
ptr += lenOfTail;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
```
|
||||
|
||||
Использование:
|
||||
|
||||
```cpp
|
||||
........
|
||||
chunked_string_builder<u16s> vtText;
|
||||
........
|
||||
vtText << uR"({"#type":"jxs:string","#value":")" + expr_json_str(name) + u"\"}";
|
||||
.......
|
||||
```
|
||||
|
||||
Ещё пример
|
||||
```cpp
|
||||
/* Нужно сформировать бинарные данные в BASE64 формате, в 16 битных символах */
|
||||
struct expr_str_base64 {
|
||||
using symb_type = u16s;
|
||||
ssa text;
|
||||
size_t length() const noexcept {
|
||||
return (text.len + 2) / 3 * 4;
|
||||
}
|
||||
u16s* place(u16s* ptr) const noexcept;
|
||||
expr_str_base64(ssa t) : text(t) {}
|
||||
};
|
||||
|
||||
inline u16s* expr_str_base64::place(u16s* ptr) const noexcept {
|
||||
static constexpr u8s alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
const unsigned char* t = (const unsigned char*)text.str;
|
||||
|
||||
size_t i = 0;
|
||||
if (text.len > 2) {
|
||||
for (; i < text.len - 2; i += 3) {
|
||||
*ptr++ = alphabet[(t[i] >> 2) & 0x3F];
|
||||
*ptr++ = alphabet[((t[i] & 0x3) << 4) | ((int)(t[i + 1] & 0xF0) >> 4)];
|
||||
*ptr++ = alphabet[((t[i + 1] & 0xF) << 2) | ((int)(t[i + 2] & 0xC0) >> 6)];
|
||||
*ptr++ = alphabet[t[i + 2] & 0x3F];
|
||||
}
|
||||
}
|
||||
|
||||
if (i < text.len) {
|
||||
*ptr++ = alphabet[(t[i] >> 2) & 0x3F];
|
||||
if (i == (text.len - 1)) {
|
||||
*ptr++ = alphabet[((t[i] & 0x3) << 4)];
|
||||
*ptr++ = '=';
|
||||
} else {
|
||||
*ptr++ = alphabet[((t[i] & 0x3) << 4) | ((int)(t[i + 1] & 0xF0) >> 4)];
|
||||
*ptr++ = alphabet[((t[i + 1] & 0xF) << 2)];
|
||||
}
|
||||
*ptr++ = '=';
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
```
|
||||
|
||||
Использование:
|
||||
```cpp
|
||||
......
|
||||
chunked_string_builder<u16s> vtText;
|
||||
......
|
||||
vtText << u"{\"#\",87126200-3e98-44e0-b931-ccb1d7edc497,{1,{#base64:" + expr_str_base64(v) + u"}}},";
|
||||
......
|
||||
```
|
||||
|
||||
И ещё
|
||||
|
||||
```cpp
|
||||
/* Нужно преобразовать tm в строку даты/времени в 16-битных символах */
|
||||
struct expr_str_tm {
|
||||
using symb_type = u16s;
|
||||
const tm& t;
|
||||
size_t length() const noexcept {
|
||||
return 19;
|
||||
}
|
||||
u16s* place(u16s* ptr) const noexcept;
|
||||
expr_str_tm(const tm& _t) : t(_t) {}
|
||||
};
|
||||
|
||||
inline u16s* expr_str_tm::place(u16s* ptr) const noexcept {
|
||||
if constexpr (sizeof(wchar_t) == 2) {
|
||||
// Под Windows можно сразу форматнуть строку в нужный буфер
|
||||
std::swprintf((wchar_t*)ptr, 20, L"%04i-%02i-%02i %02i:%02i:%02i", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec);
|
||||
} else {
|
||||
// Сначала форматнём в промежуточный буфер, потом скопируем в результат
|
||||
char buf[20];
|
||||
std::snprintf(buf, 20, "%04i-%02i-%02i %02i:%02i:%02i", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour,
|
||||
t.tm_min, t.tm_sec);
|
||||
for (unsigned i = 0; i < 19; i++) {
|
||||
ptr[i] = buf[i];
|
||||
}
|
||||
}
|
||||
return ptr + 19;
|
||||
}
|
||||
```
|
||||
|
||||
Использование
|
||||
|
||||
```cpp
|
||||
......
|
||||
bool makeBind(SqliteQuery& query, tVariant& param, unsigned paramNum) {
|
||||
switch (param.vt) {
|
||||
......
|
||||
case VTYPE_DATE:
|
||||
query.bind(paramNum, lstringu<30>{expr_str_tm{winDateToTm(param.date)}}.to_str());
|
||||
break;
|
||||
case VTYPE_TM:
|
||||
query.bind(paramNum, lstringu<30>{expr_str_tm{param.tmVal}}.to_str());
|
||||
break;
|
||||
......
|
||||
```
|
||||
|
||||
ВНИМАНИЕ: обычно поля в объектах строковых выражений являются ссылками на исходные данные.
|
||||
И ссылки эти почти всегда ведут на локальные или временные объекты. Поэтому крайне рискованно возвращать строковые выражения
|
||||
из функций — надо сто раз проверить, что в них не попали ссылки на локальные или временные переменные.
|
||||
Возьмите за правило — можно легко передавать строковые выражения в функции, и опасно возвращать их из функций.
|
||||
Лучше при возврате материализовать строковое выражение в строковый объект, содержащий итоговую строку.
|
||||
При желании тип возвращаемой строки можно задать шаблонным параметром.
|
||||
|
||||
|
||||
### Класс chunked_string_builder
|
||||
|
||||
Предназначен для конкатенации множества строк.
|
||||
Когда вам нужно последовательно формировать длинный текст из множества небольших кусочков (например, формируете html ответ
|
||||
и т. п.) - последовательно складывать всё в один строковый объект крайне неоптимально — будет много переаллокаций и
|
||||
перекопирования уже накопленных символов. В этом случае удобно использовать chunked_string_builder — всё, что он умеет,
|
||||
это прибавлять строку к накопленным символам. Однако делает он это не в единый последовательный буфер памяти, а в отдельные
|
||||
буфера, не меньше чем заданное выравнивание. При заполнении очередного буфера он просто создает ещё один буфер и продолжает
|
||||
складывать данные в него.
|
||||
|
||||
То есть допустим вы задали выравнивание 1024.
|
||||
Добавили несколько строк, заполнили буфер на 100 символов. И добавляете строку длинной 3000 символов.
|
||||
При этом 924 символа скопируются в первый буфер, заполнив его до конца.
|
||||
Для оставшихся 2076 создастся буфер размером 3072 символа, и они скопируются в него, в нём останется место для 996 символов.
|
||||
Так последовательно каждый буфер заполняется до конца, и имеет размер кратный заданному выравниванию.
|
||||
Таким образом избегаются переаллокации и перекопирование обработанных символов.
|
||||
|
||||
После окончательного заполнения вы можете работать с накопленными данными — либо слить все буфера в одну последовательную
|
||||
строку (размер для буфера которой вы теперь уже знаете), либо перебирать их по отдельности, например, посылая эти буфера
|
||||
в сеть. Либо последовательно копируя данные в буфер заданного размера.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
|
|
@ -1,14 +1,19 @@
|
|||
# Объекты simstr в отладчиках
|
||||
Для более удобного отображения объектов simstr в отладчиках msvc и gdb подготовлено два файла:
|
||||
simstr.natvis - для использования в отладчике MSVC, и simstr_pretty_print.py для работы с gdb.
|
||||
# simstr Objects in Debuggers
|
||||
[On Russian | По-русски](readme_ru.md)
|
||||
|
||||
# Объекты simstr в отладчиках
|
||||
Если вы работаете в MS Visual Studio simstr.natvis автоматически добавляется в pdb файл,
|
||||
и обеспечивает удобный просмотр строковых объектов simstr везде, где используется эта библиотека.
|
||||
Two files have been prepared for more convenient display of simstr objects in msvc and gdb debuggers:
|
||||
`simstr.natvis` - for use in the MSVC debugger, and `simstr_pretty_print.py` for working with gdb.
|
||||
|
||||
# Объекты simstr в Visual Studio Code
|
||||
## При работе в gdb
|
||||
В конфигурации отладчика необходимо добавить следующие строки:
|
||||
# simstr Objects in Debuggers
|
||||
### Visual Studio
|
||||
If you are working in MS Visual Studio, simstr.natvis is automatically added to the pdb file,
|
||||
and provides convenient viewing of simstr string objects wherever this library is used.
|
||||
|
||||

|
||||
|
||||
# simstr Objects in Visual Studio Code
|
||||
## When working in gdb
|
||||
In the debugger configuration, you need to add the following lines:
|
||||
|
||||
```
|
||||
"setupCommands": [
|
||||
|
|
@ -25,16 +30,15 @@ simstr.natvis - для использования в отладчике MSVC, и
|
|||
]
|
||||
```
|
||||
|
||||
После этого в отладчике будут удобно отображаться объекты simstr.
|
||||
Скрипт инспектирует переменные этих типов и выдает для них текстовое описание, отображающее их
|
||||
содержимое в удобном виде. В первой строке отображается основная информация, видимая в окне
|
||||
инспектирования переменных. При наведении указателя мыши на переменную в окне исходного кода
|
||||
или на значении в окне инспектирования переменных во всплывающем тултипе будет показана
|
||||
остальная информация.
|
||||
After that, simstr objects will be conveniently displayed in the debugger.
|
||||
The script inspects variables of these types and provides a textual description for them, displaying their
|
||||
content in a convenient form. The first line displays the basic information visible in the
|
||||
variable inspection window. When you hover the mouse over a variable in the source code window
|
||||
or over a value in the variable inspection window, the remaining information will be shown in the pop-up tooltip.
|
||||
|
||||
Конфигурации отладчика располагаются в файле `.vscode/launch.json`.
|
||||
Возможно, у вас также установлено расширение `CMake Tools`, которое позволяет выбирать целевой проект для запуска.
|
||||
В этом случае настройки для подключения скрипта прописываются в `.vscode/settings.json`:
|
||||
Debugger configurations are located in the `.vscode/launch.json` file.
|
||||
You may also have the `CMake Tools` extension installed, which allows you to select the target project to run.
|
||||
In this case, the settings for connecting the script are written in `.vscode/settings.json`:
|
||||
|
||||
```
|
||||
"cmake.debugConfig": {
|
||||
|
|
@ -55,7 +59,10 @@ simstr.natvis - для использования в отладчике MSVC, и
|
|||
}
|
||||
```
|
||||
|
||||
Если же в Visual Studio Code вы работаете с отладчиком MSVC, то есть в launch.json `"type": "cppvsdbg"` то настройка другая:
|
||||
### Result
|
||||

|
||||
|
||||
If you are working with the MSVC debugger in Visual Studio Code, that is, in launch.json `"type": "cppvsdbg"`, then the setting is different:
|
||||
```
|
||||
"configurations": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
# Объекты simstr в отладчиках
|
||||
[On English | По-английски](readme.md)
|
||||
|
||||
Для более удобного отображения объектов simstr в отладчиках msvc и gdb подготовлено два файла:
|
||||
simstr.natvis - для использования в отладчике MSVC, и simstr_pretty_print.py для работы с gdb.
|
||||
|
||||
# Объекты simstr в отладчиках
|
||||
|
||||
### Visual Studio
|
||||
Если вы работаете в MS Visual Studio simstr.natvis автоматически добавляется в pdb файл,
|
||||
и обеспечивает удобный просмотр строковых объектов simstr везде, где используется эта библиотека.
|
||||
|
||||

|
||||
|
||||
# Объекты simstr в Visual Studio Code
|
||||
## При работе в gdb
|
||||
В конфигурации отладчика необходимо добавить следующие строки:
|
||||
|
||||
```
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Enable pretty-printing for simstr",
|
||||
"text": "source ${workspaceFolder}/for_debug/simstr_pretty_print.py",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
После этого в отладчике будут удобно отображаться объекты simstr.
|
||||
Скрипт инспектирует переменные этих типов и выдает для них текстовое описание, отображающее их
|
||||
содержимое в удобном виде. В первой строке отображается основная информация, видимая в окне
|
||||
инспектирования переменных. При наведении указателя мыши на переменную в окне исходного кода
|
||||
или на значении в окне инспектирования переменных во всплывающем тултипе будет показана
|
||||
остальная информация.
|
||||
|
||||
Конфигурации отладчика располагаются в файле `.vscode/launch.json`.
|
||||
Возможно, у вас также установлено расширение `CMake Tools`, которое позволяет выбирать целевой проект для запуска.
|
||||
В этом случае настройки для подключения скрипта прописываются в `.vscode/settings.json`:
|
||||
|
||||
```
|
||||
"cmake.debugConfig": {
|
||||
"MIMode": "gdb",
|
||||
"environment": [],
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"text": "source ${workspaceFolder}/for_debug/simstr_pretty_print.py",
|
||||
"description": "pretty print simstr",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
### Результат
|
||||

|
||||
|
||||
Если же в Visual Studio Code вы работаете с отладчиком MSVC, то есть в launch.json `"type": "cppvsdbg"` то настройка другая:
|
||||
```
|
||||
"configurations": [
|
||||
{
|
||||
.....
|
||||
"type": "cppvsdbg",
|
||||
....
|
||||
"visualizerFile": "${workspaceFolder}/for_debug/simstr.natvis"
|
||||
},
|
||||
...
|
||||
```
|
||||
|
|
@ -1,6 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Файл с описанием визуализации simstr строк для Visual Studio -->
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
<Type Name="simstr::str_src<*>">
|
||||
<DisplayString Condition="0xCCCCCCCC==(unsigned)str">[unknown]</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==1">l={len}, {str,[len]nas8}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==2">l={len}, {str,[len]nasu}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==4">l={len}, {str,[len]nas32}</DisplayString>
|
||||
<DisplayString>[unknown]</DisplayString>
|
||||
</Type>
|
||||
<Type Name="simstr::str_src_nt<*>">
|
||||
<DisplayString Condition="0xCCCCCCCC==(unsigned)str">[unknown]</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==1">l={len}, {str,[len]nas8}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==2">l={len}, {str,[len]nasu}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==4">l={len}, {str,[len]nas32}</DisplayString>
|
||||
<DisplayString>[unknown]</DisplayString>
|
||||
</Type>
|
||||
<Type Name="simstr::simple_str<*>">
|
||||
<DisplayString Condition="0xCCCCCCCC==(unsigned)str">[unknown]</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==1">l={len}, {str,[len]nas8}</DisplayString>
|
||||
|
|
@ -8,6 +22,13 @@
|
|||
<DisplayString Condition="sizeof($T1)==4">l={len}, {str,[len]nas32}</DisplayString>
|
||||
<DisplayString>[unknown]</DisplayString>
|
||||
</Type>
|
||||
<Type Name="simstr::simple_str_nt<*>">
|
||||
<DisplayString Condition="0xCCCCCCCC==(unsigned)str">[unknown]</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==1">l={len}, {str,[len]nas8}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==2">l={len}, {str,[len]nasu}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==4">l={len}, {str,[len]nas32}</DisplayString>
|
||||
<DisplayString>[unknown]</DisplayString>
|
||||
</Type>
|
||||
<Type Name="simstr::sstring<*>">
|
||||
<DisplayString Condition="sizeof($T1)==1 && type_ == 0">inplace, l={LocalCount - localRemain_}, {buf_,[LocalCount - localRemain_]nas8}</DisplayString>
|
||||
<DisplayString Condition="sizeof($T1)==1 && type_ == 1">literal, l={bigLen_}, {cstr_,[bigLen_]nas8}</DisplayString>
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ printer_list = {
|
|||
"lstring": [lstring_printer, lstring_printer_init],
|
||||
"simple_str": [ssa_printer],
|
||||
"simple_str_nt": [ssa_printer],
|
||||
"str_src": [ssa_printer],
|
||||
"str_src_nt": [ssa_printer],
|
||||
}
|
||||
|
||||
for name, func in printer_list.items():
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* ver. 1.0
|
||||
* ver. 1.9.1
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
432
readme.md
432
readme.md
|
|
@ -1,94 +1,354 @@
|
|||
# simstr - библиотека строковых объектов и функций
|
||||
# simstr - String Object and Function Library
|
||||
<span class="obfuscator"><a href="readme_ru.md">Russian | По-русски</a></span>
|
||||
|
||||
[](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
|
||||
|
||||
Версия 1.0.
|
||||
Version 1.9.1
|
||||
|
||||
В этой библиотеке содержится реализация нескольких видов строковых объектов и различных алгоритмов для работы со строками.
|
||||
|
||||
Цель библиотеки - сделать работу со строками в С++ такой же простой и лёгкой, как во множестве других языков, особенно
|
||||
скриптовых, но при этом сохранив оптимальность и производительность на уровне С и C++, и даже улучшив их.
|
||||
|
||||
Не секрет, что работа со строками в С++ зачастую доставляет боль. Класс `std::string` часто неудобен либо неэффективен.
|
||||
Многих функций, обычно необходимых при работе со строками, просто нет, и их каждому приходится писать самому.
|
||||
|
||||
Эта библиотека не делалась как универсальный комбайн, который "может всё", я реализовывал то, что мне приходилось
|
||||
использовать в работе, стараясь сделать это наиболее эффективным способом, и скромно надеюсь, что кое-что у меня получилось
|
||||
и пригодится другим людям, либо напрямую, либо как источник идей.
|
||||
|
||||
Библиотека не претендует на роль "поменял хедер и всё заработало лучше". Многие методы я старался делать совместимыми
|
||||
с `std::string` и `std::string_view`, но особо с этим не заморачивался. Переписывание старого кода на работу с simstr
|
||||
потребует некоторых усилий, но уверяю, что они окупятся. А новый код писать с её применением легко и доставляет удовольствие :)
|
||||
|
||||
Основное отличие simstr от std::string - для работы со строками используется не единый универсальный класс, а несколько
|
||||
видов объектов, каждый из которых хорош для своих целей, и при этом хорошо взаимодействующих друг с другом.
|
||||
Если вы активно использовали std::string_view и понимали, в чём его преимущество и недостатки по сравнению с std::string,
|
||||
то подход simstr вам также будет понятен.
|
||||
|
||||
## Основные возможности библиотеки
|
||||
- Строки `char`, `char16_t`, `char32_t`, `wchar_t`.
|
||||
- Прозрачное преобразование строк из одного типа символов в другой, с автоматической конвертацией между UTF-8, UTF-16, UTF-32,
|
||||
используя [simdutf](https://github.com/simdutf/simdutf).
|
||||
- Расширяемая система "Строковых выражений". Позволяет эффективно реализовать преобразование и сложение (конкатенацию) строк, литералов,
|
||||
чисел и возможно других объектов.
|
||||
- Строковые функции:
|
||||
- Получение подстрок.
|
||||
- Поиск подстрок и символов - с начала или с конца строки.
|
||||
- Различный тримминг строк - справа, слева, везде, по пробельным символам, по заданным символам.
|
||||
- Замена подстрок.
|
||||
- Замена набора символов на набор соответствующих подстрок.
|
||||
- Слияние (join) контейнеров строк в единую строку, с заданием разделителей и опций - "пропускать пустые", "разделитель после последней".
|
||||
- Разбиение (split) строк на части по заданному разделителю. Разбиение возможно сразу в контейнер со строками, либо вызовом функтора для
|
||||
каждой подстроки, либо путем итерации с помощью итератора `Splitter`.
|
||||
- Интеграция с функциями форматирования `format` и `sprintf` (с автоматическим увеличением буфера).
|
||||
Форматирование возможно для строк `char`, `wchar_t` и строк, совместимых с `wchar_t` по размеру.
|
||||
То есть под Windows это `char16_t`, под Linux - `char32_t`. Писать свою библиотеку форматирования не входило в мои замыслы.
|
||||
- Парсинг целых чисел с возможностью "тонкой" настройки при компиляции - можно задавать опции проверки переполнения,
|
||||
пропуск пробельных символов, конкретное основание счисления либо автовыбор по префиксам `0x`, `0`, `0b`, `0o`,
|
||||
допустимость знака `+`. Парсинг реализован для всех видов строк и символов.
|
||||
- Парсинг double пока реализован вызовом стандартной библиотеки и работает только для строк `char`, `wchar_t` и совместимых с
|
||||
`wchar_t` по размеру типов.
|
||||
- Содержится минимальная поддержка Unicode при преобразовании `upper`, `lower` и регистро-независимом сравнении строк.
|
||||
Работает только для символов первой плоскости Unicode (до 0xFFFF), а при смене регистра не учитываются случаи, когда один code point
|
||||
может преобразовываться в несколько, то есть преобразование регистра символов соответствует `std::towupper`, `std::towlower` для unicode локали, только быстрее и может работать с любым видом символов.
|
||||
- Реализован `hash map` для ключей строкового типа, на базе `std::unordered_map`, с возможностью более эффективного хранения и
|
||||
сравнения ключей по сравнению с ключами `std::string`. Поддерживается возможность регистро-независимого сравнения ключей (Ascii или
|
||||
минимальный Unicode (см. предыдущий пункт)).
|
||||
|
||||
## Основные объекты библиотеки
|
||||
- simple_str<K> - самая простая строка (или кусок строки), иммутабельная, не владеющая, аналог `std::string_view`.
|
||||
- simple_str_nt<K> - то же самое, только заявляет, что заканчивается 0. Для работы со сторонними C-API.
|
||||
- sstring<K> - shared string, иммутабельная, владеющая, с разделяемым буфером символов, поддержка SSO.
|
||||
- lstring<K, N> - local string, мутабельная, владеющая, с задаваемым размером SSO буфера.
|
||||
|
||||
## Статьи
|
||||
- [Обзор и введение](docs/overview.md)
|
||||
- [Обзорная статья на Хабре](https://habr.com/ru/articles/935590)
|
||||
- [Описание применяемой техники "Expression Templates"](https://habr.com/ru/articles/936468/)
|
||||
|
||||
## Использование
|
||||
`simstr` состоит из трёх заголовочных файлов и двух исходников. Можно подключать как CMake проект через `add_subdirectory` (библиотека `simstr`),
|
||||
можно просто включить файлы в свой проект. Для сборки также требуется [simdutf](https://github.com/simdutf/simdutf) (при использовании CMake
|
||||
скачивается автоматически).
|
||||
|
||||
Для работы `simstr` требуется компилятор стандарта не ниже С++20 - используются концепты и std::format.
|
||||
Работа проверялась под Windows на MSVC-19 и Clang-19, под Linux - на GCC-13 и Clang-21.
|
||||
Также проверялась работа в WASM, сборка в Emscripten 4.0.6, Clang-21.
|
||||
<h2>Speed up your work with strings by 2-10 times!</h2>
|
||||
|
||||
|
||||
## Бенчмарки
|
||||
Бенчмарки производятся с использованием фреймворка [Google benchmark](https://github.com/google/benchmark).
|
||||
Постарался сделать замеры для наиболее типичных операций, встречающихся в обычной работе. Я проводил замеры на своём оборудовании, под
|
||||
Windows и Linux (в WSL), с использованием компиляторов MSVC, Clang, GCC. Сторонние результаты приветствуются.
|
||||
Также проводил замеры в WASM, сборка в Emscripten. Обращаю внимание, что под WASM в Emscripten собирается 32-битная сборка, а значит,
|
||||
размеры буферов SSO в объектах меньше.
|
||||
This library contains a modern implementation of several types of string objects and various algorithms for working with strings.
|
||||
## Generated Documentation
|
||||
[Located here](https://orefkov.github.io/simstr/docs_en/)
|
||||
|
||||
- [Исходный код бенчмарков](bench/bench_str.cpp)
|
||||
- [Результаты бенчмарков](https://snegopat.ru/simstr/results.html)
|
||||
## Brief Description
|
||||
The goal of the library is to make working with strings in C++ as simple and easy as in many other languages, especially
|
||||
scripting languages, while maintaining optimality and performance at the level of C and C++, and even improving them.
|
||||
|
||||
## Примеры использования
|
||||
Пока отдельных примеров использования не подготовлено, можно посмотреть тексты [тестов](tests/test_str.cpp),
|
||||
[бенчмарков](bench/bench_str.cpp), и [утилиты подготовки html](bench/process_result.cpp) из результатов бенчмарков.
|
||||
Также simstr используется в моём проекте [v8sqlite](https://github.com/orefkov/v8sqlite)
|
||||
It's no secret that working with strings in C++ often causes pain. The `std::string` class is often inconvenient or inefficient.
|
||||
Many functions that are usually necessary when working with strings are simply not there, and everyone has to write them themselves.
|
||||
Even concatenating `std::string` and `std::string_view` became possible only with C++26.
|
||||
That's why I started creating this library for myself around 2012, and now I'm ready to share it with all C++ developers.
|
||||
|
||||
## Сгенерированная документация
|
||||
[Находится здесь](https://snegopat.ru/simstr/docs/)
|
||||
This library was not made as a universal combine that "can do everything", I implemented what I had to
|
||||
use in my work, trying to do it in the most efficient way, and I modestly hope that I have succeeded in something
|
||||
and will be useful to other people, either directly or as a source of ideas.
|
||||
|
||||
The library contains two parts:
|
||||
- Implementation of [*"String Expressions"*](https://orefkov.github.io/simstr/articles/fast_concat.html) and algorithms for working
|
||||
with constant strings.\
|
||||
To use this part, just take the file `"include/simstr/strexpr.h"` and write in your code
|
||||
```cpp
|
||||
#include "path/to file/strexpr.h"
|
||||
```
|
||||
This will allow you to use powerful and fast *"string expressions"* for concatenation and string construction for standard string types
|
||||
(`std::basic_string`, `std::basic_string_view`), as well as simplified versions of the `simple_str` and
|
||||
`simple_str_nt` classes, which implement all those string algorithms of the library that do not require storing or modifying strings.
|
||||
Since this is a header-only part, it does not include working with UTF encodings and simplified Unicode.
|
||||
- The full version, requiring the connection of the entire library (`"include/simstr/sstring.h"`), adds its string types with
|
||||
the ability to store and modify strings, works with UTF encodings and simplified Unicode.
|
||||
|
||||
The library does not pretend to be a "changed header and everything worked better" - it gets along well with standard strings
|
||||
and does not change the behavior of existing code working with them. I tried to make many methods in it compatible
|
||||
with `std::string` and `std::string_view`, but I didn't bother with this much. Rewriting your code to work with `simstr`
|
||||
will require some effort, but I assure you that it will pay off. And thanks to compatibility with standard strings, this work can be done
|
||||
in stages, in small pieces. Creating new code for working with strings with its use is easy and enjoyable :)
|
||||
|
||||
|
||||
The main difference between `simstr` and `std::string` is that not a single universal class is used for working with strings, but several
|
||||
types of objects, each of which is good for its own purposes, and at the same time interact well with each other.
|
||||
If you actively used `std::string_view` and understood its advantages and disadvantages compared to `std::string`,
|
||||
then the `simstr` approach will also be clear to you.
|
||||
|
||||
## Key Features of the Library
|
||||
When using only `#include "simstr/strexpr.h"`:
|
||||
- Support for working with strings `char`, `char8_t`, `char16_t`, `char32_t`, `wchar_t`.
|
||||
- Powerful and extensible *"String Expressions"* system.
|
||||
Allows you to efficiently implement the conversion and addition (concatenation) of strings, string literals, numbers (and possibly other objects),
|
||||
achieving significant acceleration of string operations.
|
||||
Compatible with both `simstr` string objects and standard strings (`std::basic_string`,
|
||||
`std::basic_string_view`), which allows you to apply fast concatenation even where it is not yet possible to abandon standard strings.
|
||||
Also allows you to mix strings of compatible character types in operations.
|
||||
- Constant string functions (do not change the original string):
|
||||
- Getting substrings.
|
||||
- Comparing strings, comparing strings ignoring the case of ASCII characters.
|
||||
- Searching for substrings and characters - from the beginning or from the end of the string.
|
||||
- Various trimming of strings - right, left, everywhere, by whitespace characters, by specified characters.
|
||||
- Replacing substrings (creating a copy of the string with the replacement).
|
||||
- Replacing a set of characters with a set of corresponding substrings (creating a copy of the string with the replacement).
|
||||
- Merging (join) containers of strings into a single string, with specifying separators and options - "skip empty", "separator after last".
|
||||
- Splitting strings into parts by a specified delimiter. Splitting is possible immediately into a container with strings, or by calling a functor for
|
||||
each substring, or by iterating using the `Splitter` iterator.
|
||||
- Functions for modifying standard strings with string expressions:
|
||||
- str::append, str::prepend, str::insert, str::change - change str::string with string expressions,
|
||||
for example `str::append(text, "count = "_ss + count)`.
|
||||
- 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 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* :).
|
||||
- Transparent conversion of strings from one character type to another, with automatic conversion between UTF-8, UTF-16, UTF-32,
|
||||
using [simdutf](https://github.com/simdutf/simdutf). Strings of "compatible" types are converted by simple copying:
|
||||
`char <-> char8_t`, `wchar_t <-> char32_t` in Linux, `wchar_t <-> char16_t` in Windows.
|
||||
- Integration with `format` and `sprintf` formatting functions (with automatic buffer increase).
|
||||
Formatting is possible for `char`, `wchar_t` strings and strings compatible with them in size.
|
||||
That is, under Windows it is `char8_t`, `char16_t`, under Linux - `char8_t`, `char32_t` (writing my own formatting library for all types of
|
||||
characters was not part of my plans).
|
||||
- Contains minimal Unicode support when converting `upper`, `lower` and case-insensitive string comparison.
|
||||
Works only for characters of the first Unicode plane (up to 0xFFFF), and when changing the case, cases are not taken into account when one code point
|
||||
can be converted into several, that is, the case conversion of characters corresponds to `std::towupper`, `std::towlower` for the unicode locale, only faster and can work with any type of characters.
|
||||
- Implemented `hash map` for string type keys, based on `std::unordered_map`, with the possibility of more efficient storage and
|
||||
comparison of keys compared to `std::string` keys. Supports the possibility of case-insensitive comparison of keys (Ascii or
|
||||
minimal Unicode (see previous paragraph)).
|
||||
|
||||
## Benchmarks
|
||||
Benchmarks are performed using the [Google benchmark](https://github.com/google/benchmark) framework.
|
||||
I tried to make measurements for the most typical operations that occur in normal work. I took measurements on my equipment, under
|
||||
Windows and Linux (in WSL), using MSVC, Clang, GCC compilers. Third-party results are welcome.
|
||||
I also took measurements in WASM, built in Emscripten. I draw attention to the fact that a 32-bit build is built under WASM in Emscripten, which means that
|
||||
the sizes of SSO buffers in objects are smaller.
|
||||
|
||||
On the [release page](https://github.com/orefkov/simstr/releases) you can download binary builds of benchmarks and run them on your equipment.
|
||||
|
||||
You can also run the [Emscripten build of benchmarks](https://orefkov.github.io/simstr/bench/benchStr.html) directly in the browser.
|
||||
|
||||
- [Benchmark source code](bench/bench_str.cpp)
|
||||
- [Benchmark results](https://orefkov.github.io/simstr/results.html)
|
||||
|
||||
## String Expressions
|
||||
These are special objects that efficiently implement string concatenation using `operator+`.
|
||||
The main principle, due to which efficient work is achieved - no matter how many operands are included in the entire expression,
|
||||
no temporary (intermediate) strings are created, the total length of the entire result is calculated only once,
|
||||
memory is allocated for the result character buffer only once, after which the characters are copied directly to the result buffer
|
||||
to its place. No memory reallocations, no moving characters in various intermediate buffers - everything is
|
||||
as efficient as possible. Thanks to the capabilities of C++ templates and operator overloading, the expression is written as close as possible
|
||||
to the usual syntax for adding strings.
|
||||
In addition, there are special overloads for adding string objects and string literals, strings and numbers,
|
||||
for copying with replacement, for merging containers of strings and much more.
|
||||
Thanks to the extensibility of this system, it is possible to create new options for building strings, and development is constantly ongoing.
|
||||
|
||||
All string objects from `simstr` are themselves string expressions, that is, they can be used in concatenation operations
|
||||
string expressions directly. Standard strings (`std::basic_string`, `std::basic_string_view`) can also serve as operands
|
||||
in addition operations with string expressions. Or they can be easily converted into a string expression by placing them in front of them
|
||||
unary `+`.
|
||||
|
||||
## Usage Examples
|
||||
### Adding strings with numbers
|
||||
```cpp
|
||||
std::string s1 = "start ";
|
||||
int i;
|
||||
....
|
||||
// Was
|
||||
std::string str = s1 + std::to_string(i) + " end";
|
||||
// Became
|
||||
std::string str = +s1 + i + " end";
|
||||
```
|
||||
`+s1` - converts `std::string` into an object - a string expression for which there is an efficient concatenation with numbers and string literals.
|
||||
|
||||
According to benchmarks, [acceleration 1.6 - 2 times](https://orefkov.github.io/simstr/results.html#bs70109915512075798510).
|
||||
|
||||
### Adding strings with numbers in hex format
|
||||
```cpp
|
||||
....
|
||||
// Was
|
||||
std::string str = s1 + std::format("0x{:x}", i) + " end";
|
||||
// Became
|
||||
std::string str = +s1 + e_hex<HexFlags::Short>(i) + " end";
|
||||
```
|
||||
Acceleration by [**9 - 14 times!!!**](https://orefkov.github.io/simstr/results.html#bs146911715078927772520)
|
||||
|
||||
### Adding multiple literals and searching in `std::string_view`
|
||||
```cpp
|
||||
// It was like this
|
||||
size_t find_pos(std::string_view src, std::string_view name) {
|
||||
// before C++26 we can not concatenate string and string_view...
|
||||
return src.find("\n- "s + std::string{name} + " -\n");
|
||||
}
|
||||
// When using only "strexpr.h" it became like this
|
||||
size_t find_pos(ssa src, ssa name) {
|
||||
return src.find(std::string{"\n- " + name + " -\n"});
|
||||
}
|
||||
|
||||
// And when using the full library, you can do this
|
||||
size_t find_pos(ssa src, ssa name) {
|
||||
// In this version, if the result of the concatenation fits into 207 characters, it is produced in a buffer on the stack,
|
||||
// without allocation and deallocation of memory, acceleration several times. And only if the result is longer than 207 characters -
|
||||
// there will be only one allocation, and the concatenation will be immediately into the allocated buffer, without copying characters.
|
||||
return src.find(lstringa<200>{"\n- " + name + " -\n"});
|
||||
}
|
||||
```
|
||||
`ssa` - alias for `simple_str<char>` - analogue of `std::string_view`, allows you to accept as a function parameter with minimal costs
|
||||
any string object that does not need to be modified or passed to the C-API: `std::string`, `std::string_view`, `"string literal"`,
|
||||
`simple_str_nt`, `sstring`, `lstring`. Also, since it is also a "string expression", it allows you to easily
|
||||
build concatenations with its participation.
|
||||
|
||||
According to measurements, [acceleration 1.5 - 9 times](https://orefkov.github.io/simstr/results.html#bs68116594352702954700).
|
||||
|
||||
### Addition with conditions
|
||||
```cpp
|
||||
// Was
|
||||
std::string buildTypeName(std::string_view type_name, size_t prec, size_t scale) {
|
||||
std::string res{type_name};
|
||||
if (prec) {
|
||||
res += "(" + std::to_string(prec);
|
||||
if (scale) {
|
||||
res += "," + std::to_string(scale);
|
||||
}
|
||||
res += ")";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Became when using only strexpr.h and wanting to use only standard strings
|
||||
std::string buildTypeName(std::string_view type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
// + turns type_name from string_view into a string expression
|
||||
return +type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
// Became when using only strexpr.h and simple_str string
|
||||
std::string buildTypeName(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
// ssa is already a string expression, + in front of it is not needed
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
// Became when using the full library
|
||||
stringa buildTypeName(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
```
|
||||
When `prec != 0`, [acceleration 1.5 - 2.2 times](https://orefkov.github.io/simstr/results.html#bs145290966789248325200).
|
||||
|
||||
### Addition with replacements
|
||||
```cpp
|
||||
// Was
|
||||
// There is no standard analogue of the replace function from other programming languages, let's write our own "head-on".
|
||||
std::string str_replace(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
std::string result;
|
||||
for (size_t offset = 0;;) {
|
||||
size_t pos = from.find(pattern, offset);
|
||||
if (pos == std::string::npos) {
|
||||
result += from.substr(offset);
|
||||
break;
|
||||
}
|
||||
result += from.substr(offset, pos - offset);
|
||||
result += repl;
|
||||
offset = pos + pattern.length();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string make_str_str(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
return "<" + str_replace(from, pattern, repl) + ">";
|
||||
}
|
||||
// Became - copying with replacements
|
||||
std::string make_str_exp(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
return "<" + e_repl(from, pattern, repl) + ">";
|
||||
}
|
||||
```
|
||||
[Acceleration from 1.5 times and higher](https://orefkov.github.io/simstr/results.html#bs54035654251116789780) - depending on the content of the strings.
|
||||
|
||||
### Splitting strings into parts, parsing numbers
|
||||
```cpp
|
||||
// Was - split the string by delimiter and calculate the sum of numbers
|
||||
int split_and_calc_total_str(std::string_view numbers, std::string_view delimiter) {
|
||||
int total = 0;
|
||||
for (size_t start = 0; start < numbers.length(); ) {
|
||||
int delim = numbers.find(delimiter, start);
|
||||
if (delim == std::string::npos) {
|
||||
delim = numbers.size();
|
||||
}
|
||||
std::string part{numbers.substr(start, delim - start)};
|
||||
total += std::strtol(part.c_str(), nullptr, 0);
|
||||
start = delim + delimiter.length();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
// Became
|
||||
int split_and_calc_total_sim(ssa numbers, ssa delimiter) {
|
||||
int total = 0;
|
||||
for (auto splitter = numbers.splitter(delimiter); !splitter.is_done();) {
|
||||
total += splitter.next().as_int<int>();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
```
|
||||
[Acceleration by 2-3 times](https://orefkov.github.io/simstr/results.html#bs7106975351756760120).
|
||||
|
||||
In addition to the individual examples given here, you can look at the sources:
|
||||
- [tests of the entire library](https://github.com/orefkov/simstr/blob/main/tests/test_str.cpp)
|
||||
- [tests of only the strexpr part](https://github.com/orefkov/simstr/blob/main/tests/test_expr_only.cpp)
|
||||
- [examples of using your types in string expressions](https://github.com/orefkov/simstr/blob/main/tests/test_tostrexpr.cpp)
|
||||
- [benchmarks](https://github.com/orefkov/simstr/blob/main/bench/bench_str.cpp)
|
||||
- [utility for preparing html](https://github.com/orefkov/simstr/blob/main/bench/process_result.cpp) from benchmark results.
|
||||
|
||||
## Main Objects of the Library
|
||||
Available with any use:
|
||||
- `simple_str<K>` - the simplest string (or piece of string), immutable, not owning, analogue of `std::string_view`.
|
||||
- `simple_str_nt<K>` - the same, only declares that it ends with 0. For working with third-party C-API.
|
||||
|
||||
Available when using the entire library:
|
||||
- `sstring<K>` - shared string, immutable, owning, with a shared character buffer, SSO support.
|
||||
- `lstring<K, N>` - local string, mutable, owning, with a specified size of the SSO buffer.
|
||||
|
||||
When connecting only `strexpr.h` - the types `simple_str<K>` and `simple_str_nt<K>` do not contain methods for working with UTF and Unicode.
|
||||
|
||||
## Articles
|
||||
- [Overview and introduction](docs/overview.md)
|
||||
- [So how do you quickly concatenate strings?](https://orefkov.github.io/simstr/articles/fast_concat.html)
|
||||
- [Overview article on Habr](https://habr.com/ru/articles/935590) (on Russian)
|
||||
- [Description of the applied technique "Expression Templates"](https://habr.com/ru/articles/936468/)(on Russian)
|
||||
|
||||
## Usage
|
||||
The library can be used partially, simply by taking the file `"include/simstr/strexpr.h"` and including it in your sources
|
||||
```cpp
|
||||
#include "include/simstr/strexpr.h"
|
||||
```
|
||||
This will only connect string expressions and simplified implementations of `simple_str` and `simple_str_nt`, without UTF and Unicode functions.
|
||||
|
||||
The full version of the `simstr` library consists of three header files and two source files.
|
||||
You can connect as a CMake project via `add_subdirectory` (the `simstr` library),
|
||||
you can simply include the files in your project. Building also requires [simdutf](https://github.com/simdutf/simdutf) (when using CMake
|
||||
it is downloaded automatically).
|
||||
|
||||
### Connection via FetchContent
|
||||
```
|
||||
function(add_simstr)
|
||||
set(SIMSTR_BUILD_TESTS OFF)
|
||||
set(SIMSTR_BENCHMARKS OFF)
|
||||
FetchContent_Declare(
|
||||
simstr
|
||||
GIT_REPOSITORY https://github.com/orefkov/simstr.git
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_TAG tags/rel1.9.1# Specify the desired release
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.9.1
|
||||
)
|
||||
FetchContent_MakeAvailable(simstr)
|
||||
endfunction()
|
||||
|
||||
add_simstr()
|
||||
|
||||
target_link_libraries(<your target> PUBLIC simstr::simstr)
|
||||
```
|
||||
|
||||
The library is also included in [vcpkg](https://vcpkg.io), connected as `orefkov-simstr`.
|
||||
|
||||
For `simstr` to work, a compiler of the standard no lower than C++20 is required - concepts and std::format are used.
|
||||
The work was checked under Windows on MSVC-19 and Clang-19, under Linux - on GCC-13 and Clang-21.
|
||||
The work in WASM was also checked, built in Emscripten 4.0.6, Clang-21.
|
||||
|
||||
## Convenient Debugging
|
||||
Along with the library, two files are supplied that make viewing simstr string objects in debuggers
|
||||
more convenient.\
|
||||
More details are described [here](for_debug/readme.md).
|
||||
|
||||
## Where it is already used
|
||||
Simstr is also used in my projects:
|
||||
- [simjson](https://github.com/orefkov/simjson) - a library for simple work with JSON using simstr strings.
|
||||
- [simrex](https://github.com/orefkov/simrex) - a wrapper for working with regular expressions [Oniguruma](https://github.com/kkos/oniguruma) using simstr strings.
|
||||
- [v8sqlite](https://github.com/orefkov/v8sqlite) - an external component for 1C-Enterprise V8 for working with sqlite.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,355 @@
|
|||
# simstr - библиотека строковых объектов и функций
|
||||
<span class="obfuscator"><a href="readme.md">On English | По-английски</a></span>
|
||||
|
||||
[](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
|
||||
|
||||
Версия 1.9.1
|
||||
|
||||
<h2>Ускорь работу со строками в 2-10 раз!</h2>
|
||||
|
||||
|
||||
В этой библиотеке содержится современная реализация нескольких видов строковых объектов и различных алгоритмов для работы со строками.
|
||||
## Сгенерированная документация
|
||||
[Находится здесь](https://orefkov.github.io/simstr/docs_ru/)
|
||||
|
||||
## Краткое описание
|
||||
Цель библиотеки - сделать работу со строками в С++ такой же простой и лёгкой, как во множестве других языков, особенно
|
||||
скриптовых, но при этом сохранив оптимальность и производительность на уровне С и C++, и даже улучшив их.
|
||||
|
||||
Не секрет, что работа со строками в С++ зачастую доставляет боль. Класс `std::string` часто неудобен либо неэффективен.
|
||||
Многих функций, обычно необходимых при работе со строками, просто нет, и их каждому приходится писать самому.
|
||||
Даже элементарно конкатенировать `std::string` и `std::string_view` стало возможно только с C++26.
|
||||
Именно поэтому я начал примерно в 2012 году создавать для себя эту библиотеку, и теперь готов поделится ею со всеми C++ разработчиками.
|
||||
|
||||
Эта библиотека не делалась как универсальный комбайн, который "может всё", я реализовывал то, что мне приходилось
|
||||
использовать в работе, стараясь сделать это наиболее эффективным способом, и скромно надеюсь, что кое-что у меня получилось
|
||||
и пригодится другим людям, либо напрямую, либо как источник идей.
|
||||
|
||||
Библиотека содержит две части:
|
||||
- Реализация [*"Строковых выражений"*](https://orefkov.github.io/simstr/articles/fast_concat_ru.html) и алгоритмов работы
|
||||
с константными строками.\
|
||||
Для использования этой части достаточно просто взять файл `"include/simstr/strexpr.h"` и написать в своём коде
|
||||
```cpp
|
||||
#include "путь/к файлу/strexpr.h"
|
||||
```
|
||||
Это позволит вам для стандартных строковых типов (`std::basic_string`, `std::basic_string_view`) использовать
|
||||
мощные и быстрые *"строковые выражения"* для конкатенации и построения строк, а также упрощенные варианты классов `simple_str` и
|
||||
`simple_str_nt`, которые реализуют все те строковые алгоритмы библиотеки, которые не требуют хранения или модификации строк.
|
||||
Так как это header-only часть, она не включает в себя работу с UTF-кодировками и упрощённый Unicode.
|
||||
- Полная версия, требующая подключения всей библиотеки (`"include/simstr/sstring.h"`), добавляет свои строковые типы с
|
||||
возможностями хранения и модификации строк, работает с UTF-кодировками и упрощённым Unicode.
|
||||
|
||||
Библиотека не претендует на роль "поменял хедер и всё заработало лучше" - она прекрасно уживается вместе со стандартными строками
|
||||
и не меняет поведение уже существующего кода, работающего с ними. Многие методы в ней я старался делать совместимыми
|
||||
с `std::string` и `std::string_view`, но особо с этим не заморачивался. Переписывание вашего кода на работу с `simstr`
|
||||
потребует некоторых усилий, но уверяю, что они окупятся. А благодаря совместимости со стандартными строками эту работу можно делать
|
||||
поэтапно, небольшими кусками. Новый же код работы со строками создавать с её применением легко и доставляет удовольствие :)
|
||||
|
||||
|
||||
Основное отличие `simstr` от `std::string` - для работы со строками используется не единый универсальный класс, а несколько
|
||||
видов объектов, каждый из которых хорош для своих целей, и при этом хорошо взаимодействующих друг с другом.
|
||||
Если вы активно использовали `std::string_view` и понимали, в чём его преимущества и недостатки по сравнению с `std::string`,
|
||||
то подход `simstr` вам также будет понятен.
|
||||
|
||||
## Основные возможности библиотеки
|
||||
При использовании только `#include "simstr/strexpr.h"`:
|
||||
- Поддержка работы со строками `char`, `char8_t`, `char16_t`, `char32_t`, `wchar_t`.
|
||||
- Мощная и расширяемая система *"Строковых выражений"*.
|
||||
Позволяет эффективно реализовать преобразование и сложение (конкатенацию) строк, строковых литералов, чисел (и возможно других объектов),
|
||||
добиваясь значительного ускорения строковых операций.
|
||||
Совместима как со строковыми объектами `simstr`, так и со стандартными строками (`std::basic_string`,
|
||||
`std::basic_string_view`), что позволяет применять быструю конкатенацию и там, где пока не получается отказаться от стандартных строк.
|
||||
Тоже позволяет смешивать в операциях строки совместимых типов символов.
|
||||
- Константные строковые функции (не меняют исходную строку):
|
||||
- Получение подстрок.
|
||||
- Сравнение строк, сравнение строк без учёта регистра ASCII-символов.
|
||||
- Поиск подстрок и символов - с начала или с конца строки.
|
||||
- Различный тримминг строк - справа, слева, везде, по пробельным символам, по заданным символам.
|
||||
- Замена подстрок (созданием копии строки с заменой).
|
||||
- Замена набора символов на набор соответствующих подстрок (созданием копии строки с заменой).
|
||||
- Слияние (join) контейнеров строк в единую строку, с заданием разделителей и опций - "пропускать пустые", "разделитель после последней".
|
||||
- Разбиение (split) строк на части по заданному разделителю. Разбиение возможно сразу в контейнер со строками, либо вызовом функтора для
|
||||
каждой подстроки, либо путем итерации с помощью итератора `Splitter`.
|
||||
- Создании копии со сменой регистра ASCII символов.
|
||||
- Функции модификации стандартных строк строковыми выражениями:
|
||||
- str::append, str::prepend, str::insert, str::change - меняют str::string строковыми выражениями,
|
||||
например `str::append(text, "count = "_ss + count)`.
|
||||
- str::replace - заменяет вхождения искомой подстроки на строку замены или строковое выражение.
|
||||
Если подстрока не найдена, строковое выражение даже не вычисляется.
|
||||
- str::make_ascii_upper, str::make_ascii_lower - смена регистра ASCII символов.
|
||||
- Парсинг целых чисел из "куска строки" (не требует нуль-терминированности) с возможностью "тонкой" настройки при компиляции -
|
||||
можно задавать опции проверки переполнения, пропуск пробельных символов, конкретное основание счисления либо автовыбор по
|
||||
префиксам `0x`, `0`, `0b`, `0o`, допустимость знака `+`. Парсинг реализован для всех видов строк и символов.
|
||||
- Парсинг double из "куска строки" для `char` и `char8_t`.
|
||||
|
||||
При использовании полной версии библиотеки:
|
||||
- Всё то же, что и перечислено выше, плюс
|
||||
- Парсинг double из "куска строки" для всех типов символов.
|
||||
- Дополнительные эффективные строковые объекты - `sstring` (shared string), `lstring` (local string).
|
||||
- `lstring` - поддерживает множество мутабельных операций со строками - различные замены, вставки, удаления и т.п.
|
||||
Позволяет задавать размер для внутреннего буфера символов, что может превращать *Small String Optimization* в *Big String Optimization* :).
|
||||
- Прозрачное преобразование строк из одного типа символов в другой, с автоматической конвертацией между UTF-8, UTF-16, UTF-32,
|
||||
используя [simdutf](https://github.com/simdutf/simdutf). Строки "совместимых" типов преобразуются простым копированием:
|
||||
`char <-> char8_t`, `wchar_t <-> char32_t` в Linux, `wchar_t <-> char16_t` в Windows.
|
||||
- Интеграция с функциями форматирования `format` и `sprintf` (с автоматическим увеличением буфера).
|
||||
Форматирование возможно для строк `char`, `wchar_t` и строк, совместимых с ними по размеру.
|
||||
То есть под Windows это `char8_t`, `char16_t`, под Linux - `char8_t`, `char32_t` (писать свою библиотеку форматирования для всех видов
|
||||
символов не входило в мои замыслы).
|
||||
- Содержится минимальная поддержка Unicode при преобразовании `upper`, `lower` и регистро-независимом сравнении строк.
|
||||
Работает только для символов первой плоскости Unicode (до 0xFFFF), а при смене регистра не учитываются случаи, когда один code point
|
||||
может преобразовываться в несколько, то есть преобразование регистра символов соответствует `std::towupper`, `std::towlower` для unicode локали, только быстрее и может работать с любым видом символов.
|
||||
- Реализован `hash map` для ключей строкового типа, на базе `std::unordered_map`, с возможностью более эффективного хранения и
|
||||
сравнения ключей по сравнению с ключами `std::string`. Поддерживается возможность регистро-независимого сравнения ключей (Ascii или
|
||||
минимальный Unicode (см. предыдущий пункт)).
|
||||
|
||||
## Бенчмарки
|
||||
Бенчмарки производятся с использованием фреймворка [Google benchmark](https://github.com/google/benchmark).
|
||||
Постарался сделать замеры для наиболее типичных операций, встречающихся в обычной работе. Я проводил замеры на своём оборудовании, под
|
||||
Windows и Linux (в WSL), с использованием компиляторов MSVC, Clang, GCC. Сторонние результаты приветствуются.
|
||||
Также проводил замеры в WASM, сборка в Emscripten. Обращаю внимание, что под WASM в Emscripten собирается 32-битная сборка, а значит,
|
||||
размеры буферов SSO в объектах меньше.
|
||||
|
||||
На [странице релизов](https://github.com/orefkov/simstr/releases) вы можете скачать бинарные сборки бенчмарков и запустить их на своём оборудовании.
|
||||
|
||||
Также вы можете запустить [Emscripten сборку бенчмарков](https://orefkov.github.io/simstr/bench/benchStr.html) прямо в браузере.
|
||||
|
||||
- [Исходный код бенчмарков](bench/bench_str.cpp)
|
||||
- [Результаты бенчмарков](https://orefkov.github.io/simstr/results.html)
|
||||
|
||||
## Строковые выражения
|
||||
Это специальные объекты, которые эффективно реализуют конкатенацию строк, с помощью `operator+`.
|
||||
Главный принцип, за счёт которого достигается эффективная работа - сколько бы операндов не входило во всё выражение,
|
||||
никаких временных (промежуточных) строк не создаётся, общая длина всего результата подсчитывается только один раз,
|
||||
один раз выделяется память под буфер символов результата, после чего символы копируются сразу в буфер результата
|
||||
на своё место. Никаких перевыделений памяти, никакого передвигания символов в различных промежуточных буферах - всё
|
||||
максимально эффективно. Благодаря возможностям шаблонов C++ и перегрузке операторов, выражение пишется максимально
|
||||
приближённо к обычному синтаксису сложения строк.
|
||||
Кроме того, есть специальные перегрузки для сложения строковых объектов и строковых литералов, строк и чисел,
|
||||
для копирования с заменой, для слияния контейнеров строк и многое другое.
|
||||
Благодаря расширяемости этой системы - возможно создание новых вариантов построения строк, развитие постоянно продолжается.
|
||||
|
||||
Все строковые объекты из `simstr` - сами являются строковыми выражениями, то есть их можно использовать в операциях конкатенации
|
||||
строковых выражений напрямую. Стандартные строки (`std::basic_string`, `std::basic_string_view`) - тоже могут служить операндами
|
||||
в операциях сложения со строковыми выражениями. Либо их можно легко преобразовать в строковое выражение, поставив перед ними
|
||||
унарный `+`.
|
||||
|
||||
## Примеры использования
|
||||
### Сложение строк с числами
|
||||
```cpp
|
||||
std::string s1 = "start ";
|
||||
int i;
|
||||
....
|
||||
// Было
|
||||
std::string str = s1 + std::to_string(i) + " end";
|
||||
// Стало
|
||||
std::string str = +s1 + i + " end";
|
||||
```
|
||||
`+s1` - преобразует `std::string` в объект - строковое выражение, для которого есть эффективная конкатенация с числами и строковыми литералами.
|
||||
|
||||
По бенчмаркам [ускорение 1.6 - 2 раза](https://orefkov.github.io/simstr/results.html#bs70109915512075798510).
|
||||
|
||||
### Сложение строк с числами в hex-формате
|
||||
```cpp
|
||||
....
|
||||
// Было
|
||||
std::string str = s1 + std::format("0x{:x}", i) + " end";
|
||||
// Стало
|
||||
std::string str = +s1 + e_hex<HexFlags::Short>(i) + " end";
|
||||
```
|
||||
Ускорение в [**9 - 14 раз!!!**](https://orefkov.github.io/simstr/results.html#bs146911715078927772520)
|
||||
|
||||
### Сложение нескольких литералов и поиск в `std::string_view`
|
||||
```cpp
|
||||
// Было так
|
||||
size_t find_pos(std::string_view src, std::string_view name) {
|
||||
// before C++26 we can not concatenate string and string_view...
|
||||
return src.find("\n- "s + std::string{name} + " -\n");
|
||||
}
|
||||
// При использовании только "strexpr.h" стало так
|
||||
size_t find_pos(ssa src, ssa name) {
|
||||
return src.find(std::string{"\n- " + name + " -\n"});
|
||||
}
|
||||
|
||||
// А при использовании полной библиотеки можно сделать так
|
||||
size_t find_pos(ssa src, ssa name) {
|
||||
// В этом варианте если результат конкатенации вмещается в 207 символов - она производится в буфере на стеке,
|
||||
// без алокации и освобождения памяти, ускорение в несколько раз. И только если результат длиннее 207 символов -
|
||||
// будет всего одна аллокация, и конкатенация будет сразу в алоцированный буфер, без перекопирования символов.
|
||||
return src.find(lstringa<200>{"\n- " + name + " -\n"});
|
||||
}
|
||||
```
|
||||
`ssa` - псевдоним для `simple_str<char>` - аналог `std::string_view`, позволяет с минимальными расходами принимать параметром функции
|
||||
любой строковый объект, который не нужно модифицировать или передавать в C-API: `std::string`, `std::string_view`, `"строковый литерал"`,
|
||||
`simple_str_nt`, `sstring`, `lstring`. Также так как он при этом является ещё и "строковым выражением", то позволяет легко
|
||||
строить конкатенации с его участием.
|
||||
|
||||
По замерам [ускорение 1.5 - 9 раз](https://orefkov.github.io/simstr/results.html#bs68116594352702954700).
|
||||
|
||||
### Сложение с условиями
|
||||
```cpp
|
||||
// Было
|
||||
std::string buildTypeName(std::string_view type_name, size_t prec, size_t scale) {
|
||||
std::string res{type_name};
|
||||
if (prec) {
|
||||
res += "(" + std::to_string(prec);
|
||||
if (scale) {
|
||||
res += "," + std::to_string(scale);
|
||||
}
|
||||
res += ")";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
// Стало при использовании только strexpr.h и желании использовать только стандартные строки
|
||||
std::string buildTypeName(std::string_view type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
// + превращает type_name из string_view в строковое выражение
|
||||
return +type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
// Стало при использовании только strexpr.h и simple_str строки
|
||||
std::string buildTypeName(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
// ssa уже является строковым выражением, + перед ним не нужен
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
// Стало при использовании полной библиотеки
|
||||
stringa buildTypeName(ssa type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
return type_name + "(" + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return type_name;
|
||||
}
|
||||
```
|
||||
При `prec != 0`, [ускорение 1.5 - 2.2 раза](https://orefkov.github.io/simstr/results.html#bs145290966789248325200).
|
||||
|
||||
### Сложение с заменами
|
||||
```cpp
|
||||
// Было
|
||||
// Стандартной аналога функции replace из других ЯП нет, напишем свою "в лоб".
|
||||
std::string str_replace(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
std::string result;
|
||||
for (size_t offset = 0;;) {
|
||||
size_t pos = from.find(pattern, offset);
|
||||
if (pos == std::string::npos) {
|
||||
result += from.substr(offset);
|
||||
break;
|
||||
}
|
||||
result += from.substr(offset, pos - offset);
|
||||
result += repl;
|
||||
offset = pos + pattern.length();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string make_str_str(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
return "<" + str_replace(from, pattern, repl) + ">";
|
||||
}
|
||||
// Стало - копирование с заменами
|
||||
std::string make_str_exp(std::string_view from, std::string_view pattern, std::string_view repl) {
|
||||
return "<" + e_repl(from, pattern, repl) + ">";
|
||||
}
|
||||
```
|
||||
[Ускорение от 1.5 раз и выше](https://orefkov.github.io/simstr/results.html#bs54035654251116789780) - в зависимости от содержимого строк.
|
||||
|
||||
### Разбиение строк на части, парсинг чисел
|
||||
```cpp
|
||||
// Было - разбить строку по разделителю и подсчитать сумму чисел
|
||||
int split_and_calc_total_str(std::string_view numbers, std::string_view delimiter) {
|
||||
int total = 0;
|
||||
for (size_t start = 0; start < numbers.length(); ) {
|
||||
int delim = numbers.find(delimiter, start);
|
||||
if (delim == std::string::npos) {
|
||||
delim = numbers.size();
|
||||
}
|
||||
std::string part{numbers.substr(start, delim - start)};
|
||||
total += std::strtol(part.c_str(), nullptr, 0);
|
||||
start = delim + delimiter.length();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
// Стало
|
||||
int split_and_calc_total_sim(ssa numbers, ssa delimiter) {
|
||||
int total = 0;
|
||||
for (auto splitter = numbers.splitter(delimiter); !splitter.is_done();) {
|
||||
total += splitter.next().as_int<int>();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
```
|
||||
[Ускорение в 2-3 раза](https://orefkov.github.io/simstr/results.html#bs7106975351756760120).
|
||||
|
||||
Помимо приведённых здесь отдельных примеров, можно посмотреть исходники:
|
||||
- [тестов всей библиотеки](https://github.com/orefkov/simstr/blob/main/tests/test_str.cpp)
|
||||
- [тестов только strexpr части](https://github.com/orefkov/simstr/blob/main/tests/test_expr_only.cpp)
|
||||
- [примеры использования своих типов в строковых выражениях](https://github.com/orefkov/simstr/blob/main/tests/test_tostrexpr.cpp)
|
||||
- [бенчмарков](https://github.com/orefkov/simstr/blob/main/bench/bench_str.cpp)
|
||||
- [утилиты подготовки html](https://github.com/orefkov/simstr/blob/main/bench/process_result.cpp) из результатов бенчмарков.
|
||||
|
||||
## Основные объекты библиотеки
|
||||
Доступны при любом использовании:
|
||||
- `simple_str<K>` - самая простая строка (или кусок строки), иммутабельная, не владеющая, аналог `std::string_view`.
|
||||
- `simple_str_nt<K>` - то же самое, только заявляет, что заканчивается 0. Для работы со сторонними C-API.
|
||||
|
||||
Доступны при использовании всей библиотеки:
|
||||
- `sstring<K>` - shared string, иммутабельная, владеющая, с разделяемым буфером символов, поддержка SSO.
|
||||
- `lstring<K, N>` - local string, мутабельная, владеющая, с задаваемым размером SSO буфера.
|
||||
|
||||
При подключении только `strexpr.h` - типы `simple_str<K>` и `simple_str_nt<K>` не содержат методов для работы с UTF и Unicode.
|
||||
|
||||
## Статьи
|
||||
- [Обзор и введение](docs/overview_ru.md)
|
||||
- [Так как же всё-таки быстро конкатенировать строки?](https://orefkov.github.io/simstr/articles/fast_concat_ru.html)
|
||||
- [Обзорная статья на Хабре](https://habr.com/ru/articles/935590)
|
||||
- [Описание применяемой техники "Expression Templates"](https://habr.com/ru/articles/936468/)
|
||||
|
||||
## Использование
|
||||
Библиотеку можно использовать частично, просто взяв файл `"include/simstr/strexpr.h"` и включив в свои исходники
|
||||
```cpp
|
||||
#include "include/simstr/strexpr.h"
|
||||
```
|
||||
Это подключит только строковые выражения и упрощённые реализации `simple_str` и `simple_str_nt`, без функций работы с UTF и Unicode.
|
||||
|
||||
Полная же версия библиотеки `simstr` состоит из трёх заголовочных файлов и двух исходников.
|
||||
Можно подключать как CMake проект через `add_subdirectory` (библиотека `simstr`),
|
||||
можно просто включить файлы в свой проект. Для сборки также требуется [simdutf](https://github.com/simdutf/simdutf) (при использовании CMake
|
||||
скачивается автоматически).
|
||||
|
||||
### Подключение через FetchContent
|
||||
```
|
||||
function(add_simstr)
|
||||
set(SIMSTR_BUILD_TESTS OFF)
|
||||
set(SIMSTR_BENCHMARKS OFF)
|
||||
FetchContent_Declare(
|
||||
simstr
|
||||
GIT_REPOSITORY https://github.com/orefkov/simstr.git
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_TAG tags/rel1.9.1# Укажите нужный релиз
|
||||
FIND_PACKAGE_ARGS NAMES simstr 1.9.1
|
||||
)
|
||||
FetchContent_MakeAvailable(simstr)
|
||||
endfunction()
|
||||
|
||||
add_simstr()
|
||||
|
||||
target_link_libraries(<your target> PUBLIC simstr::simstr)
|
||||
```
|
||||
|
||||
Библиотека также включена в [vcpkg](https://vcpkg.io), подключается как `orefkov-simstr`.
|
||||
|
||||
Для работы `simstr` требуется компилятор стандарта не ниже С++20 - используются концепты и std::format.
|
||||
Работа проверялась под Windows на MSVC-19 и Clang-19, под Linux - на GCC-13 и Clang-21.
|
||||
Также проверялась работа в WASM, сборка в Emscripten 4.0.6, Clang-21.
|
||||
|
||||
## Удобная отладка
|
||||
Вместе с библиотекой поставляются два файла, делающие просмотр simstr строковых объектов в отладчиках
|
||||
более удобным.\
|
||||
Более подробно описано [здесь](for_debug/readme_ru.md).
|
||||
|
||||
## Где уже используется
|
||||
Также simstr используется в моих проектах:
|
||||
- [simjson](https://github.com/orefkov/simjson) - библиотека для простой работы с JSON с использованием строк simstr.
|
||||
- [simrex](https://github.com/orefkov/simrex) - обёртка для работы с регулярными выражениями [Oniguruma](https://github.com/kkos/oniguruma) с использованием строк simstr.
|
||||
- [v8sqlite](https://github.com/orefkov/v8sqlite) - внешняя компонента для 1С-Предприятия V8 для работы с sqlite.
|
||||
956
src/sstring.cpp
956
src/sstring.cpp
|
|
@ -1,7 +1,9 @@
|
|||
/*
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* ver. 1.0
|
||||
* Реализация строковых функций
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
* Implementation of string functions
|
||||
*/
|
||||
#include "simstr/simple_unicode.h"
|
||||
#include "simstr/sstring.h"
|
||||
|
|
@ -185,6 +187,8 @@ inline u32s makeFoldU(u32s s) {
|
|||
/*
|
||||
* Поиск utf-8 symbols, которые меняют свою длину при upper/lower преобразовании
|
||||
* вот они нашлись
|
||||
* Search for utf-8 codepoints that change their code units length during upper/lower conversion
|
||||
* here they are found
|
||||
* "İiıIſSȺⱥȾⱦɐⱯɑⱭɫⱢɱⱮɽⱤẞßιΙΩωKkÅåⱢɫⱤɽⱥȺⱦȾⱭɑⱮɱⱯɐ"
|
||||
l2u ıI ſS ɐⱯ ɑⱭ ɫⱢ ɱⱮ ɽⱤ ιΙ ⱥȺ ⱦȾ
|
||||
u2l İi Ⱥⱥ Ⱦⱦ ẞß Ωω Kk Åå Ɫɫ Ɽɽ Ɑɑ Ɱɱ Ɐɐ
|
||||
|
|
@ -246,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;
|
||||
|
|
@ -384,6 +388,32 @@ SIMSTR_API size_t unicode_traits<u8s>::lower(const u8s*& src, size_t len, u8s*&
|
|||
return utf8_case_change<makeLowerU>(src, len, dest, lenBuffer);
|
||||
}
|
||||
|
||||
SIMSTR_API size_t unicode_traits<u8s>::upper_len(const u8s* src, size_t len) {
|
||||
size_t l = 0;
|
||||
for (const uu8s *ptr = (const uu8s*)src, *start = ptr, *end = ptr + len; ptr < end; start = ptr) {
|
||||
u32s s = readUtf8Symbol(ptr, end), su = makeUpperU(s);
|
||||
if (s == su) {
|
||||
l += ptr - start;
|
||||
} else {
|
||||
l += utf8len(su);
|
||||
}
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
SIMSTR_API size_t unicode_traits<u8s>::lower_len(const u8s* src, size_t len) {
|
||||
size_t l = 0;
|
||||
for (const uu8s *ptr = (const uu8s*)src, *start = ptr, *end = ptr + len; ptr < end; start = ptr) {
|
||||
u32s s = readUtf8Symbol(ptr, end), su = makeLowerU(s);
|
||||
if (s == su) {
|
||||
l += ptr - start;
|
||||
} else {
|
||||
l += utf8len(su);
|
||||
}
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
template<auto Op>
|
||||
void utf16_change_case(const u16s* src, size_t len, u16s* dest) {
|
||||
if (dest != src) {
|
||||
|
|
@ -545,4 +575,926 @@ SIMSTR_API size_t unicode_traits<u32s>::hashiu(const u32s* src, size_t l) {
|
|||
return h;
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Based on simdjson sources https://github.com/simdjson/simdjson/blob/667d0ed3c77f55cbda2082b034168d69898d1f88/include/simdjson/compile_time_json-inl.h#L189
|
||||
|
||||
// Counts the number of leading zeros in a 64-bit integer.
|
||||
int leading_zeroes(uint64_t input_num) {
|
||||
|
||||
#if defined __has_builtin
|
||||
# if __has_builtin (__builtin_clzll)
|
||||
# define HAS_BLT_CLZ
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAS_BLT_CLZ
|
||||
return __builtin_clzll(input_num);
|
||||
#else
|
||||
int last_bit = 0;
|
||||
|
||||
if (input_num & uint64_t(0xffffffff00000000)) {
|
||||
input_num >>= 32;
|
||||
last_bit |= 32;
|
||||
}
|
||||
if (input_num & uint64_t(0xffff0000)) {
|
||||
input_num >>= 16;
|
||||
last_bit |= 16;
|
||||
}
|
||||
if (input_num & uint64_t(0xff00)) {
|
||||
input_num >>= 8;
|
||||
last_bit |= 8;
|
||||
}
|
||||
if (input_num & uint64_t(0xf0)) {
|
||||
input_num >>= 4;
|
||||
last_bit |= 4;
|
||||
}
|
||||
if (input_num & uint64_t(0xc)) {
|
||||
input_num >>= 2;
|
||||
last_bit |= 2;
|
||||
}
|
||||
if (input_num & uint64_t(0x2)) { /* input_num >>= 1; */
|
||||
last_bit |= 1;
|
||||
}
|
||||
return 63 - last_bit;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Multiplies two 32-bit unsigned integers and returns a 64-bit result.
|
||||
uint64_t emulu(uint32_t x, uint32_t y) {
|
||||
return x * (uint64_t)y;
|
||||
}
|
||||
|
||||
uint64_t umul128_generic(uint64_t ab, uint64_t cd, uint64_t* hi) {
|
||||
uint64_t ad = emulu((uint32_t)(ab >> 32), (uint32_t)cd);
|
||||
uint64_t bd = emulu((uint32_t)ab, (uint32_t)cd);
|
||||
uint64_t adbc = ad + emulu((uint32_t)ab, (uint32_t)(cd >> 32));
|
||||
uint64_t adbc_carry = (uint64_t)(adbc < ad);
|
||||
uint64_t lo = bd + (adbc << 32);
|
||||
*hi = emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) + (adbc_carry << 32) + (uint64_t)(lo < bd);
|
||||
return lo;
|
||||
}
|
||||
|
||||
// Represents a 128-bit unsigned integer as two 64-bit parts.
|
||||
// We have a value128 struct elsewhere in the simdjson, but we
|
||||
// use a separate one here for clarity.
|
||||
struct value128 {
|
||||
uint64_t low;
|
||||
uint64_t high;
|
||||
|
||||
constexpr value128(uint64_t _low, uint64_t _high) : low(_low), high(_high) {}
|
||||
constexpr value128() : low(0), high(0) {}
|
||||
};
|
||||
|
||||
// Multiplies two 64-bit integers and returns a 128-bit result as value128.
|
||||
value128 full_multiplication(uint64_t a, uint64_t b) {
|
||||
value128 answer;
|
||||
answer.low = umul128_generic(a, b, &answer.high);
|
||||
return answer;
|
||||
}
|
||||
|
||||
// Converts mantissa and exponent to a double, considering the sign.
|
||||
double to_double(uint64_t mantissa, int64_t exponent, bool negative) {
|
||||
uint64_t sign_bit = negative ? (1ULL << 63) : 0;
|
||||
uint64_t exponent_bits = (uint64_t(exponent) & 0x7FF) << 52;
|
||||
uint64_t bits = sign_bit | exponent_bits | (mantissa & ((1ULL << 52) - 1));
|
||||
return std::bit_cast<double>(bits);
|
||||
}
|
||||
|
||||
constexpr int smallest_power = -342;
|
||||
constexpr int largest_power = 308;
|
||||
|
||||
// Precomputed powers of ten from 10^0 to 10^22. These
|
||||
// can be represented exactly using the double type.
|
||||
const double power_of_ten[] = {
|
||||
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11,
|
||||
1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22
|
||||
};
|
||||
|
||||
/**
|
||||
* When mapping numbers from decimal to binary,
|
||||
* we go from w * 10^q to m * 2^p but we have
|
||||
* 10^q = 5^q * 2^q, so effectively
|
||||
* we are trying to match
|
||||
* w * 2^q * 5^q to m * 2^p. Thus the powers of two
|
||||
* are not a concern since they can be represented
|
||||
* exactly using the binary notation, only the powers of five
|
||||
* affect the binary significand.
|
||||
*/
|
||||
// The truncated powers of five from 5^-342 all the way to 5^308
|
||||
// The mantissa is truncated to 128 bits, and
|
||||
// never rounded up. Uses about 10KB.
|
||||
const uint64_t power_of_five_128[]= {
|
||||
0xeef453d6923bd65a,0x113faa2906a13b3f,
|
||||
0x9558b4661b6565f8,0x4ac7ca59a424c507,
|
||||
0xbaaee17fa23ebf76,0x5d79bcf00d2df649,
|
||||
0xe95a99df8ace6f53,0xf4d82c2c107973dc,
|
||||
0x91d8a02bb6c10594,0x79071b9b8a4be869,
|
||||
0xb64ec836a47146f9,0x9748e2826cdee284,
|
||||
0xe3e27a444d8d98b7,0xfd1b1b2308169b25,
|
||||
0x8e6d8c6ab0787f72,0xfe30f0f5e50e20f7,
|
||||
0xb208ef855c969f4f,0xbdbd2d335e51a935,
|
||||
0xde8b2b66b3bc4723,0xad2c788035e61382,
|
||||
0x8b16fb203055ac76,0x4c3bcb5021afcc31,
|
||||
0xaddcb9e83c6b1793,0xdf4abe242a1bbf3d,
|
||||
0xd953e8624b85dd78,0xd71d6dad34a2af0d,
|
||||
0x87d4713d6f33aa6b,0x8672648c40e5ad68,
|
||||
0xa9c98d8ccb009506,0x680efdaf511f18c2,
|
||||
0xd43bf0effdc0ba48,0x212bd1b2566def2,
|
||||
0x84a57695fe98746d,0x14bb630f7604b57,
|
||||
0xa5ced43b7e3e9188,0x419ea3bd35385e2d,
|
||||
0xcf42894a5dce35ea,0x52064cac828675b9,
|
||||
0x818995ce7aa0e1b2,0x7343efebd1940993,
|
||||
0xa1ebfb4219491a1f,0x1014ebe6c5f90bf8,
|
||||
0xca66fa129f9b60a6,0xd41a26e077774ef6,
|
||||
0xfd00b897478238d0,0x8920b098955522b4,
|
||||
0x9e20735e8cb16382,0x55b46e5f5d5535b0,
|
||||
0xc5a890362fddbc62,0xeb2189f734aa831d,
|
||||
0xf712b443bbd52b7b,0xa5e9ec7501d523e4,
|
||||
0x9a6bb0aa55653b2d,0x47b233c92125366e,
|
||||
0xc1069cd4eabe89f8,0x999ec0bb696e840a,
|
||||
0xf148440a256e2c76,0xc00670ea43ca250d,
|
||||
0x96cd2a865764dbca,0x380406926a5e5728,
|
||||
0xbc807527ed3e12bc,0xc605083704f5ecf2,
|
||||
0xeba09271e88d976b,0xf7864a44c633682e,
|
||||
0x93445b8731587ea3,0x7ab3ee6afbe0211d,
|
||||
0xb8157268fdae9e4c,0x5960ea05bad82964,
|
||||
0xe61acf033d1a45df,0x6fb92487298e33bd,
|
||||
0x8fd0c16206306bab,0xa5d3b6d479f8e056,
|
||||
0xb3c4f1ba87bc8696,0x8f48a4899877186c,
|
||||
0xe0b62e2929aba83c,0x331acdabfe94de87,
|
||||
0x8c71dcd9ba0b4925,0x9ff0c08b7f1d0b14,
|
||||
0xaf8e5410288e1b6f,0x7ecf0ae5ee44dd9,
|
||||
0xdb71e91432b1a24a,0xc9e82cd9f69d6150,
|
||||
0x892731ac9faf056e,0xbe311c083a225cd2,
|
||||
0xab70fe17c79ac6ca,0x6dbd630a48aaf406,
|
||||
0xd64d3d9db981787d,0x92cbbccdad5b108,
|
||||
0x85f0468293f0eb4e,0x25bbf56008c58ea5,
|
||||
0xa76c582338ed2621,0xaf2af2b80af6f24e,
|
||||
0xd1476e2c07286faa,0x1af5af660db4aee1,
|
||||
0x82cca4db847945ca,0x50d98d9fc890ed4d,
|
||||
0xa37fce126597973c,0xe50ff107bab528a0,
|
||||
0xcc5fc196fefd7d0c,0x1e53ed49a96272c8,
|
||||
0xff77b1fcbebcdc4f,0x25e8e89c13bb0f7a,
|
||||
0x9faacf3df73609b1,0x77b191618c54e9ac,
|
||||
0xc795830d75038c1d,0xd59df5b9ef6a2417,
|
||||
0xf97ae3d0d2446f25,0x4b0573286b44ad1d,
|
||||
0x9becce62836ac577,0x4ee367f9430aec32,
|
||||
0xc2e801fb244576d5,0x229c41f793cda73f,
|
||||
0xf3a20279ed56d48a,0x6b43527578c1110f,
|
||||
0x9845418c345644d6,0x830a13896b78aaa9,
|
||||
0xbe5691ef416bd60c,0x23cc986bc656d553,
|
||||
0xedec366b11c6cb8f,0x2cbfbe86b7ec8aa8,
|
||||
0x94b3a202eb1c3f39,0x7bf7d71432f3d6a9,
|
||||
0xb9e08a83a5e34f07,0xdaf5ccd93fb0cc53,
|
||||
0xe858ad248f5c22c9,0xd1b3400f8f9cff68,
|
||||
0x91376c36d99995be,0x23100809b9c21fa1,
|
||||
0xb58547448ffffb2d,0xabd40a0c2832a78a,
|
||||
0xe2e69915b3fff9f9,0x16c90c8f323f516c,
|
||||
0x8dd01fad907ffc3b,0xae3da7d97f6792e3,
|
||||
0xb1442798f49ffb4a,0x99cd11cfdf41779c,
|
||||
0xdd95317f31c7fa1d,0x40405643d711d583,
|
||||
0x8a7d3eef7f1cfc52,0x482835ea666b2572,
|
||||
0xad1c8eab5ee43b66,0xda3243650005eecf,
|
||||
0xd863b256369d4a40,0x90bed43e40076a82,
|
||||
0x873e4f75e2224e68,0x5a7744a6e804a291,
|
||||
0xa90de3535aaae202,0x711515d0a205cb36,
|
||||
0xd3515c2831559a83,0xd5a5b44ca873e03,
|
||||
0x8412d9991ed58091,0xe858790afe9486c2,
|
||||
0xa5178fff668ae0b6,0x626e974dbe39a872,
|
||||
0xce5d73ff402d98e3,0xfb0a3d212dc8128f,
|
||||
0x80fa687f881c7f8e,0x7ce66634bc9d0b99,
|
||||
0xa139029f6a239f72,0x1c1fffc1ebc44e80,
|
||||
0xc987434744ac874e,0xa327ffb266b56220,
|
||||
0xfbe9141915d7a922,0x4bf1ff9f0062baa8,
|
||||
0x9d71ac8fada6c9b5,0x6f773fc3603db4a9,
|
||||
0xc4ce17b399107c22,0xcb550fb4384d21d3,
|
||||
0xf6019da07f549b2b,0x7e2a53a146606a48,
|
||||
0x99c102844f94e0fb,0x2eda7444cbfc426d,
|
||||
0xc0314325637a1939,0xfa911155fefb5308,
|
||||
0xf03d93eebc589f88,0x793555ab7eba27ca,
|
||||
0x96267c7535b763b5,0x4bc1558b2f3458de,
|
||||
0xbbb01b9283253ca2,0x9eb1aaedfb016f16,
|
||||
0xea9c227723ee8bcb,0x465e15a979c1cadc,
|
||||
0x92a1958a7675175f,0xbfacd89ec191ec9,
|
||||
0xb749faed14125d36,0xcef980ec671f667b,
|
||||
0xe51c79a85916f484,0x82b7e12780e7401a,
|
||||
0x8f31cc0937ae58d2,0xd1b2ecb8b0908810,
|
||||
0xb2fe3f0b8599ef07,0x861fa7e6dcb4aa15,
|
||||
0xdfbdcece67006ac9,0x67a791e093e1d49a,
|
||||
0x8bd6a141006042bd,0xe0c8bb2c5c6d24e0,
|
||||
0xaecc49914078536d,0x58fae9f773886e18,
|
||||
0xda7f5bf590966848,0xaf39a475506a899e,
|
||||
0x888f99797a5e012d,0x6d8406c952429603,
|
||||
0xaab37fd7d8f58178,0xc8e5087ba6d33b83,
|
||||
0xd5605fcdcf32e1d6,0xfb1e4a9a90880a64,
|
||||
0x855c3be0a17fcd26,0x5cf2eea09a55067f,
|
||||
0xa6b34ad8c9dfc06f,0xf42faa48c0ea481e,
|
||||
0xd0601d8efc57b08b,0xf13b94daf124da26,
|
||||
0x823c12795db6ce57,0x76c53d08d6b70858,
|
||||
0xa2cb1717b52481ed,0x54768c4b0c64ca6e,
|
||||
0xcb7ddcdda26da268,0xa9942f5dcf7dfd09,
|
||||
0xfe5d54150b090b02,0xd3f93b35435d7c4c,
|
||||
0x9efa548d26e5a6e1,0xc47bc5014a1a6daf,
|
||||
0xc6b8e9b0709f109a,0x359ab6419ca1091b,
|
||||
0xf867241c8cc6d4c0,0xc30163d203c94b62,
|
||||
0x9b407691d7fc44f8,0x79e0de63425dcf1d,
|
||||
0xc21094364dfb5636,0x985915fc12f542e4,
|
||||
0xf294b943e17a2bc4,0x3e6f5b7b17b2939d,
|
||||
0x979cf3ca6cec5b5a,0xa705992ceecf9c42,
|
||||
0xbd8430bd08277231,0x50c6ff782a838353,
|
||||
0xece53cec4a314ebd,0xa4f8bf5635246428,
|
||||
0x940f4613ae5ed136,0x871b7795e136be99,
|
||||
0xb913179899f68584,0x28e2557b59846e3f,
|
||||
0xe757dd7ec07426e5,0x331aeada2fe589cf,
|
||||
0x9096ea6f3848984f,0x3ff0d2c85def7621,
|
||||
0xb4bca50b065abe63,0xfed077a756b53a9,
|
||||
0xe1ebce4dc7f16dfb,0xd3e8495912c62894,
|
||||
0x8d3360f09cf6e4bd,0x64712dd7abbbd95c,
|
||||
0xb080392cc4349dec,0xbd8d794d96aacfb3,
|
||||
0xdca04777f541c567,0xecf0d7a0fc5583a0,
|
||||
0x89e42caaf9491b60,0xf41686c49db57244,
|
||||
0xac5d37d5b79b6239,0x311c2875c522ced5,
|
||||
0xd77485cb25823ac7,0x7d633293366b828b,
|
||||
0x86a8d39ef77164bc,0xae5dff9c02033197,
|
||||
0xa8530886b54dbdeb,0xd9f57f830283fdfc,
|
||||
0xd267caa862a12d66,0xd072df63c324fd7b,
|
||||
0x8380dea93da4bc60,0x4247cb9e59f71e6d,
|
||||
0xa46116538d0deb78,0x52d9be85f074e608,
|
||||
0xcd795be870516656,0x67902e276c921f8b,
|
||||
0x806bd9714632dff6,0xba1cd8a3db53b6,
|
||||
0xa086cfcd97bf97f3,0x80e8a40eccd228a4,
|
||||
0xc8a883c0fdaf7df0,0x6122cd128006b2cd,
|
||||
0xfad2a4b13d1b5d6c,0x796b805720085f81,
|
||||
0x9cc3a6eec6311a63,0xcbe3303674053bb0,
|
||||
0xc3f490aa77bd60fc,0xbedbfc4411068a9c,
|
||||
0xf4f1b4d515acb93b,0xee92fb5515482d44,
|
||||
0x991711052d8bf3c5,0x751bdd152d4d1c4a,
|
||||
0xbf5cd54678eef0b6,0xd262d45a78a0635d,
|
||||
0xef340a98172aace4,0x86fb897116c87c34,
|
||||
0x9580869f0e7aac0e,0xd45d35e6ae3d4da0,
|
||||
0xbae0a846d2195712,0x8974836059cca109,
|
||||
0xe998d258869facd7,0x2bd1a438703fc94b,
|
||||
0x91ff83775423cc06,0x7b6306a34627ddcf,
|
||||
0xb67f6455292cbf08,0x1a3bc84c17b1d542,
|
||||
0xe41f3d6a7377eeca,0x20caba5f1d9e4a93,
|
||||
0x8e938662882af53e,0x547eb47b7282ee9c,
|
||||
0xb23867fb2a35b28d,0xe99e619a4f23aa43,
|
||||
0xdec681f9f4c31f31,0x6405fa00e2ec94d4,
|
||||
0x8b3c113c38f9f37e,0xde83bc408dd3dd04,
|
||||
0xae0b158b4738705e,0x9624ab50b148d445,
|
||||
0xd98ddaee19068c76,0x3badd624dd9b0957,
|
||||
0x87f8a8d4cfa417c9,0xe54ca5d70a80e5d6,
|
||||
0xa9f6d30a038d1dbc,0x5e9fcf4ccd211f4c,
|
||||
0xd47487cc8470652b,0x7647c3200069671f,
|
||||
0x84c8d4dfd2c63f3b,0x29ecd9f40041e073,
|
||||
0xa5fb0a17c777cf09,0xf468107100525890,
|
||||
0xcf79cc9db955c2cc,0x7182148d4066eeb4,
|
||||
0x81ac1fe293d599bf,0xc6f14cd848405530,
|
||||
0xa21727db38cb002f,0xb8ada00e5a506a7c,
|
||||
0xca9cf1d206fdc03b,0xa6d90811f0e4851c,
|
||||
0xfd442e4688bd304a,0x908f4a166d1da663,
|
||||
0x9e4a9cec15763e2e,0x9a598e4e043287fe,
|
||||
0xc5dd44271ad3cdba,0x40eff1e1853f29fd,
|
||||
0xf7549530e188c128,0xd12bee59e68ef47c,
|
||||
0x9a94dd3e8cf578b9,0x82bb74f8301958ce,
|
||||
0xc13a148e3032d6e7,0xe36a52363c1faf01,
|
||||
0xf18899b1bc3f8ca1,0xdc44e6c3cb279ac1,
|
||||
0x96f5600f15a7b7e5,0x29ab103a5ef8c0b9,
|
||||
0xbcb2b812db11a5de,0x7415d448f6b6f0e7,
|
||||
0xebdf661791d60f56,0x111b495b3464ad21,
|
||||
0x936b9fcebb25c995,0xcab10dd900beec34,
|
||||
0xb84687c269ef3bfb,0x3d5d514f40eea742,
|
||||
0xe65829b3046b0afa,0xcb4a5a3112a5112,
|
||||
0x8ff71a0fe2c2e6dc,0x47f0e785eaba72ab,
|
||||
0xb3f4e093db73a093,0x59ed216765690f56,
|
||||
0xe0f218b8d25088b8,0x306869c13ec3532c,
|
||||
0x8c974f7383725573,0x1e414218c73a13fb,
|
||||
0xafbd2350644eeacf,0xe5d1929ef90898fa,
|
||||
0xdbac6c247d62a583,0xdf45f746b74abf39,
|
||||
0x894bc396ce5da772,0x6b8bba8c328eb783,
|
||||
0xab9eb47c81f5114f,0x66ea92f3f326564,
|
||||
0xd686619ba27255a2,0xc80a537b0efefebd,
|
||||
0x8613fd0145877585,0xbd06742ce95f5f36,
|
||||
0xa798fc4196e952e7,0x2c48113823b73704,
|
||||
0xd17f3b51fca3a7a0,0xf75a15862ca504c5,
|
||||
0x82ef85133de648c4,0x9a984d73dbe722fb,
|
||||
0xa3ab66580d5fdaf5,0xc13e60d0d2e0ebba,
|
||||
0xcc963fee10b7d1b3,0x318df905079926a8,
|
||||
0xffbbcfe994e5c61f,0xfdf17746497f7052,
|
||||
0x9fd561f1fd0f9bd3,0xfeb6ea8bedefa633,
|
||||
0xc7caba6e7c5382c8,0xfe64a52ee96b8fc0,
|
||||
0xf9bd690a1b68637b,0x3dfdce7aa3c673b0,
|
||||
0x9c1661a651213e2d,0x6bea10ca65c084e,
|
||||
0xc31bfa0fe5698db8,0x486e494fcff30a62,
|
||||
0xf3e2f893dec3f126,0x5a89dba3c3efccfa,
|
||||
0x986ddb5c6b3a76b7,0xf89629465a75e01c,
|
||||
0xbe89523386091465,0xf6bbb397f1135823,
|
||||
0xee2ba6c0678b597f,0x746aa07ded582e2c,
|
||||
0x94db483840b717ef,0xa8c2a44eb4571cdc,
|
||||
0xba121a4650e4ddeb,0x92f34d62616ce413,
|
||||
0xe896a0d7e51e1566,0x77b020baf9c81d17,
|
||||
0x915e2486ef32cd60,0xace1474dc1d122e,
|
||||
0xb5b5ada8aaff80b8,0xd819992132456ba,
|
||||
0xe3231912d5bf60e6,0x10e1fff697ed6c69,
|
||||
0x8df5efabc5979c8f,0xca8d3ffa1ef463c1,
|
||||
0xb1736b96b6fd83b3,0xbd308ff8a6b17cb2,
|
||||
0xddd0467c64bce4a0,0xac7cb3f6d05ddbde,
|
||||
0x8aa22c0dbef60ee4,0x6bcdf07a423aa96b,
|
||||
0xad4ab7112eb3929d,0x86c16c98d2c953c6,
|
||||
0xd89d64d57a607744,0xe871c7bf077ba8b7,
|
||||
0x87625f056c7c4a8b,0x11471cd764ad4972,
|
||||
0xa93af6c6c79b5d2d,0xd598e40d3dd89bcf,
|
||||
0xd389b47879823479,0x4aff1d108d4ec2c3,
|
||||
0x843610cb4bf160cb,0xcedf722a585139ba,
|
||||
0xa54394fe1eedb8fe,0xc2974eb4ee658828,
|
||||
0xce947a3da6a9273e,0x733d226229feea32,
|
||||
0x811ccc668829b887,0x806357d5a3f525f,
|
||||
0xa163ff802a3426a8,0xca07c2dcb0cf26f7,
|
||||
0xc9bcff6034c13052,0xfc89b393dd02f0b5,
|
||||
0xfc2c3f3841f17c67,0xbbac2078d443ace2,
|
||||
0x9d9ba7832936edc0,0xd54b944b84aa4c0d,
|
||||
0xc5029163f384a931,0xa9e795e65d4df11,
|
||||
0xf64335bcf065d37d,0x4d4617b5ff4a16d5,
|
||||
0x99ea0196163fa42e,0x504bced1bf8e4e45,
|
||||
0xc06481fb9bcf8d39,0xe45ec2862f71e1d6,
|
||||
0xf07da27a82c37088,0x5d767327bb4e5a4c,
|
||||
0x964e858c91ba2655,0x3a6a07f8d510f86f,
|
||||
0xbbe226efb628afea,0x890489f70a55368b,
|
||||
0xeadab0aba3b2dbe5,0x2b45ac74ccea842e,
|
||||
0x92c8ae6b464fc96f,0x3b0b8bc90012929d,
|
||||
0xb77ada0617e3bbcb,0x9ce6ebb40173744,
|
||||
0xe55990879ddcaabd,0xcc420a6a101d0515,
|
||||
0x8f57fa54c2a9eab6,0x9fa946824a12232d,
|
||||
0xb32df8e9f3546564,0x47939822dc96abf9,
|
||||
0xdff9772470297ebd,0x59787e2b93bc56f7,
|
||||
0x8bfbea76c619ef36,0x57eb4edb3c55b65a,
|
||||
0xaefae51477a06b03,0xede622920b6b23f1,
|
||||
0xdab99e59958885c4,0xe95fab368e45eced,
|
||||
0x88b402f7fd75539b,0x11dbcb0218ebb414,
|
||||
0xaae103b5fcd2a881,0xd652bdc29f26a119,
|
||||
0xd59944a37c0752a2,0x4be76d3346f0495f,
|
||||
0x857fcae62d8493a5,0x6f70a4400c562ddb,
|
||||
0xa6dfbd9fb8e5b88e,0xcb4ccd500f6bb952,
|
||||
0xd097ad07a71f26b2,0x7e2000a41346a7a7,
|
||||
0x825ecc24c873782f,0x8ed400668c0c28c8,
|
||||
0xa2f67f2dfa90563b,0x728900802f0f32fa,
|
||||
0xcbb41ef979346bca,0x4f2b40a03ad2ffb9,
|
||||
0xfea126b7d78186bc,0xe2f610c84987bfa8,
|
||||
0x9f24b832e6b0f436,0xdd9ca7d2df4d7c9,
|
||||
0xc6ede63fa05d3143,0x91503d1c79720dbb,
|
||||
0xf8a95fcf88747d94,0x75a44c6397ce912a,
|
||||
0x9b69dbe1b548ce7c,0xc986afbe3ee11aba,
|
||||
0xc24452da229b021b,0xfbe85badce996168,
|
||||
0xf2d56790ab41c2a2,0xfae27299423fb9c3,
|
||||
0x97c560ba6b0919a5,0xdccd879fc967d41a,
|
||||
0xbdb6b8e905cb600f,0x5400e987bbc1c920,
|
||||
0xed246723473e3813,0x290123e9aab23b68,
|
||||
0x9436c0760c86e30b,0xf9a0b6720aaf6521,
|
||||
0xb94470938fa89bce,0xf808e40e8d5b3e69,
|
||||
0xe7958cb87392c2c2,0xb60b1d1230b20e04,
|
||||
0x90bd77f3483bb9b9,0xb1c6f22b5e6f48c2,
|
||||
0xb4ecd5f01a4aa828,0x1e38aeb6360b1af3,
|
||||
0xe2280b6c20dd5232,0x25c6da63c38de1b0,
|
||||
0x8d590723948a535f,0x579c487e5a38ad0e,
|
||||
0xb0af48ec79ace837,0x2d835a9df0c6d851,
|
||||
0xdcdb1b2798182244,0xf8e431456cf88e65,
|
||||
0x8a08f0f8bf0f156b,0x1b8e9ecb641b58ff,
|
||||
0xac8b2d36eed2dac5,0xe272467e3d222f3f,
|
||||
0xd7adf884aa879177,0x5b0ed81dcc6abb0f,
|
||||
0x86ccbb52ea94baea,0x98e947129fc2b4e9,
|
||||
0xa87fea27a539e9a5,0x3f2398d747b36224,
|
||||
0xd29fe4b18e88640e,0x8eec7f0d19a03aad,
|
||||
0x83a3eeeef9153e89,0x1953cf68300424ac,
|
||||
0xa48ceaaab75a8e2b,0x5fa8c3423c052dd7,
|
||||
0xcdb02555653131b6,0x3792f412cb06794d,
|
||||
0x808e17555f3ebf11,0xe2bbd88bbee40bd0,
|
||||
0xa0b19d2ab70e6ed6,0x5b6aceaeae9d0ec4,
|
||||
0xc8de047564d20a8b,0xf245825a5a445275,
|
||||
0xfb158592be068d2e,0xeed6e2f0f0d56712,
|
||||
0x9ced737bb6c4183d,0x55464dd69685606b,
|
||||
0xc428d05aa4751e4c,0xaa97e14c3c26b886,
|
||||
0xf53304714d9265df,0xd53dd99f4b3066a8,
|
||||
0x993fe2c6d07b7fab,0xe546a8038efe4029,
|
||||
0xbf8fdb78849a5f96,0xde98520472bdd033,
|
||||
0xef73d256a5c0f77c,0x963e66858f6d4440,
|
||||
0x95a8637627989aad,0xdde7001379a44aa8,
|
||||
0xbb127c53b17ec159,0x5560c018580d5d52,
|
||||
0xe9d71b689dde71af,0xaab8f01e6e10b4a6,
|
||||
0x9226712162ab070d,0xcab3961304ca70e8,
|
||||
0xb6b00d69bb55c8d1,0x3d607b97c5fd0d22,
|
||||
0xe45c10c42a2b3b05,0x8cb89a7db77c506a,
|
||||
0x8eb98a7a9a5b04e3,0x77f3608e92adb242,
|
||||
0xb267ed1940f1c61c,0x55f038b237591ed3,
|
||||
0xdf01e85f912e37a3,0x6b6c46dec52f6688,
|
||||
0x8b61313bbabce2c6,0x2323ac4b3b3da015,
|
||||
0xae397d8aa96c1b77,0xabec975e0a0d081a,
|
||||
0xd9c7dced53c72255,0x96e7bd358c904a21,
|
||||
0x881cea14545c7575,0x7e50d64177da2e54,
|
||||
0xaa242499697392d2,0xdde50bd1d5d0b9e9,
|
||||
0xd4ad2dbfc3d07787,0x955e4ec64b44e864,
|
||||
0x84ec3c97da624ab4,0xbd5af13bef0b113e,
|
||||
0xa6274bbdd0fadd61,0xecb1ad8aeacdd58e,
|
||||
0xcfb11ead453994ba,0x67de18eda5814af2,
|
||||
0x81ceb32c4b43fcf4,0x80eacf948770ced7,
|
||||
0xa2425ff75e14fc31,0xa1258379a94d028d,
|
||||
0xcad2f7f5359a3b3e,0x96ee45813a04330,
|
||||
0xfd87b5f28300ca0d,0x8bca9d6e188853fc,
|
||||
0x9e74d1b791e07e48,0x775ea264cf55347e,
|
||||
0xc612062576589dda,0x95364afe032a81a0,
|
||||
0xf79687aed3eec551,0x3a83ddbd83f52210,
|
||||
0x9abe14cd44753b52,0xc4926a9672793580,
|
||||
0xc16d9a0095928a27,0x75b7053c0f178400,
|
||||
0xf1c90080baf72cb1,0x5324c68b12dd6800,
|
||||
0x971da05074da7bee,0xd3f6fc16ebca8000,
|
||||
0xbce5086492111aea,0x88f4bb1ca6bd0000,
|
||||
0xec1e4a7db69561a5,0x2b31e9e3d0700000,
|
||||
0x9392ee8e921d5d07,0x3aff322e62600000,
|
||||
0xb877aa3236a4b449,0x9befeb9fad487c3,
|
||||
0xe69594bec44de15b,0x4c2ebe687989a9b4,
|
||||
0x901d7cf73ab0acd9,0xf9d37014bf60a11,
|
||||
0xb424dc35095cd80f,0x538484c19ef38c95,
|
||||
0xe12e13424bb40e13,0x2865a5f206b06fba,
|
||||
0x8cbccc096f5088cb,0xf93f87b7442e45d4,
|
||||
0xafebff0bcb24aafe,0xf78f69a51539d749,
|
||||
0xdbe6fecebdedd5be,0xb573440e5a884d1c,
|
||||
0x89705f4136b4a597,0x31680a88f8953031,
|
||||
0xabcc77118461cefc,0xfdc20d2b36ba7c3e,
|
||||
0xd6bf94d5e57a42bc,0x3d32907604691b4d,
|
||||
0x8637bd05af6c69b5,0xa63f9a49c2c1b110,
|
||||
0xa7c5ac471b478423,0xfcf80dc33721d54,
|
||||
0xd1b71758e219652b,0xd3c36113404ea4a9,
|
||||
0x83126e978d4fdf3b,0x645a1cac083126ea,
|
||||
0xa3d70a3d70a3d70a,0x3d70a3d70a3d70a4,
|
||||
0xcccccccccccccccc,0xcccccccccccccccd,
|
||||
0x8000000000000000,0x0,
|
||||
0xa000000000000000,0x0,
|
||||
0xc800000000000000,0x0,
|
||||
0xfa00000000000000,0x0,
|
||||
0x9c40000000000000,0x0,
|
||||
0xc350000000000000,0x0,
|
||||
0xf424000000000000,0x0,
|
||||
0x9896800000000000,0x0,
|
||||
0xbebc200000000000,0x0,
|
||||
0xee6b280000000000,0x0,
|
||||
0x9502f90000000000,0x0,
|
||||
0xba43b74000000000,0x0,
|
||||
0xe8d4a51000000000,0x0,
|
||||
0x9184e72a00000000,0x0,
|
||||
0xb5e620f480000000,0x0,
|
||||
0xe35fa931a0000000,0x0,
|
||||
0x8e1bc9bf04000000,0x0,
|
||||
0xb1a2bc2ec5000000,0x0,
|
||||
0xde0b6b3a76400000,0x0,
|
||||
0x8ac7230489e80000,0x0,
|
||||
0xad78ebc5ac620000,0x0,
|
||||
0xd8d726b7177a8000,0x0,
|
||||
0x878678326eac9000,0x0,
|
||||
0xa968163f0a57b400,0x0,
|
||||
0xd3c21bcecceda100,0x0,
|
||||
0x84595161401484a0,0x0,
|
||||
0xa56fa5b99019a5c8,0x0,
|
||||
0xcecb8f27f4200f3a,0x0,
|
||||
0x813f3978f8940984,0x4000000000000000,
|
||||
0xa18f07d736b90be5,0x5000000000000000,
|
||||
0xc9f2c9cd04674ede,0xa400000000000000,
|
||||
0xfc6f7c4045812296,0x4d00000000000000,
|
||||
0x9dc5ada82b70b59d,0xf020000000000000,
|
||||
0xc5371912364ce305,0x6c28000000000000,
|
||||
0xf684df56c3e01bc6,0xc732000000000000,
|
||||
0x9a130b963a6c115c,0x3c7f400000000000,
|
||||
0xc097ce7bc90715b3,0x4b9f100000000000,
|
||||
0xf0bdc21abb48db20,0x1e86d40000000000,
|
||||
0x96769950b50d88f4,0x1314448000000000,
|
||||
0xbc143fa4e250eb31,0x17d955a000000000,
|
||||
0xeb194f8e1ae525fd,0x5dcfab0800000000,
|
||||
0x92efd1b8d0cf37be,0x5aa1cae500000000,
|
||||
0xb7abc627050305ad,0xf14a3d9e40000000,
|
||||
0xe596b7b0c643c719,0x6d9ccd05d0000000,
|
||||
0x8f7e32ce7bea5c6f,0xe4820023a2000000,
|
||||
0xb35dbf821ae4f38b,0xdda2802c8a800000,
|
||||
0xe0352f62a19e306e,0xd50b2037ad200000,
|
||||
0x8c213d9da502de45,0x4526f422cc340000,
|
||||
0xaf298d050e4395d6,0x9670b12b7f410000,
|
||||
0xdaf3f04651d47b4c,0x3c0cdd765f114000,
|
||||
0x88d8762bf324cd0f,0xa5880a69fb6ac800,
|
||||
0xab0e93b6efee0053,0x8eea0d047a457a00,
|
||||
0xd5d238a4abe98068,0x72a4904598d6d880,
|
||||
0x85a36366eb71f041,0x47a6da2b7f864750,
|
||||
0xa70c3c40a64e6c51,0x999090b65f67d924,
|
||||
0xd0cf4b50cfe20765,0xfff4b4e3f741cf6d,
|
||||
0x82818f1281ed449f,0xbff8f10e7a8921a4,
|
||||
0xa321f2d7226895c7,0xaff72d52192b6a0d,
|
||||
0xcbea6f8ceb02bb39,0x9bf4f8a69f764490,
|
||||
0xfee50b7025c36a08,0x2f236d04753d5b4,
|
||||
0x9f4f2726179a2245,0x1d762422c946590,
|
||||
0xc722f0ef9d80aad6,0x424d3ad2b7b97ef5,
|
||||
0xf8ebad2b84e0d58b,0xd2e0898765a7deb2,
|
||||
0x9b934c3b330c8577,0x63cc55f49f88eb2f,
|
||||
0xc2781f49ffcfa6d5,0x3cbf6b71c76b25fb,
|
||||
0xf316271c7fc3908a,0x8bef464e3945ef7a,
|
||||
0x97edd871cfda3a56,0x97758bf0e3cbb5ac,
|
||||
0xbde94e8e43d0c8ec,0x3d52eeed1cbea317,
|
||||
0xed63a231d4c4fb27,0x4ca7aaa863ee4bdd,
|
||||
0x945e455f24fb1cf8,0x8fe8caa93e74ef6a,
|
||||
0xb975d6b6ee39e436,0xb3e2fd538e122b44,
|
||||
0xe7d34c64a9c85d44,0x60dbbca87196b616,
|
||||
0x90e40fbeea1d3a4a,0xbc8955e946fe31cd,
|
||||
0xb51d13aea4a488dd,0x6babab6398bdbe41,
|
||||
0xe264589a4dcdab14,0xc696963c7eed2dd1,
|
||||
0x8d7eb76070a08aec,0xfc1e1de5cf543ca2,
|
||||
0xb0de65388cc8ada8,0x3b25a55f43294bcb,
|
||||
0xdd15fe86affad912,0x49ef0eb713f39ebe,
|
||||
0x8a2dbf142dfcc7ab,0x6e3569326c784337,
|
||||
0xacb92ed9397bf996,0x49c2c37f07965404,
|
||||
0xd7e77a8f87daf7fb,0xdc33745ec97be906,
|
||||
0x86f0ac99b4e8dafd,0x69a028bb3ded71a3,
|
||||
0xa8acd7c0222311bc,0xc40832ea0d68ce0c,
|
||||
0xd2d80db02aabd62b,0xf50a3fa490c30190,
|
||||
0x83c7088e1aab65db,0x792667c6da79e0fa,
|
||||
0xa4b8cab1a1563f52,0x577001b891185938,
|
||||
0xcde6fd5e09abcf26,0xed4c0226b55e6f86,
|
||||
0x80b05e5ac60b6178,0x544f8158315b05b4,
|
||||
0xa0dc75f1778e39d6,0x696361ae3db1c721,
|
||||
0xc913936dd571c84c,0x3bc3a19cd1e38e9,
|
||||
0xfb5878494ace3a5f,0x4ab48a04065c723,
|
||||
0x9d174b2dcec0e47b,0x62eb0d64283f9c76,
|
||||
0xc45d1df942711d9a,0x3ba5d0bd324f8394,
|
||||
0xf5746577930d6500,0xca8f44ec7ee36479,
|
||||
0x9968bf6abbe85f20,0x7e998b13cf4e1ecb,
|
||||
0xbfc2ef456ae276e8,0x9e3fedd8c321a67e,
|
||||
0xefb3ab16c59b14a2,0xc5cfe94ef3ea101e,
|
||||
0x95d04aee3b80ece5,0xbba1f1d158724a12,
|
||||
0xbb445da9ca61281f,0x2a8a6e45ae8edc97,
|
||||
0xea1575143cf97226,0xf52d09d71a3293bd,
|
||||
0x924d692ca61be758,0x593c2626705f9c56,
|
||||
0xb6e0c377cfa2e12e,0x6f8b2fb00c77836c,
|
||||
0xe498f455c38b997a,0xb6dfb9c0f956447,
|
||||
0x8edf98b59a373fec,0x4724bd4189bd5eac,
|
||||
0xb2977ee300c50fe7,0x58edec91ec2cb657,
|
||||
0xdf3d5e9bc0f653e1,0x2f2967b66737e3ed,
|
||||
0x8b865b215899f46c,0xbd79e0d20082ee74,
|
||||
0xae67f1e9aec07187,0xecd8590680a3aa11,
|
||||
0xda01ee641a708de9,0xe80e6f4820cc9495,
|
||||
0x884134fe908658b2,0x3109058d147fdcdd,
|
||||
0xaa51823e34a7eede,0xbd4b46f0599fd415,
|
||||
0xd4e5e2cdc1d1ea96,0x6c9e18ac7007c91a,
|
||||
0x850fadc09923329e,0x3e2cf6bc604ddb0,
|
||||
0xa6539930bf6bff45,0x84db8346b786151c,
|
||||
0xcfe87f7cef46ff16,0xe612641865679a63,
|
||||
0x81f14fae158c5f6e,0x4fcb7e8f3f60c07e,
|
||||
0xa26da3999aef7749,0xe3be5e330f38f09d,
|
||||
0xcb090c8001ab551c,0x5cadf5bfd3072cc5,
|
||||
0xfdcb4fa002162a63,0x73d9732fc7c8f7f6,
|
||||
0x9e9f11c4014dda7e,0x2867e7fddcdd9afa,
|
||||
0xc646d63501a1511d,0xb281e1fd541501b8,
|
||||
0xf7d88bc24209a565,0x1f225a7ca91a4226,
|
||||
0x9ae757596946075f,0x3375788de9b06958,
|
||||
0xc1a12d2fc3978937,0x52d6b1641c83ae,
|
||||
0xf209787bb47d6b84,0xc0678c5dbd23a49a,
|
||||
0x9745eb4d50ce6332,0xf840b7ba963646e0,
|
||||
0xbd176620a501fbff,0xb650e5a93bc3d898,
|
||||
0xec5d3fa8ce427aff,0xa3e51f138ab4cebe,
|
||||
0x93ba47c980e98cdf,0xc66f336c36b10137,
|
||||
0xb8a8d9bbe123f017,0xb80b0047445d4184,
|
||||
0xe6d3102ad96cec1d,0xa60dc059157491e5,
|
||||
0x9043ea1ac7e41392,0x87c89837ad68db2f,
|
||||
0xb454e4a179dd1877,0x29babe4598c311fb,
|
||||
0xe16a1dc9d8545e94,0xf4296dd6fef3d67a,
|
||||
0x8ce2529e2734bb1d,0x1899e4a65f58660c,
|
||||
0xb01ae745b101e9e4,0x5ec05dcff72e7f8f,
|
||||
0xdc21a1171d42645d,0x76707543f4fa1f73,
|
||||
0x899504ae72497eba,0x6a06494a791c53a8,
|
||||
0xabfa45da0edbde69,0x487db9d17636892,
|
||||
0xd6f8d7509292d603,0x45a9d2845d3c42b6,
|
||||
0x865b86925b9bc5c2,0xb8a2392ba45a9b2,
|
||||
0xa7f26836f282b732,0x8e6cac7768d7141e,
|
||||
0xd1ef0244af2364ff,0x3207d795430cd926,
|
||||
0x8335616aed761f1f,0x7f44e6bd49e807b8,
|
||||
0xa402b9c5a8d3a6e7,0x5f16206c9c6209a6,
|
||||
0xcd036837130890a1,0x36dba887c37a8c0f,
|
||||
0x802221226be55a64,0xc2494954da2c9789,
|
||||
0xa02aa96b06deb0fd,0xf2db9baa10b7bd6c,
|
||||
0xc83553c5c8965d3d,0x6f92829494e5acc7,
|
||||
0xfa42a8b73abbf48c,0xcb772339ba1f17f9,
|
||||
0x9c69a97284b578d7,0xff2a760414536efb,
|
||||
0xc38413cf25e2d70d,0xfef5138519684aba,
|
||||
0xf46518c2ef5b8cd1,0x7eb258665fc25d69,
|
||||
0x98bf2f79d5993802,0xef2f773ffbd97a61,
|
||||
0xbeeefb584aff8603,0xaafb550ffacfd8fa,
|
||||
0xeeaaba2e5dbf6784,0x95ba2a53f983cf38,
|
||||
0x952ab45cfa97a0b2,0xdd945a747bf26183,
|
||||
0xba756174393d88df,0x94f971119aeef9e4,
|
||||
0xe912b9d1478ceb17,0x7a37cd5601aab85d,
|
||||
0x91abb422ccb812ee,0xac62e055c10ab33a,
|
||||
0xb616a12b7fe617aa,0x577b986b314d6009,
|
||||
0xe39c49765fdf9d94,0xed5a7e85fda0b80b,
|
||||
0x8e41ade9fbebc27d,0x14588f13be847307,
|
||||
0xb1d219647ae6b31c,0x596eb2d8ae258fc8,
|
||||
0xde469fbd99a05fe3,0x6fca5f8ed9aef3bb,
|
||||
0x8aec23d680043bee,0x25de7bb9480d5854,
|
||||
0xada72ccc20054ae9,0xaf561aa79a10ae6a,
|
||||
0xd910f7ff28069da4,0x1b2ba1518094da04,
|
||||
0x87aa9aff79042286,0x90fb44d2f05d0842,
|
||||
0xa99541bf57452b28,0x353a1607ac744a53,
|
||||
0xd3fa922f2d1675f2,0x42889b8997915ce8,
|
||||
0x847c9b5d7c2e09b7,0x69956135febada11,
|
||||
0xa59bc234db398c25,0x43fab9837e699095,
|
||||
0xcf02b2c21207ef2e,0x94f967e45e03f4bb,
|
||||
0x8161afb94b44f57d,0x1d1be0eebac278f5,
|
||||
0xa1ba1ba79e1632dc,0x6462d92a69731732,
|
||||
0xca28a291859bbf93,0x7d7b8f7503cfdcfe,
|
||||
0xfcb2cb35e702af78,0x5cda735244c3d43e,
|
||||
0x9defbf01b061adab,0x3a0888136afa64a7,
|
||||
0xc56baec21c7a1916,0x88aaa1845b8fdd0,
|
||||
0xf6c69a72a3989f5b,0x8aad549e57273d45,
|
||||
0x9a3c2087a63f6399,0x36ac54e2f678864b,
|
||||
0xc0cb28a98fcf3c7f,0x84576a1bb416a7dd,
|
||||
0xf0fdf2d3f3c30b9f,0x656d44a2a11c51d5,
|
||||
0x969eb7c47859e743,0x9f644ae5a4b1b325,
|
||||
0xbc4665b596706114,0x873d5d9f0dde1fee,
|
||||
0xeb57ff22fc0c7959,0xa90cb506d155a7ea,
|
||||
0x9316ff75dd87cbd8,0x9a7f12442d588f2,
|
||||
0xb7dcbf5354e9bece,0xc11ed6d538aeb2f,
|
||||
0xe5d3ef282a242e81,0x8f1668c8a86da5fa,
|
||||
0x8fa475791a569d10,0xf96e017d694487bc,
|
||||
0xb38d92d760ec4455,0x37c981dcc395a9ac,
|
||||
0xe070f78d3927556a,0x85bbe253f47b1417,
|
||||
0x8c469ab843b89562,0x93956d7478ccec8e,
|
||||
0xaf58416654a6babb,0x387ac8d1970027b2,
|
||||
0xdb2e51bfe9d0696a,0x6997b05fcc0319e,
|
||||
0x88fcf317f22241e2,0x441fece3bdf81f03,
|
||||
0xab3c2fddeeaad25a,0xd527e81cad7626c3,
|
||||
0xd60b3bd56a5586f1,0x8a71e223d8d3b074,
|
||||
0x85c7056562757456,0xf6872d5667844e49,
|
||||
0xa738c6bebb12d16c,0xb428f8ac016561db,
|
||||
0xd106f86e69d785c7,0xe13336d701beba52,
|
||||
0x82a45b450226b39c,0xecc0024661173473,
|
||||
0xa34d721642b06084,0x27f002d7f95d0190,
|
||||
0xcc20ce9bd35c78a5,0x31ec038df7b441f4,
|
||||
0xff290242c83396ce,0x7e67047175a15271,
|
||||
0x9f79a169bd203e41,0xf0062c6e984d386,
|
||||
0xc75809c42c684dd1,0x52c07b78a3e60868,
|
||||
0xf92e0c3537826145,0xa7709a56ccdf8a82,
|
||||
0x9bbcc7a142b17ccb,0x88a66076400bb691,
|
||||
0xc2abf989935ddbfe,0x6acff893d00ea435,
|
||||
0xf356f7ebf83552fe,0x583f6b8c4124d43,
|
||||
0x98165af37b2153de,0xc3727a337a8b704a,
|
||||
0xbe1bf1b059e9a8d6,0x744f18c0592e4c5c,
|
||||
0xeda2ee1c7064130c,0x1162def06f79df73,
|
||||
0x9485d4d1c63e8be7,0x8addcb5645ac2ba8,
|
||||
0xb9a74a0637ce2ee1,0x6d953e2bd7173692,
|
||||
0xe8111c87c5c1ba99,0xc8fa8db6ccdd0437,
|
||||
0x910ab1d4db9914a0,0x1d9c9892400a22a2,
|
||||
0xb54d5e4a127f59c8,0x2503beb6d00cab4b,
|
||||
0xe2a0b5dc971f303a,0x2e44ae64840fd61d,
|
||||
0x8da471a9de737e24,0x5ceaecfed289e5d2,
|
||||
0xb10d8e1456105dad,0x7425a83e872c5f47,
|
||||
0xdd50f1996b947518,0xd12f124e28f77719,
|
||||
0x8a5296ffe33cc92f,0x82bd6b70d99aaa6f,
|
||||
0xace73cbfdc0bfb7b,0x636cc64d1001550b,
|
||||
0xd8210befd30efa5a,0x3c47f7e05401aa4e,
|
||||
0x8714a775e3e95c78,0x65acfaec34810a71,
|
||||
0xa8d9d1535ce3b396,0x7f1839a741a14d0d,
|
||||
0xd31045a8341ca07c,0x1ede48111209a050,
|
||||
0x83ea2b892091e44d,0x934aed0aab460432,
|
||||
0xa4e4b66b68b65d60,0xf81da84d5617853f,
|
||||
0xce1de40642e3f4b9,0x36251260ab9d668e,
|
||||
0x80d2ae83e9ce78f3,0xc1d72b7c6b426019,
|
||||
0xa1075a24e4421730,0xb24cf65b8612f81f,
|
||||
0xc94930ae1d529cfc,0xdee033f26797b627,
|
||||
0xfb9b7cd9a4a7443c,0x169840ef017da3b1,
|
||||
0x9d412e0806e88aa5,0x8e1f289560ee864e,
|
||||
0xc491798a08a2ad4e,0xf1a6f2bab92a27e2,
|
||||
0xf5b5d7ec8acb58a2,0xae10af696774b1db,
|
||||
0x9991a6f3d6bf1765,0xacca6da1e0a8ef29,
|
||||
0xbff610b0cc6edd3f,0x17fd090a58d32af3,
|
||||
0xeff394dcff8a948e,0xddfc4b4cef07f5b0,
|
||||
0x95f83d0a1fb69cd9,0x4abdaf101564f98e,
|
||||
0xbb764c4ca7a4440f,0x9d6d1ad41abe37f1,
|
||||
0xea53df5fd18d5513,0x84c86189216dc5ed,
|
||||
0x92746b9be2f8552c,0x32fd3cf5b4e49bb4,
|
||||
0xb7118682dbb66a77,0x3fbc8c33221dc2a1,
|
||||
0xe4d5e82392a40515,0xfabaf3feaa5334a,
|
||||
0x8f05b1163ba6832d,0x29cb4d87f2a7400e,
|
||||
0xb2c71d5bca9023f8,0x743e20e9ef511012,
|
||||
0xdf78e4b2bd342cf6,0x914da9246b255416,
|
||||
0x8bab8eefb6409c1a,0x1ad089b6c2f7548e,
|
||||
0xae9672aba3d0c320,0xa184ac2473b529b1,
|
||||
0xda3c0f568cc4f3e8,0xc9e5d72d90a2741e,
|
||||
0x8865899617fb1871,0x7e2fa67c7a658892,
|
||||
0xaa7eebfb9df9de8d,0xddbb901b98feeab7,
|
||||
0xd51ea6fa85785631,0x552a74227f3ea565,
|
||||
0x8533285c936b35de,0xd53a88958f87275f,
|
||||
0xa67ff273b8460356,0x8a892abaf368f137,
|
||||
0xd01fef10a657842c,0x2d2b7569b0432d85,
|
||||
0x8213f56a67f6b29b,0x9c3b29620e29fc73,
|
||||
0xa298f2c501f45f42,0x8349f3ba91b47b8f,
|
||||
0xcb3f2f7642717713,0x241c70a936219a73,
|
||||
0xfe0efb53d30dd4d7,0xed238cd383aa0110,
|
||||
0x9ec95d1463e8a506,0xf4363804324a40aa,
|
||||
0xc67bb4597ce2ce48,0xb143c6053edcd0d5,
|
||||
0xf81aa16fdc1b81da,0xdd94b7868e94050a,
|
||||
0x9b10a4e5e9913128,0xca7cf2b4191c8326,
|
||||
0xc1d4ce1f63f57d72,0xfd1c2f611f63a3f0,
|
||||
0xf24a01a73cf2dccf,0xbc633b39673c8cec,
|
||||
0x976e41088617ca01,0xd5be0503e085d813,
|
||||
0xbd49d14aa79dbc82,0x4b2d8644d8a74e18,
|
||||
0xec9c459d51852ba2,0xddf8e7d60ed1219e,
|
||||
0x93e1ab8252f33b45,0xcabb90e5c942b503,
|
||||
0xb8da1662e7b00a17,0x3d6a751f3b936243,
|
||||
0xe7109bfba19c0c9d,0xcc512670a783ad4,
|
||||
0x906a617d450187e2,0x27fb2b80668b24c5,
|
||||
0xb484f9dc9641e9da,0xb1f9f660802dedf6,
|
||||
0xe1a63853bbd26451,0x5e7873f8a0396973,
|
||||
0x8d07e33455637eb2,0xdb0b487b6423e1e8,
|
||||
0xb049dc016abc5e5f,0x91ce1a9a3d2cda62,
|
||||
0xdc5c5301c56b75f7,0x7641a140cc7810fb,
|
||||
0x89b9b3e11b6329ba,0xa9e904c87fcb0a9d,
|
||||
0xac2820d9623bf429,0x546345fa9fbdcd44,
|
||||
0xd732290fbacaf133,0xa97c177947ad4095,
|
||||
0x867f59a9d4bed6c0,0x49ed8eabcccc485d,
|
||||
0xa81f301449ee8c70,0x5c68f256bfff5a74,
|
||||
0xd226fc195c6a2f8c,0x73832eec6fff3111,
|
||||
0x83585d8fd9c25db7,0xc831fd53c5ff7eab,
|
||||
0xa42e74f3d032f525,0xba3e7ca8b77f5e55,
|
||||
0xcd3a1230c43fb26f,0x28ce1bd2e55f35eb,
|
||||
0x80444b5e7aa7cf85,0x7980d163cf5b81b3,
|
||||
0xa0555e361951c366,0xd7e105bcc332621f,
|
||||
0xc86ab5c39fa63440,0x8dd9472bf3fefaa7,
|
||||
0xfa856334878fc150,0xb14f98f6f0feb951,
|
||||
0x9c935e00d4b9d8d2,0x6ed1bf9a569f33d3,
|
||||
0xc3b8358109e84f07,0xa862f80ec4700c8,
|
||||
0xf4a642e14c6262c8,0xcd27bb612758c0fa,
|
||||
0x98e7e9cccfbd7dbd,0x8038d51cb897789c,
|
||||
0xbf21e44003acdd2c,0xe0470a63e6bd56c3,
|
||||
0xeeea5d5004981478,0x1858ccfce06cac74,
|
||||
0x95527a5202df0ccb,0xf37801e0c43ebc8,
|
||||
0xbaa718e68396cffd,0xd30560258f54e6ba,
|
||||
0xe950df20247c83fd,0x47c6b82ef32a2069,
|
||||
0x91d28b7416cdd27e,0x4cdc331d57fa5441,
|
||||
0xb6472e511c81471d,0xe0133fe4adf8e952,
|
||||
0xe3d8f9e563a198e5,0x58180fddd97723a6,
|
||||
0x8e679c2f5e44ff8f,0x570f09eaa7ea7648,
|
||||
};
|
||||
|
||||
// Attempts to compute i * 10^(power) exactly; and if "negative" is
|
||||
// true, negate the result.
|
||||
// Returns true on success, false on failure.
|
||||
// Failure suggests and invalid input or out-of-range result.
|
||||
bool compute_float_64(int64_t power, uint64_t i, bool negative, double& d) {
|
||||
if (i == 0) {
|
||||
d = negative ? -0.0 : 0.0;
|
||||
return true;
|
||||
}
|
||||
int64_t exponent = (((152170 + 65536) * power) >> 16) + 1024 + 63;
|
||||
int lz = leading_zeroes(i);
|
||||
i <<= lz;
|
||||
const uint32_t index = 2 * uint32_t(power - smallest_power);
|
||||
value128 firstproduct = full_multiplication(i, power_of_five_128[index]);
|
||||
if ((firstproduct.high & 0x1FF) == 0x1FF) {
|
||||
value128 secondproduct = full_multiplication(i, power_of_five_128[index + 1]);
|
||||
firstproduct.low += secondproduct.high;
|
||||
if (secondproduct.high > firstproduct.low) {
|
||||
firstproduct.high++;
|
||||
}
|
||||
}
|
||||
uint64_t lower = firstproduct.low;
|
||||
uint64_t upper = firstproduct.high;
|
||||
uint64_t upperbit = upper >> 63;
|
||||
uint64_t mantissa = upper >> (upperbit + 9);
|
||||
lz += int(1 ^ upperbit);
|
||||
int64_t real_exponent = exponent - lz;
|
||||
if (real_exponent <= 0) {
|
||||
if (-real_exponent + 1 >= 64) {
|
||||
d = negative ? -0.0 : 0.0;
|
||||
return true;
|
||||
}
|
||||
mantissa >>= -real_exponent + 1;
|
||||
mantissa += (mantissa & 1);
|
||||
mantissa >>= 1;
|
||||
real_exponent = (mantissa < (uint64_t(1) << 52)) ? 0 : 1;
|
||||
d = to_double(mantissa, real_exponent, negative);
|
||||
return true;
|
||||
}
|
||||
if ((lower <= 1) && (power >= -4) && (power <= 23) && ((mantissa & 3) == 1)) {
|
||||
if ((mantissa << (upperbit + 64 - 53 - 2)) == upper) {
|
||||
mantissa &= ~1;
|
||||
}
|
||||
}
|
||||
mantissa += mantissa & 1;
|
||||
mantissa >>= 1;
|
||||
if (mantissa >= (1ULL << 53)) {
|
||||
mantissa = (1ULL << 52);
|
||||
real_exponent++;
|
||||
}
|
||||
mantissa &= ~(1ULL << 52);
|
||||
if (real_exponent > 2046) {
|
||||
return false;
|
||||
}
|
||||
d = to_double(mantissa, real_exponent, negative);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Parses a single digit character and updates the integer value.
|
||||
template<typename K>
|
||||
bool parse_digit(const K c, uint64_t& i) {
|
||||
auto digit = int_convert::toDigit<K, 10>(c);
|
||||
if (digit > 9) {
|
||||
return false;
|
||||
}
|
||||
i = 10 * i + digit;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
template<typename K>
|
||||
SIMSTR_API std::optional<double> impl_to_double(const K* start, const K* end) {
|
||||
auto get_value = [&](const K* pointer) -> K {
|
||||
if (pointer == end) {
|
||||
return '\0';
|
||||
}
|
||||
return *pointer;
|
||||
};
|
||||
const K* srcinit = start;
|
||||
bool negative = (get_value(start) == '-');
|
||||
start += (uint8_t)negative;
|
||||
if (end - start == 3) {
|
||||
if (!negative && (start[0] | 0x20) == K('n')) {
|
||||
if ((start[1] | 0x20) == K('a') && (start[2] | 0x20) == K('n')) {
|
||||
return std::nan("0");
|
||||
}
|
||||
} else if ((start[0] | 0x20) == K('i') && (start[1] | 0x20) == K('n') && (start[2] | 0x20) == K('f')) {
|
||||
return negative ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity();
|
||||
}
|
||||
}
|
||||
uint64_t digits = 0;
|
||||
const K* p = start;
|
||||
p += parse_digit(get_value(p), digits);
|
||||
bool leading_zero = (digits == 0);
|
||||
while (parse_digit(get_value(p), digits)) {
|
||||
p++;
|
||||
}
|
||||
if (p == start) {
|
||||
return {};
|
||||
}
|
||||
if ((leading_zero && p != start + 1)) {
|
||||
return {};
|
||||
}
|
||||
int64_t exponent = 0;
|
||||
int max_digits = 19;
|
||||
bool overflow;
|
||||
if (get_value(p) == '.') {
|
||||
p++;
|
||||
const K* start_decimal_digits = p;
|
||||
if (!parse_digit(get_value(p), digits)) {
|
||||
return {};
|
||||
} // no decimal digits
|
||||
p++;
|
||||
while (parse_digit(get_value(p), digits)) {
|
||||
p++;
|
||||
}
|
||||
exponent = -(p - start_decimal_digits);
|
||||
overflow = p - start - 1 > max_digits;
|
||||
if (overflow && leading_zero) {
|
||||
const K* start_digits = start + 2;
|
||||
while (get_value(start_digits) == '0') {
|
||||
start_digits++;
|
||||
}
|
||||
overflow = p - start_digits > max_digits;
|
||||
}
|
||||
} else {
|
||||
overflow = p - start > max_digits;
|
||||
}
|
||||
if (overflow) {
|
||||
return {};
|
||||
}
|
||||
if ((get_value(p) | 0x20) == K('e')) {
|
||||
p++;
|
||||
bool exp_neg = get_value(p) == '-';
|
||||
p += exp_neg || get_value(p) == '+';
|
||||
uint64_t exp = 0;
|
||||
const K* start_exp_digits = p;
|
||||
while (parse_digit(get_value(p), exp)) {
|
||||
p++;
|
||||
}
|
||||
if (p - start_exp_digits == 0 || p - start_exp_digits > max_digits) {
|
||||
return {};
|
||||
}
|
||||
exponent += exp_neg ? 0 - exp : exp;
|
||||
}
|
||||
|
||||
if (exponent < smallest_power || exponent > largest_power || p != end) {
|
||||
return {};
|
||||
}
|
||||
double d;
|
||||
if (!compute_float_64(exponent, digits, negative, d)) {
|
||||
return {};
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
template SIMSTR_API std::optional<double> impl_to_double<u8s>(const u8s* start, const u8s* end);
|
||||
template SIMSTR_API std::optional<double> impl_to_double<u16s>(const u16s* start, const u16s* end);
|
||||
template SIMSTR_API std::optional<double> impl_to_double<u32s>(const u32s* start, const u32s* end);
|
||||
|
||||
} // namespace simstr
|
||||
|
|
|
|||
|
|
@ -2,27 +2,25 @@
|
|||
# project specific logic here.
|
||||
#
|
||||
|
||||
add_executable(testStr test_str.cpp)
|
||||
add_executable(test_str test_str.cpp)
|
||||
add_executable(test_expr_only test_expr_only.cpp test_tostrexpr.cpp)
|
||||
|
||||
if (NOT SIMSTR_IN_SHARED)
|
||||
target_link_libraries(testStr simstr::simstr GTest::gtest_main)
|
||||
else()
|
||||
# Пример создания экзешника, если simstr экспортируются из dll.
|
||||
# Так как мы подключаем только simstr_dll, и входящие в неё либы не видны
|
||||
# нужно вручную задать каталоги include и стандарт C++20
|
||||
target_link_libraries(testStr simstr_dll GTest::gtest_main)
|
||||
get_target_property(SIMSTR_INCLUDES simstr::simstr INCLUDE_DIRECTORIES)
|
||||
target_include_directories(testStr PRIVATE ${SIMSTR_INCLUDES})
|
||||
target_compile_features(testStr PUBLIC cxx_std_20)
|
||||
endif()
|
||||
target_link_libraries(test_str simstr::simstr GTest::gtest_main)
|
||||
target_link_libraries(test_expr_only GTest::gtest_main)
|
||||
target_compile_features(test_str PUBLIC cxx_std_23)
|
||||
target_compile_features(test_expr_only PUBLIC cxx_std_23)
|
||||
|
||||
add_test(NAME testStr COMMAND testStr)
|
||||
add_test(NAME test_str COMMAND test_str)
|
||||
add_test(NAME test_expr_only COMMAND test_expr_only)
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set_target_properties (testStr PROPERTIES SUFFIX .html)
|
||||
target_compile_options(testStr PUBLIC -Wno-warn-absolute-paths -Wno-unknown-warning-option -msimd128 -msse4.2 -msse3)
|
||||
set_target_properties (test_str PROPERTIES SUFFIX .html)
|
||||
target_compile_options(test_str PUBLIC -Wno-warn-absolute-paths -Wno-unknown-warning-option -msimd128 -msse4.2 -msse3)
|
||||
set_target_properties (test_expr_only PROPERTIES SUFFIX .html)
|
||||
target_compile_options(test_expr_only PUBLIC -Wno-warn-absolute-paths -Wno-unknown-warning-option -msimd128 -msse4.2 -msse3)
|
||||
if(SIMSTR_EMSCRIPTEN_MT)
|
||||
target_compile_options(testStr PUBLIC -pthread)
|
||||
target_compile_options(test_str PUBLIC -pthread)
|
||||
target_compile_options(test_expr_only PUBLIC -pthread)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency-1")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sENVIRONMENT=web,worker")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,473 @@
|
|||
/*
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
* Test of simstr
|
||||
*/
|
||||
|
||||
#include "../include/simstr/strexpr.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include <format>
|
||||
#include <list>
|
||||
#include <array>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
namespace simstr::tests {
|
||||
|
||||
TEST(StrExpr, Empty) {
|
||||
std::string testa = eea;
|
||||
EXPECT_EQ(testa, "");
|
||||
|
||||
std::u8string testb = eeb;
|
||||
EXPECT_EQ(testb, u8"");
|
||||
|
||||
std::u16string testu = eeu;
|
||||
EXPECT_EQ(testu, u"");
|
||||
|
||||
std::u32string testuu = eeuu;
|
||||
EXPECT_EQ(testuu, U"");
|
||||
|
||||
std::wstring testw = eew;
|
||||
EXPECT_EQ(testw, L"");
|
||||
}
|
||||
|
||||
TEST(StrExpr, OpPlusChar) {
|
||||
std::string testa = "test"_ss + 'a';
|
||||
EXPECT_EQ(testa, "testa");
|
||||
testa += +testa + u8'b';
|
||||
EXPECT_EQ(testa, "testatestab");
|
||||
|
||||
std::u8string testb = u8"test"_ss + u8'a';
|
||||
EXPECT_EQ(testb, u8"testa");
|
||||
#ifdef _WIN32
|
||||
std::wstring testw = L"test"_ss + u'a' + L'b';
|
||||
EXPECT_EQ(testw, L"testab");
|
||||
|
||||
std::u16string testu = +u"test"sv + L'a';
|
||||
EXPECT_EQ(testu, u"testa");
|
||||
#else
|
||||
std::wstring testw = L"test"_ss + U'a' + U'b';
|
||||
EXPECT_EQ(testw, L"testab");
|
||||
|
||||
std::u32string testu = U"test"_ss + L'a';
|
||||
EXPECT_EQ(testu, U"testa");
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(StrExpr, Spaces) {
|
||||
std::string testa = "abc" + e_spca<10>() + "cde";
|
||||
EXPECT_EQ(testa, "abc cde");
|
||||
|
||||
std::u16string testu = u"abc" + e_c(10, u'_') + u"cde";
|
||||
EXPECT_EQ(testu, u"abc__________cde");
|
||||
}
|
||||
|
||||
TEST(StrExpr, PlusString) {
|
||||
std::string t = "aa"_ss + "bb"s;
|
||||
EXPECT_EQ(t, "aabb");
|
||||
const std::string add = "bb";
|
||||
std::string r = add + "aa"_ss;
|
||||
EXPECT_EQ(r, "bbaa");
|
||||
|
||||
}
|
||||
|
||||
TEST(StrExpr, Repeat) {
|
||||
std::string testa = "abc";
|
||||
testa = e_repeat(+testa + " " + 10 + "s.", 3);
|
||||
EXPECT_EQ(testa, "abc 10s.abc 10s.abc 10s.");
|
||||
std::wstring testw = L"abc";
|
||||
testw += L" " + e_repeat(+testw + L" " + 10 + L"s.", 3);
|
||||
EXPECT_EQ(testw, L"abc abc 10s.abc 10s.abc 10s.");
|
||||
}
|
||||
|
||||
TEST(StrExpr, OpPlusDifferentTypes) {
|
||||
std::string testa = "test"_ss + u8"test";
|
||||
EXPECT_EQ(testa, "testtest");
|
||||
|
||||
std::u8string testb = "test"_ss + u8"test";
|
||||
EXPECT_EQ(testb, u8"testtest");
|
||||
#ifdef _WIN32
|
||||
std::wstring testw = L"test"_ss + u"test";
|
||||
EXPECT_EQ(testw, L"testtest");
|
||||
|
||||
std::u16string testu = +u"test"sv + L"test";
|
||||
EXPECT_EQ(testu, u"testtest");
|
||||
#else
|
||||
std::wstring testw = L"test"_ss + U"test";
|
||||
EXPECT_EQ(testw, L"testtest");
|
||||
|
||||
std::u32string testu = U"test"_ss + L"test";
|
||||
EXPECT_EQ(testu, U"testtest");
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(StrExpr, AddNumber) {
|
||||
std::string testa = "test"_ss + 10;
|
||||
EXPECT_EQ(testa, "test10");
|
||||
|
||||
std::u8string testb = u8"test"_ss + 10;
|
||||
EXPECT_EQ(testb, u8"test10");
|
||||
|
||||
std::u16string testu = u"test"_ss + 10;
|
||||
EXPECT_EQ(testu, u"test10");
|
||||
|
||||
std::u32string testuu = U"test"_ss + 10;
|
||||
EXPECT_EQ(testuu, U"test10");
|
||||
|
||||
std::wstring testw = L"test"_ss + 10;
|
||||
EXPECT_EQ(testw, L"test10");
|
||||
}
|
||||
TEST(StrExpr, Choice) {
|
||||
std::string testa = "t = " + e_choice(true, "test", "t") + " " + 10 + e_if(true, " from "_ss + 20);
|
||||
EXPECT_EQ(testa, "t = test 10 from 20");
|
||||
testa = "t = " + e_choice(false, "test", "t") + " " + 10 + e_if(false, " from "_ss + 20);
|
||||
EXPECT_EQ(testa, "t = t 10");
|
||||
}
|
||||
|
||||
TEST(StrExpr, Fill) {
|
||||
std::string testa = "t = " + e_fill_left(+"test"s, 10);
|
||||
EXPECT_EQ(testa, "t = test");
|
||||
testa = "t = " + e_fill_right(+"test"s, 10, '-');
|
||||
EXPECT_EQ(testa, "t = test------");
|
||||
|
||||
std::u16string testu = u"t = " + e_fill_left(e_repl(u"test"sv, u"t", u"--"), 10);
|
||||
EXPECT_EQ(testu, u"t = --es--");
|
||||
}
|
||||
|
||||
TEST(StrExpr, Join) {
|
||||
std::vector<ssa> lst = {"abc", "def", "ghi"};
|
||||
std::string testa = "/" + e_join(lst, "-") + "/";
|
||||
EXPECT_EQ(testa, "/abc-def-ghi/");
|
||||
|
||||
std::vector<std::u16string_view> ulst = {u"abc", u"def", u"ghi"};
|
||||
std::u16string testu = u"/" + e_join(ulst, u"-") + u"/";
|
||||
EXPECT_EQ(testu, u"/abc-def-ghi/");
|
||||
|
||||
std::list<std::wstring> wlst = {L"abc", L"def", L"ghi"};
|
||||
std::wstring testw = L"/" + e_join(wlst, L"-") + L"/" + e_join(wlst, L"++");
|
||||
EXPECT_EQ(testw, L"/abc-def-ghi/abc++def++ghi");
|
||||
}
|
||||
|
||||
TEST(StrExpr, Replace) {
|
||||
std::string testa = e_repl("test"_ss, "t"sv, "-|-"s) + 10;
|
||||
EXPECT_EQ(testa, "-|-es-|-10");
|
||||
testa = e_repl("aaaaaaaaaaaaaaaa", "a", "bb");
|
||||
EXPECT_EQ(testa, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
|
||||
|
||||
testa = e_repl("aaaaaaaaaaaaaaaa"_ss, "a", "") + "-";
|
||||
EXPECT_EQ(testa, "-");
|
||||
|
||||
testa = e_repl("aaaaaaaaaaaaaaaaaad"_ss, "a", "bb");
|
||||
EXPECT_EQ(testa, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbd");
|
||||
testa = e_repl(testa, "bb", "a");
|
||||
EXPECT_EQ(testa, "aaaaaaaaaaaaaaaaaad");
|
||||
|
||||
std::u8string testb = e_repl(u8"test"sv, u8"t", u8"-|-") + 10;
|
||||
EXPECT_EQ(testb, u8"-|-es-|-10");
|
||||
|
||||
std::u16string testu = e_repl(u"test"sv, u"t", u"-|-") + 10;
|
||||
EXPECT_EQ(testu, u"-|-es-|-10");
|
||||
|
||||
std::u32string testuu = e_repl(U"test"sv, U"t", U"-|-") + 10;
|
||||
EXPECT_EQ(testuu, U"-|-es-|-10");
|
||||
|
||||
std::wstring testw = e_repl(L"test"s, L"t", L"-|-") + 10;
|
||||
EXPECT_EQ(testw, L"-|-es-|-10");
|
||||
}
|
||||
|
||||
size_t find_pos_str(const std::string& src, std::string_view name) {
|
||||
return src.find("\n- " + std::string(name) + " -\n");
|
||||
}
|
||||
|
||||
size_t find_pos_exp(const std::string& src, ssa name) {
|
||||
return src.find("\n- " + name + " -\n");
|
||||
}
|
||||
|
||||
TEST(StrExpr, FindConcatThree) {
|
||||
std::string src = "sdfsdf\n- testtest -\nsfrgdgfsg";
|
||||
EXPECT_EQ(find_pos_str(src, "testtest"sv), 6);
|
||||
EXPECT_EQ(find_pos_exp(src, "testtest"sv), 6);
|
||||
}
|
||||
|
||||
std::string buildTypeNameStr(std::string_view type_name, size_t prec, size_t scale) {
|
||||
std::string res{type_name};
|
||||
if (prec) {
|
||||
res += "(" + std::to_string(prec);
|
||||
if (scale) {
|
||||
res += "," + std::to_string(scale);
|
||||
}
|
||||
res += ")";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string buildTypeNameExp(std::string_view type_name, size_t prec, size_t scale) {
|
||||
if (prec) {
|
||||
return type_name + "("_ss + prec + e_if(scale, ","_ss + scale) + ")";
|
||||
}
|
||||
return std::string{type_name};
|
||||
}
|
||||
|
||||
TEST(StrExpr, MultiConcat) {
|
||||
EXPECT_EQ(buildTypeNameStr("integer", 0, 0), "integer");
|
||||
EXPECT_EQ(buildTypeNameStr("numeric", 10, 2), "numeric(10,2)");
|
||||
EXPECT_EQ(buildTypeNameExp("integer", 0, 0), "integer");
|
||||
EXPECT_EQ(buildTypeNameExp("numeric", 10, 2), "numeric(10,2)");
|
||||
}
|
||||
|
||||
int split_and_calc_total_str(std::string_view numbers, std::string_view delimiter) {
|
||||
int total = 0;
|
||||
for (size_t start = 0; start < numbers.length(); ) {
|
||||
int delim = numbers.find(delimiter, start);
|
||||
if (delim == std::string::npos) {
|
||||
delim = numbers.size();
|
||||
}
|
||||
std::string part{numbers.substr(start, delim - start)};
|
||||
total += std::strtol(part.c_str(), nullptr, 0);
|
||||
start = delim + delimiter.length();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
int split_and_calc_total_sim(ssa numbers, ssa delimiter) {
|
||||
int total = 0;
|
||||
for (auto splitter = numbers.splitter(delimiter); !splitter.is_done();) {
|
||||
total += splitter.next().as_int<int>();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
TEST(StrExpr, SplitCalcTotal) {
|
||||
const char NUMBER_LIST[] = "1-!- 2-!- 3-!- 4 -!- 5-!- 6 -!- 7-!- -8-!- 0xaF-!- 15-!- 010"; // 218
|
||||
const char delim[] = "-!-";
|
||||
EXPECT_EQ(split_and_calc_total_str(NUMBER_LIST, delim), 218);
|
||||
EXPECT_EQ(split_and_calc_total_sim(NUMBER_LIST, delim), 218);
|
||||
}
|
||||
|
||||
TEST(StrExpr, StdToSimplestr) {
|
||||
std::string test = " sdfsg ";
|
||||
std::string_view res = ssa{test}.trimmed();
|
||||
EXPECT_EQ(res, "sdfsg");
|
||||
|
||||
size_t fnd = test.find(" " + std::string{res});
|
||||
EXPECT_EQ(fnd, 2);
|
||||
}
|
||||
|
||||
TEST(StrExpr, StrChange) {
|
||||
{
|
||||
std::string str = "test";
|
||||
EXPECT_EQ(str::change(str, 1, 2, "new val"_ss + 10), "tnew val10t");
|
||||
}
|
||||
{
|
||||
std::string str = "test";
|
||||
EXPECT_EQ(str::change(str, 0, 0, "new val"_ss + 10), "new val10test");
|
||||
}
|
||||
{
|
||||
std::string str = "test";
|
||||
EXPECT_EQ(str::change(str, 100, 100, u8"new val"_ss + 10), "testnew val10");
|
||||
}
|
||||
{
|
||||
std::string str = "test";
|
||||
EXPECT_EQ(str |= u8"new val"_ss + 10, "testnew val10");
|
||||
}
|
||||
{
|
||||
std::string str = "test";
|
||||
EXPECT_EQ(str ^= u8"new val"_ss + 10, "new val10test");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(StrExpr, StrReplace) {
|
||||
{
|
||||
std::string src = "-aaaaaaaaaaaaaaaa--";
|
||||
EXPECT_EQ(str::replace(src, "a", "aa"), "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--");
|
||||
EXPECT_EQ(str::replace(src, "aa", "b"), "-bbbbbbbbbbbbbbbb--");
|
||||
EXPECT_EQ(str::replace(src, "b", ""_ss), "---");
|
||||
}
|
||||
{
|
||||
std::string src = "-aaaaaaaaaaaaaaaaaa--";
|
||||
EXPECT_EQ(str::replace(src, "a", "aa"), "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--");
|
||||
}
|
||||
{
|
||||
std::string src = "-aaaaaaaaaaaaaaaa--";
|
||||
EXPECT_EQ(str::replace(src, "a", "a"_ss + "a"), "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--");
|
||||
EXPECT_EQ(str::replace(src, "aa", eea + "b"), "-bbbbbbbbbbbbbbbb--");
|
||||
EXPECT_EQ(str::replace(src, "b", eea), "---");
|
||||
}
|
||||
{
|
||||
std::u16string src = u"-aaaaaaaaaaaaaaaa--";
|
||||
EXPECT_EQ(str::replace(src, u"a", u"vv", 5, 3), u"-aaaavvvvvvaaaaaaaaa--");
|
||||
}
|
||||
{
|
||||
std::u16string src = u"-aaaaaaaaaaaaaaaa--";
|
||||
EXPECT_EQ(str::replace(src, u"a", u"vv"_ss + 10, 5, 3), u"-aaaavv10vv10vv10aaaaaaaaa--");
|
||||
}
|
||||
{
|
||||
std::u32string a = U"<" + e_repl(U"test"sv, U"t", U"a" + e_repl(U"test"s, U"es", U"se")) + U">";
|
||||
EXPECT_EQ(a, U"<atsetesatset>");
|
||||
}
|
||||
{
|
||||
std::string a = u8"<" + e_repl("test"sv, "t", u8"a" + e_repl("test"s, "es", "se")) + ">";
|
||||
EXPECT_EQ(a, "<atsetesatset>");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(StrExpr, Concat) {
|
||||
std::string tt;
|
||||
std::string c = e_concat(eea + "," + " ", u8"bb", tt, 1, e_if(true, "--"), e_hex<HexFlags::Short>(16), 1.2);
|
||||
EXPECT_EQ(c, "bb, , 1, --, 0x10, 1.2");
|
||||
|
||||
std::string_view text = "testes";
|
||||
int count = 10;
|
||||
std::string t = e_concat("", text, " = ", count, " times.");
|
||||
EXPECT_EQ(t, "testes = 10 times.");
|
||||
}
|
||||
|
||||
TEST(StrExpr, Subst) {
|
||||
const auto ttt = "test"_ss;
|
||||
int ii = 3;
|
||||
std::string t = e_subst("Test {{--}} {}=, {}", ttt, ii);
|
||||
EXPECT_EQ(t, "Test {--} test=, 3");
|
||||
t = e_subst("Test {2}={1}, {2}, {1}", "test", 2);
|
||||
EXPECT_EQ(t, "Test 2=test, 2, test");
|
||||
|
||||
std::u16string u16t = e_subst(u"Test {}={}, {}", u"test", 2, u"test"sv);
|
||||
EXPECT_EQ(u16t, u"Test test=2, test");
|
||||
}
|
||||
|
||||
TEST(StrExpr, VSubst) {
|
||||
const auto ttt = "test"_ss;
|
||||
int ii = 3;
|
||||
auto pattern = "Test {{--}} {}=, {}"_ss;
|
||||
std::string t = e_vsubst(pattern, ttt, ii);
|
||||
EXPECT_EQ(t, "Test {--} test=, 3");
|
||||
t = e_vsubst("{1}-{1}-{1}-{1}-{1}-{1}-{1}-{1}"_ss, "abc");
|
||||
EXPECT_EQ(t, "abc-abc-abc-abc-abc-abc-abc-abc");
|
||||
}
|
||||
|
||||
TEST(StrExpr, EInt) {
|
||||
std::string kk = eea + e_int<10, f::c | f::w<10> | f::f<'_'> | f::sp>(123);
|
||||
EXPECT_EQ(kk, "___+123___");
|
||||
std::u16string uk = eeu + e_int<2, f::p>(123);
|
||||
EXPECT_EQ(uk, u"0b1111011");
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z>(123);
|
||||
std::string kf = std::format("{:#011b}", 123);
|
||||
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z>(-123);
|
||||
kf = std::format("{:#011b}", -123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z | f::sp>(123);
|
||||
kf = std::format("{:+#011b}", 123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z | f::sp>(-123);
|
||||
kf = std::format("{:+#011b}", -123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z | f::ss>(123);
|
||||
kf = std::format("{: #011b}", 123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::z | f::ss>(-123);
|
||||
kf = std::format("{: #011b}", -123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::w<11> | f::r | f::f<'_'>| f::ss>(-123);
|
||||
kf = std::format("{:_> 11b}", -123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::w<11> | f::r | f::f<'_'>| f::ss>(123);
|
||||
kf = std::format("{:_> 11b}", 123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
kk = eea + e_int<2, f::p | f::w<11> | f::r | f::f<'_'>| f::ss>(123);
|
||||
kf = std::format("{:_> #11b}", 123);
|
||||
EXPECT_EQ(kk, kf);
|
||||
|
||||
//EXPECT_EQ(kk, "0b001111011");
|
||||
//std::cout << std::format("'{:+#011b}'\n", 123);
|
||||
|
||||
//std::cout << std::format("'{:+#011b}'\n", -123);
|
||||
//EXPECT_EQ(kk, std::format("{:#011b}", -123));
|
||||
|
||||
std::u32string uu = eeuu + e_int<16, f::wp | f::p | f::u | f::z/* | f::r*/>(123, 9);
|
||||
EXPECT_EQ(uu, U"0x000007B");
|
||||
}
|
||||
|
||||
TEST(StrExpr, EIntFmt) {
|
||||
std::string test = "'0x"_ss + 10 / 0x16E08_fmt + "' " + 10 / 0x11'8EF5f_fmt;
|
||||
EXPECT_EQ(test, "'0x0000000A' _______A");
|
||||
test = 100 / 0x2a010_fmt;
|
||||
EXPECT_EQ(test, "0b01100100");
|
||||
}
|
||||
|
||||
TEST(StrExpr, ChangeCase) {
|
||||
std::string res = e_ascii_upper("teSt");
|
||||
EXPECT_EQ(res, "TEST");
|
||||
res = "/" + e_ascii_lower(res) + "/";
|
||||
EXPECT_EQ(res, "/test/");
|
||||
|
||||
EXPECT_EQ(str::make_ascii_upper(res), "/TEST/");
|
||||
|
||||
str::make_ascii_lower(res, 1, 3);
|
||||
EXPECT_EQ(res, "/teST/");
|
||||
|
||||
std::wstring wres = e_ascii_lower(L"TeSt"_ss);
|
||||
EXPECT_EQ(wres, L"test");
|
||||
|
||||
std::u16string ures = u"/test/";
|
||||
EXPECT_EQ(str::make_ascii_upper(ures), u"/TEST/");
|
||||
|
||||
str::make_ascii_lower(ures, 1, 3);
|
||||
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,9 +1,18 @@
|
|||
#include <simstr/sstring.h>
|
||||
/*
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
* Test of simstr
|
||||
*/
|
||||
|
||||
#include <simstr/sstring.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace simstr::tests {
|
||||
using namespace std::literals;
|
||||
|
||||
namespace simstr::tests {
|
||||
|
||||
class Tstringa: public stringa {
|
||||
public:
|
||||
using stringa::stringa;
|
||||
|
|
@ -15,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) {
|
||||
|
|
@ -262,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");
|
||||
|
|
@ -277,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");
|
||||
|
|
@ -318,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);
|
||||
|
|
@ -475,6 +532,17 @@ TEST(SimStr, ToInt) {
|
|||
TEST(SimStr, to_double) {
|
||||
EXPECT_EQ(ssa{" 123"}.to_double(), 123.0);
|
||||
EXPECT_EQ(ssa{" 123.1"}.to_double(), 123.1);
|
||||
EXPECT_EQ(ssb{u8" 123"}.to_double(), 123.0);
|
||||
EXPECT_EQ(ssb{u8" 123.1"}.to_double(), 123.1);
|
||||
EXPECT_EQ(ssu{u" 123.13434"}.to_double(), 123.13434);
|
||||
EXPECT_EQ(ssuu{U" 123.13434"}.to_double(), 123.13434);
|
||||
EXPECT_EQ(ssw{L" 123.13434"}.to_double(), 123.13434);
|
||||
|
||||
EXPECT_EQ(ssa{" -123"}.to_double(), -123.0);
|
||||
EXPECT_EQ(ssa{" +123.12"}.to_double(), 123.12);
|
||||
EXPECT_EQ(ssu{u" 123.134e5"}.to_double(), 123.134e5);
|
||||
EXPECT_EQ(ssuu{U" 123.13E-2"}.to_double(), 123.13e-2);
|
||||
EXPECT_EQ(ssa{" ab.1fp4"}.to_double_hex(), 0xab.1fp4);
|
||||
}
|
||||
|
||||
TEST(SimStr, Split) {
|
||||
|
|
@ -513,48 +581,48 @@ TEST(SimStr, IsAscii) {
|
|||
}
|
||||
|
||||
TEST(SimStr, ChangeCase) {
|
||||
EXPECT_EQ(ssa{"TEST"}.uppered_only_ascii<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"Test"}.uppered_only_ascii<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"TEST"}.upperred_only_ascii<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"Test"}.upperred_only_ascii<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"test"}.lowered_only_ascii<stringa>(), "test");
|
||||
EXPECT_EQ(ssa{"Test"}.lowered_only_ascii<stringa>(), "test");
|
||||
EXPECT_EQ(ssa{"TestПрОвЕрКа"}.uppered_only_ascii<stringa>(), "TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssa{"TestПрОвЕрКа"}.upperred_only_ascii<stringa>(), "TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssa{"TestПрОвЕрКа"}.lowered_only_ascii<stringa>(), "testПрОвЕрКа");
|
||||
EXPECT_EQ(ssa{"TestПрОвЕрКа"}.uppered<stringa>(), "TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssa{"TestПрОвЕрКа"}.upperred<stringa>(), "TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssa{"tesTПрОвЕрКа"}.lowered<stringa>(), "testпроверка");
|
||||
EXPECT_EQ(ssa{"TEST"}.uppered<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"TEST"}.upperred<stringa>(), "TEST");
|
||||
EXPECT_EQ(ssa{"test"}.lowered<stringa>(), "test");
|
||||
EXPECT_EQ(ssa{"TESTПРОВЕРКА"}.uppered<stringa>(), "TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssa{"TESTПРОВЕРКА"}.upperred<stringa>(), "TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssa{"testпроверка"}.lowered<stringa>(), "testпроверка");
|
||||
EXPECT_EQ(ssa{"tesTİiȺⱥȾⱦẞßΩФывAsd"}.lowered<stringa>(), "testiiⱥⱥⱦⱦßßωфывasd");
|
||||
EXPECT_EQ(ssa{"testⱢɱⱮɽⱤWas"}.uppered<stringa>(), "TESTⱢⱮⱮⱤⱤWAS");
|
||||
EXPECT_EQ(ssa{"testⱢɱⱮɽⱤWas"}.upperred<stringa>(), "TESTⱢⱮⱮⱤⱤWAS");
|
||||
|
||||
EXPECT_EQ(ssu{u"TEST"}.uppered_only_ascii<stringu>(), u"TEST");
|
||||
EXPECT_EQ(ssu{u"TEST"}.upperred_only_ascii<stringu>(), u"TEST");
|
||||
EXPECT_EQ(ssu{u"test"}.lowered_only_ascii<stringu>(), u"test");
|
||||
EXPECT_EQ(ssu{u"Test"}.uppered_only_ascii<stringu>(), u"TEST");
|
||||
EXPECT_EQ(ssu{u"Test"}.upperred_only_ascii<stringu>(), u"TEST");
|
||||
EXPECT_EQ(ssu{u"Test"}.lowered_only_ascii<stringu>(), u"test");
|
||||
EXPECT_EQ(ssu{u"TestПрОвЕрКа"}.uppered_only_ascii<stringu>(), u"TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssu{u"TestПрОвЕрКа"}.upperred_only_ascii<stringu>(), u"TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssu{u"TestПрОвЕрКа"}.lowered_only_ascii<stringu>(), u"testПрОвЕрКа");
|
||||
EXPECT_EQ(ssu{u"TestПрОвЕрКа"}.uppered<stringu>(), u"TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssu{u"TestПрОвЕрКа"}.upperred<stringu>(), u"TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssu{u"tesTПрОвЕрКа"}.lowered<stringu>(), u"testпроверка");
|
||||
EXPECT_EQ(ssu{u"tesTİiȺⱥȾⱦẞßΩФывAsd"}.lowered<stringu>(), u"testiiⱥⱥⱦⱦßßωфывasd");
|
||||
EXPECT_EQ(ssu{u"testⱢɱⱮɽⱤWas"}.uppered<stringu>(), u"TESTⱢⱮⱮⱤⱤWAS");
|
||||
EXPECT_EQ(ssu{u"testⱢɱⱮɽⱤWas"}.upperred<stringu>(), u"TESTⱢⱮⱮⱤⱤWAS");
|
||||
|
||||
EXPECT_EQ(ssw{L"TEST"}.uppered_only_ascii<stringw>(), L"TEST");
|
||||
EXPECT_EQ(ssw{L"TEST"}.upperred_only_ascii<stringw>(), L"TEST");
|
||||
EXPECT_EQ(ssw{L"test"}.lowered_only_ascii<stringw>(), L"test");
|
||||
EXPECT_EQ(ssw{L"Test"}.uppered_only_ascii<stringw>(), L"TEST");
|
||||
EXPECT_EQ(ssw{L"Test"}.upperred_only_ascii<stringw>(), L"TEST");
|
||||
EXPECT_EQ(ssw{L"Test"}.lowered_only_ascii<stringw>(), L"test");
|
||||
EXPECT_EQ(ssw{L"TestПрОвЕрКа"}.uppered_only_ascii<stringw>(), L"TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssw{L"TestПрОвЕрКа"}.upperred_only_ascii<stringw>(), L"TESTПрОвЕрКа");
|
||||
EXPECT_EQ(ssw{L"TestПрОвЕрКа"}.lowered_only_ascii<stringw>(), L"testПрОвЕрКа");
|
||||
EXPECT_EQ(ssw{L"TestПрОвЕрКа"}.uppered<stringw>(), L"TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssw{L"TestПрОвЕрКа"}.upperred<stringw>(), L"TESTПРОВЕРКА");
|
||||
EXPECT_EQ(ssw{L"tesTПрОвЕрКа"}.lowered<stringw>(), L"testпроверка");
|
||||
EXPECT_EQ(ssw{L"tesTİiȺⱥȾⱦẞßΩФывAsd"}.lowered<stringw>(), L"testiiⱥⱥⱦⱦßßωфывasd");
|
||||
EXPECT_EQ(ssw{L"testⱢɱⱮɽⱤWas"}.uppered<stringw>(), L"TESTⱢⱮⱮⱤⱤWAS");
|
||||
EXPECT_EQ(ssw{L"testⱢɱⱮɽⱤWas"}.upperred<stringw>(), L"TESTⱢⱮⱮⱤⱤWAS");
|
||||
}
|
||||
|
||||
TEST(SimStr, Replace) {
|
||||
EXPECT_EQ(ssa{"testing"}.replaced<stringa>("t", "--"), "--es--ing");
|
||||
EXPECT_EQ(ssa{"testing"}.replaced<stringa>("t", ""), "esing");
|
||||
EXPECT_EQ(stringa{ssa{"testing"}.replace_init("t", "--")}, "--es--ing");
|
||||
EXPECT_EQ(stringa{e_repl(ssa{"testing"}, "t", "--")}, "--es--ing");
|
||||
}
|
||||
|
||||
TEST(SimStr, Trim) {
|
||||
|
|
@ -790,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"};
|
||||
|
|
@ -919,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');
|
||||
|
|
@ -940,13 +1008,23 @@ TEST(SimStr, LStringAssign) {
|
|||
|
||||
TEST(SimStr, UtfConvert) {
|
||||
EXPECT_EQ(stringa{ssu{u"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{ssb{u8"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{ssw{L"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{stringu{u"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{stringw{L"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{lstringu<40>{u"testпройден"}}, "testпройден");
|
||||
EXPECT_EQ(stringa{lstringw<40>{L"testпройден"}}, "testпройден");
|
||||
|
||||
EXPECT_EQ(stringb{ssu{u"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{ssa{u8"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{ssw{L"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{stringu{u"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{stringw{L"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{lstringu<40>{u"testпройден"}}, u8"testпройден");
|
||||
EXPECT_EQ(stringb{lstringw<40>{L"testпройден"}}, u8"testпройден");
|
||||
|
||||
EXPECT_EQ(stringu{ssa{"testпройден"}}, u"testпройден");
|
||||
EXPECT_EQ(stringu{ssb{u8"testпройден"}}, u"testпройден");
|
||||
EXPECT_EQ(stringu{ssw{L"testпройден"}}, u"testпройден");
|
||||
EXPECT_EQ(stringu{stringa{"testпройден"}}, u"testпройден");
|
||||
EXPECT_EQ(stringu{stringw{L"testпройден"}}, u"testпройден");
|
||||
|
|
@ -1061,6 +1139,16 @@ TEST(SimStr, ExprNum) {
|
|||
}
|
||||
|
||||
TEST(SimStr, LStrSelfReplace) {
|
||||
{
|
||||
lstringa<40> test = "-aaaaaaaaaaaaaaaa--";
|
||||
test.replace("a", "aa");
|
||||
EXPECT_EQ(test, "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--");
|
||||
}
|
||||
{
|
||||
lstringa<40> test = "-aaaaaaaaaaaaaaaaaa--";
|
||||
test.replace("a", "aa");
|
||||
EXPECT_EQ(test, "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--");
|
||||
}
|
||||
{
|
||||
lstringa<40> test = "test string";
|
||||
ssa before = test;
|
||||
|
|
@ -1270,6 +1358,39 @@ TEST(SimStr, LStrFormat) {
|
|||
text.format(L"{}", L"tested");
|
||||
EXPECT_EQ(text, L"tested");
|
||||
}
|
||||
#ifdef _WIN32
|
||||
{
|
||||
// char16_t в Windows совместим по размеру с wchar_t, поэтому для его форматирования можно использовать
|
||||
// L"format_string", и передавать char16_t строковые объекты
|
||||
// char16_t on Windows is compatible in size with wchar_t, so you can use L"format_string" to format it
|
||||
// and pass char16_t string objects
|
||||
lstringu<2> text;
|
||||
text.format(L"{}{}", 'a', 'b');
|
||||
EXPECT_EQ(text, u"ab");
|
||||
text.format(L"{}{}", L"tested", text);
|
||||
EXPECT_EQ(text, u"testedab");
|
||||
|
||||
lstringw<10> tew;
|
||||
tew.format(L"-{}-", text);
|
||||
EXPECT_EQ(tew, L"-testedab-");
|
||||
}
|
||||
#else
|
||||
{
|
||||
// char32_t в Linux совместим по размеру с wchar_t, поэтому для его форматирования можно использовать
|
||||
// L"format_string", и передавать char32_t строковые объекты
|
||||
// char32_t on Linux is compatible in size with wchar_t, so you can use L"format_string" to format it
|
||||
// and pass char32_t string objects
|
||||
lstringuu<2> text;
|
||||
text.format(L"{}{}", 'a', 'b');
|
||||
EXPECT_EQ(text, U"ab");
|
||||
text.format(L"{}{}", L"tested", text);
|
||||
EXPECT_EQ(text, U"testedab");
|
||||
|
||||
lstringw<10> tew;
|
||||
tew.format(L"-{}-", text);
|
||||
EXPECT_EQ(tew, L"-testedab-");
|
||||
}
|
||||
#endif
|
||||
{
|
||||
lstringa<40> text = "tested";
|
||||
text.format_from(4, "{}{}", 'a', 'b');
|
||||
|
|
@ -1323,13 +1444,13 @@ TEST(SimStr, LStrJoinAndExpressions) {
|
|||
|
||||
int k = 10;
|
||||
double d = 12.1;
|
||||
lstringa<10> test = ">" + e_repl(buffer.to_str(), "<>", "-") + k + ", " + d;
|
||||
lstringa<10> test = ">" + e_repl(buffer, "<>", "-") + k + ", " + d;
|
||||
EXPECT_EQ(test, ">asd-fgh-jkl10, 12.1");
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
|
@ -1694,6 +1815,10 @@ TEST(SimStr, StdStringExpr) {
|
|||
lstringa<20> res = eea + "test"s;
|
||||
EXPECT_EQ(res, "test");
|
||||
}
|
||||
{
|
||||
lstringa<20> res = +"test"s;
|
||||
EXPECT_EQ(res, "test");
|
||||
}
|
||||
{
|
||||
lstringa<20> res = "test"s + eea;
|
||||
EXPECT_EQ(res, "test");
|
||||
|
|
@ -1702,55 +1827,20 @@ TEST(SimStr, StdStringExpr) {
|
|||
lstringa<20> res = eea + "test"sv;
|
||||
EXPECT_EQ(res, "test");
|
||||
}
|
||||
{
|
||||
lstringa<20> res = +"test"sv;
|
||||
EXPECT_EQ(res, "test");
|
||||
}
|
||||
{
|
||||
lstringu<20> res = +u"test"sv;
|
||||
EXPECT_EQ(res, u"test");
|
||||
}
|
||||
{
|
||||
lstringa<20> res = "test"sv + eea;
|
||||
EXPECT_EQ(res, "test");
|
||||
}
|
||||
}
|
||||
|
||||
static std::string checker_str = "str";
|
||||
static std::string_view checker_view;
|
||||
|
||||
static std::string get_string_val();
|
||||
static std::string& get_string_ref(){return checker_str;}
|
||||
static const std::string get_string_cval();
|
||||
static const std::string& get_string_cref(){return checker_str;}
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(std::string{""});}
|
||||
char check_lvalue_str();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(""s);}
|
||||
char check_lvalue_str();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(get_string_val());}
|
||||
char check_lvalue_str();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(get_string_cval());}
|
||||
char check_lvalue_str();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(checker_str);}
|
||||
int check_lvalue_str();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(std::string_view{""});}
|
||||
char check_lvalue_view();
|
||||
|
||||
template<typename K>
|
||||
requires requires{new simple_str<K>(checker_view);}
|
||||
int check_lvalue_view();
|
||||
|
||||
TEST(SimStr, InitFromLValueStdStrings) {
|
||||
EXPECT_EQ(sizeof(check_lvalue_str<u8s>()), sizeof(int));
|
||||
EXPECT_EQ(sizeof(check_lvalue_view<u8s>()), sizeof(int));
|
||||
EXPECT_EQ(ssa(get_string_ref()), "str");
|
||||
EXPECT_EQ(ssa(get_string_cref()), "str");
|
||||
}
|
||||
|
||||
TEST(SimStr, HashStrMapAt) {
|
||||
hashStrMapA<int> test = {
|
||||
{"Test"_h, 1}
|
||||
|
|
@ -1760,4 +1850,376 @@ TEST(SimStr, HashStrMapAt) {
|
|||
EXPECT_EQ(test.find("Test")->second, 2);
|
||||
}
|
||||
|
||||
TEST(SimStr, ExprRepeat) {
|
||||
EXPECT_EQ(stringa{e_repeat("aa", 3)}, "aaaaaa");
|
||||
int t = 1;
|
||||
EXPECT_EQ(lstringa<40>{e_repeat("aa"_ss + t + "_", 3)}, "aa1_aa1_aa1_");
|
||||
EXPECT_EQ(std::string{e_repeat("aa"_ss + t + "_", 3)}, "aa1_aa1_aa1_");
|
||||
}
|
||||
|
||||
TEST(SimStr, StrExpToStdString) {
|
||||
std::basic_string<u8s, std::char_traits<u8s>, std::pmr::polymorphic_allocator<u8s>> test = "count = "_ss + 10 + " times";
|
||||
EXPECT_EQ(test, "count = 10 times");
|
||||
|
||||
test = "aaa"_ss;
|
||||
EXPECT_EQ(test, "aaa");
|
||||
EXPECT_EQ("aaa"_ss.to_sv(), "aaa");
|
||||
|
||||
std::string auto_utf = e_utf<u8s>(u"Привет"_ss);
|
||||
EXPECT_EQ(auto_utf, "Привет");
|
||||
auto_utf = e_utf<u8s>(L"Досвидания"_ss);
|
||||
EXPECT_EQ(auto_utf, "Досвидания");
|
||||
|
||||
std::string res = +"test "s + 10 + e_if(true, " times");
|
||||
EXPECT_EQ(res, "test 10 times");
|
||||
|
||||
res = +"test "sv + 10 + e_if(true, " times");
|
||||
EXPECT_EQ(res, "test 10 times");
|
||||
}
|
||||
std::string make_text(const std::string& text, int count, std::string_view what, std::string_view what_p = ""sv) {
|
||||
return +text + " " + count + " " + e_choice(what_p.empty(), what + e_if(count > 1, "s"), e_choice(count > 1, +what_p, +what));
|
||||
}
|
||||
|
||||
std::string make_answer(const std::string& text, int count, std::string_view what, std::string_view what_p = ""sv) {
|
||||
return "Answer is: " + +text + " " + count + " " + e_choice(what_p.empty(), what + e_if(count > 1, "s"), e_choice(count > 1, +what_p, +what));
|
||||
}
|
||||
|
||||
TEST(SimStr, StrPrintfU8) {
|
||||
stringb tt = u8"asdf";
|
||||
stringa tr = tt;
|
||||
EXPECT_EQ(tr, "asdf");
|
||||
tt = tr;
|
||||
EXPECT_EQ(tt, u8"asdf");
|
||||
|
||||
lstringb<100> res;
|
||||
res.printf(u8"asd %i", 10);
|
||||
EXPECT_EQ(res, u8"asd 10");
|
||||
|
||||
std::u8string std_bstr = u8"def";
|
||||
std::vector<ssa> ll = {"qwe", "rty"};
|
||||
|
||||
stringb bstring = eea + "abc" + u8"def" + 10 + e_spca<3>() + e_join(ll, "-");
|
||||
EXPECT_EQ(bstring, u8"abcdef10 qwe-rty");
|
||||
|
||||
stringa check_choice = e_choice(true, eea + 10, u8"aaa");
|
||||
EXPECT_EQ(check_choice, "10");
|
||||
|
||||
check_choice = e_choice(false, eea + 10, u8"aaa");
|
||||
EXPECT_EQ(check_choice, "aaa");
|
||||
|
||||
check_choice = e_choice(true, "aaa", u8"aaa");
|
||||
EXPECT_EQ(check_choice, "aaa");
|
||||
|
||||
check_choice = eea + e_if(true, u8"aaa");
|
||||
EXPECT_EQ(check_choice, "aaa");
|
||||
|
||||
check_choice = eeb + e_if(true, "aaa");
|
||||
EXPECT_EQ(check_choice, "aaa");
|
||||
std::wstring wstr = L"test"sv +
|
||||
#if WIN32
|
||||
u"test"_ss
|
||||
#else
|
||||
U"test"_ss
|
||||
#endif
|
||||
;
|
||||
EXPECT_EQ(wstr, L"testtest");
|
||||
|
||||
EXPECT_EQ(make_text("got"s, 10, "apple"sv), "got 10 apples");
|
||||
EXPECT_EQ(make_answer("got"s, 10, "aloe"sv, "aloe"sv), "Answer is: got 10 aloe");
|
||||
}
|
||||
|
||||
TEST(SimStr, ExprReal) {
|
||||
stringa a = e_num<u8s>(1.1);
|
||||
EXPECT_EQ(a, "1.1");
|
||||
|
||||
stringb b = e_num<ubs>(1.1);
|
||||
EXPECT_EQ(b, u8"1.1");
|
||||
|
||||
stringuu uu = e_num<u32s>(1.1);
|
||||
EXPECT_EQ(uu, U"1.1");
|
||||
|
||||
stringu u = e_num<u16s>(1.1);
|
||||
EXPECT_EQ(u, u"1.1");
|
||||
|
||||
stringw w = e_num<uws>(1.1);
|
||||
EXPECT_EQ(w, L"1.1");
|
||||
}
|
||||
|
||||
TEST(SimStr, StrRepl) {
|
||||
std::string r = e_repl("test"s, "t", "-t-");
|
||||
EXPECT_EQ(r, "-t-es-t-");
|
||||
|
||||
r = e_repl("test"sv, "t", "-t-");
|
||||
EXPECT_EQ(r, "-t-es-t-");
|
||||
|
||||
r = e_repl("test"sv, "t"s, "-t-");
|
||||
EXPECT_EQ(r, "-t-es-t-");
|
||||
|
||||
r = e_repl("test"sv, "t", "-t-"sv);
|
||||
EXPECT_EQ(r, "-t-es-t-");
|
||||
|
||||
r = e_repl("test"s, "t"sv, "-t-"s);
|
||||
EXPECT_EQ(r, "-t-es-t-");
|
||||
|
||||
stringa a = e_repl("test"_ss, "t", "-t-");
|
||||
EXPECT_EQ(a, "-t-es-t-");
|
||||
|
||||
a = e_repl("test"_ss, "t"_ss, "-t-");
|
||||
EXPECT_EQ(a, "-t-es-t-");
|
||||
|
||||
a = e_repl("test"_ss, "t", "-t-"_ss);
|
||||
EXPECT_EQ(a, "-t-es-t-");
|
||||
|
||||
a = e_repl("test"_ss, "t"_ss, "-t-"_ss);
|
||||
EXPECT_EQ(a, "-t-es-t-");
|
||||
|
||||
a = e_repl("test"_ss, "t", "a"_ss + "1" + 10);
|
||||
EXPECT_EQ(a, "a110esa110");
|
||||
|
||||
a = e_repl("test"_ss, "x", "a"_ss + "1" + 10);
|
||||
EXPECT_EQ(a, "test");
|
||||
|
||||
a = e_repl("test"_ss, "t", eea + "a");
|
||||
EXPECT_EQ(a, "aesa");
|
||||
|
||||
a = e_repl("tesd"_ss, "t", eea + "a");
|
||||
EXPECT_EQ(a, "aesd");
|
||||
|
||||
a = e_repl("tttt"_ss, "t", eea);
|
||||
EXPECT_EQ(a, "");
|
||||
|
||||
a = e_repl("-tttttttttttttttttt-"_ss, "t", eea + "a");
|
||||
EXPECT_EQ(a, "-aaaaaaaaaaaaaaaaaa-");
|
||||
|
||||
a = e_repl("-tttttttttttttttttt-"_ss, "t", eea + "aa");
|
||||
EXPECT_EQ(a, "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-");
|
||||
|
||||
a = "<" + e_repl("test"sv, "t", "a" + e_repl("test"s, "es", "se")) + ">";
|
||||
EXPECT_EQ(a, "<atsetesatset>");
|
||||
}
|
||||
|
||||
TEST(SimStr, HexEpr) {
|
||||
stringa hexa = expr_hex<u8s, unsigned, true, true, true>{0xabcd0102};
|
||||
EXPECT_EQ(hexa, "0xABCD0102");
|
||||
|
||||
stringu hexu = expr_hex<u16s, unsigned, true, true, true>{0xabcd0102};
|
||||
EXPECT_EQ(hexu, u"0xABCD0102");
|
||||
|
||||
stringuu hexuu = expr_hex<u32s, unsigned, true, true, true>{0xabcd0102};
|
||||
EXPECT_EQ(hexuu, U"0xABCD0102");
|
||||
|
||||
stringb hexb = expr_hex<ubs, unsigned, true, true, true>{0xcd0102};
|
||||
EXPECT_EQ(hexb, u8"0x00CD0102");
|
||||
|
||||
hexb = expr_hex<ubs, int, true, true, true>{0xcd0102};
|
||||
EXPECT_EQ(hexb, u8"0x00CD0102");
|
||||
|
||||
hexb = expr_hex<ubs, int, true, true, true>{-0xcd0102};
|
||||
EXPECT_EQ(hexb, u8"-0x00CD0102");
|
||||
|
||||
hexa = expr_hex<u8s, uint64_t, true, false, false>{0xabcd0102};
|
||||
EXPECT_EQ(hexa, "00000000abcd0102");
|
||||
|
||||
hexa = expr_hex<u8s, uint32_t, false, false, false>{0};
|
||||
EXPECT_EQ(hexa, "0");
|
||||
hexa = expr_hex<u8s, uint32_t, false, false, true>{0};
|
||||
EXPECT_EQ(hexa, "0x0");
|
||||
hexa = expr_hex<u8s, uint32_t, true, false, true>{0};
|
||||
EXPECT_EQ(hexa, "0x00000000");
|
||||
|
||||
std::string text = +"val = "sv + e_hex(10u);
|
||||
EXPECT_EQ(text, "val = 0x0000000A");
|
||||
|
||||
stringu textu = u"val = 0X"_ss + e_hex<HexFlags::No0x | HexFlags::Short | HexFlags::Lcase>(0x12Au);
|
||||
EXPECT_EQ(textu, u"val = 0X12a");
|
||||
|
||||
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");
|
||||
|
||||
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*)0xdeadbeef;
|
||||
std::u16string utext = ptr + +u" freed"sv;
|
||||
EXPECT_EQ(utext, u"0xDEADBEEF freed");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SimStr, EFill) {
|
||||
int k = 10;
|
||||
stringa test = "<" + e_fill_left("t="_ss + k, 10, '_');
|
||||
EXPECT_EQ(test, "<______t=10");
|
||||
test = e_fill_right("t="_ss + k, 10, '_') + ">";
|
||||
EXPECT_EQ(test, "t=10______>");
|
||||
}
|
||||
|
||||
TEST(SimStr, Subst) {
|
||||
int from = 1, total = 100;
|
||||
bool success = true;
|
||||
lstringu<100> u16t = e_subst(u"Test {} from {}, {}.", from, total, e_choice(success, u"success", u"fail"));
|
||||
EXPECT_EQ(u16t, u"Test 1 from 100, success.");
|
||||
}
|
||||
|
||||
TEST(SimStr, EIntFmt) {
|
||||
stringa test = "'0x"_ss + 10 / 0x16E08_fmt + "' " + 10 / 0x11'8EF5f_fmt;
|
||||
EXPECT_EQ(test, "'0x0000000A' _______A");
|
||||
test = 100 / 0x2a010_fmt;
|
||||
EXPECT_EQ(test, "0b01100100");
|
||||
|
||||
std::u16string textu = +u"val = 0X"sv + 0x12A / 123_f16;
|
||||
EXPECT_EQ(textu, u"val = 0X12a");
|
||||
textu = u"val = "_ss + 0x12A / 0_f16;
|
||||
EXPECT_EQ(textu, u"val = 0x0000012A");
|
||||
}
|
||||
|
||||
TEST(SimStr, EChangeCase) {
|
||||
stringa test = e_upper("teSt");
|
||||
EXPECT_EQ(test, "TEST");
|
||||
test = e_lower(test);
|
||||
EXPECT_EQ(test, "test");
|
||||
test = e_upper("ɐ ɑ ı ſ");
|
||||
EXPECT_EQ(test, "Ɐ Ɑ I S");
|
||||
test = "-" + e_lower("İ Ⱥ Ⱦ ẞ") + "-";
|
||||
EXPECT_EQ(test, "-i ⱥ ⱦ ß-");
|
||||
|
||||
|
||||
stringu utest = e_upper(u"teSt");
|
||||
EXPECT_EQ(utest, u"TEST");
|
||||
utest = e_lower(utest);
|
||||
EXPECT_EQ(utest, u"test");
|
||||
utest = e_upper(u"ı ſ ɐ ɑ");
|
||||
EXPECT_EQ(utest, u"I S Ɐ Ɑ");
|
||||
utest = u"-" + e_lower(u"İ Ⱥ Ⱦ ẞ") + u"-";
|
||||
EXPECT_EQ(utest, u"-i ⱥ ⱦ ß-");
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
void check_equal(stra a, stra b) {
|
||||
EXPECT_EQ(a, b);
|
||||
}
|
||||
inline constexpr cestring<char, 100> ce_sample = "sample " + e_subst("test = {}", e_hex(10)) + ", done";
|
||||
|
||||
TEST(SimStr, ConstEval) {
|
||||
constexpr cestring<char, 100> ce_empty;
|
||||
static_assert(ce_empty.length() == 0);
|
||||
static_assert(ce_empty == "");
|
||||
static_assert(ce_empty.find("aa") == -1);
|
||||
|
||||
constexpr cestring<char, 100> ce_lit = "test";
|
||||
static_assert(ce_lit.length() == 4);
|
||||
static_assert(ce_lit == "test");
|
||||
static_assert(ce_lit.find("st") == 2);
|
||||
static_assert(ce_lit(1, 2) == "es");
|
||||
|
||||
constexpr cestring<char, 100> ce_str = "tester"_ss;
|
||||
static_assert(ce_str.length() == 6);
|
||||
static_assert(ce_str == "tester");
|
||||
static_assert(ce_str.find("te") == 0);
|
||||
static_assert(ce_str.find("ter") == 3);
|
||||
static_assert(ce_str(1, -1) == "este");
|
||||
|
||||
constexpr cestring<char, 100> ce_repeat{10, "tu"};
|
||||
static_assert(ce_repeat.length() == 20);
|
||||
|
||||
constexpr cestring<char, 100> ce_expr = "test = "_ss + 10 + " times";
|
||||
static_assert(ce_expr == "test = 10 times");
|
||||
|
||||
constexpr cestring<char, 100> ce_subst = e_subst("test = {}", 10);
|
||||
static_assert(ce_subst == "test = 10");
|
||||
|
||||
constexpr cestring<char, 100> ce_hex = e_subst("test = {}", e_hex(10));
|
||||
static_assert(ce_hex == "test = 0x0000000A");
|
||||
|
||||
constexpr cestring<char, 100> ce_concat = e_concat("", "test = ", 10, " times");
|
||||
static_assert(ce_concat == "test = 10 times");
|
||||
static_assert(ce_concat(6, 3).to_int<int>().value == 10);
|
||||
|
||||
char arr[ce_concat.length()] = {};
|
||||
|
||||
static constexpr cestring<char, 40> ce_copy{ce_concat};
|
||||
static_assert(ce_copy == "test = 10 times");
|
||||
|
||||
check_equal(ce_copy, "test = 10 times");
|
||||
EXPECT_TRUE(ce_copy == "test = 10 times");
|
||||
|
||||
stringa test_copy = ce_sample(0, 10);
|
||||
EXPECT_EQ(test_copy, "sample tes");
|
||||
|
||||
constexpr cestring<char, 100> ce_repl = e_repl("test", "e", "--");
|
||||
static_assert(ce_repl == "t--st");
|
||||
}
|
||||
#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) {
|
||||
std::string str = "test";
|
||||
std::string test = +str + " = " + 10;
|
||||
EXPECT_EQ(test, "test = 10");
|
||||
|
||||
std::u16string textu = +u"val = 0X"sv + simstr::e_hex<simstr::HexFlags::No0x | simstr::HexFlags::Short | simstr::HexFlags::Lcase>(0x12Au);
|
||||
EXPECT_EQ(textu, u"val = 0X12a");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
* ver. 1.9.1
|
||||
* (c) Проект "SimStr", Александр Орефков orefkov@gmail.com
|
||||
* Тесты simstr
|
||||
* (c) Project "SimStr", Aleksandr Orefkov orefkov@gmail.com
|
||||
* Test of simstr
|
||||
*/
|
||||
|
||||
#include "../include/simstr/strexpr.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include <format>
|
||||
#include <list>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
namespace simstr::tests {
|
||||
/*!
|
||||
* @ru
|
||||
* @defgroup ConvertToStrExpr Конвертация типов в в строковые выражения
|
||||
* Различные способы конвертации типов в строковые выражения.
|
||||
* Если вы реализуете один (и только один) из способов преобразования вашего типа в строковое выражение,
|
||||
* то сможете использовать ваш тип напрямую в операциях конкатенации со строковыми выражениями и как
|
||||
* аргументы в функциях `e_concat` и `e_subst`.
|
||||
* @en
|
||||
* @defgroup ConvertToStrExpr Converting types to string expressions
|
||||
* Various ways to convert types to string expressions.
|
||||
* If you implement one (and only one) of the ways to convert your type to a string expression,
|
||||
* then you can use your type directly in concatenation operations with string expressions and how
|
||||
* arguments in the `e_concat` and `e_subst` functions.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @ingroup ConvertToStrExpr
|
||||
* @ru @page method1 Способ 1
|
||||
* Просто реализуйте в своём типе требования, чтобы он являлся строковым выражением.
|
||||
* @en @page method1 Method 1
|
||||
* Just implement the requirement in your type that it be a string expression.
|
||||
* @ru @par Пример:
|
||||
* @en @par Example:
|
||||
* @~
|
||||
* @snippet test_tostrexpr.cpp Method1
|
||||
*/
|
||||
|
||||
//! [Method1]
|
||||
struct add_exclamation {
|
||||
ssa text_;
|
||||
unsigned count_;
|
||||
|
||||
// symb_type
|
||||
using symb_type = char;
|
||||
// length
|
||||
size_t length() const noexcept {
|
||||
return text_.length() + count_;
|
||||
}
|
||||
// place
|
||||
char* place(char* ptr) const noexcept{
|
||||
ptr = text_.place(ptr);
|
||||
std::char_traits<char>::assign(ptr, count_, '!');
|
||||
return ptr + count_;
|
||||
}
|
||||
};
|
||||
|
||||
TEST(ToStrExpr, CheckExclamation) {
|
||||
std::string test = "Msg is <" + add_exclamation{"Happy Birthday", 5} + ">";
|
||||
EXPECT_EQ(test, "Msg is <Happy Birthday!!!!!>");
|
||||
|
||||
add_exclamation msg{"Happy Birthday", 3};
|
||||
test = e_concat("", "Msg is <", msg, ">");
|
||||
EXPECT_EQ(test, "Msg is <Happy Birthday!!!>");
|
||||
|
||||
const add_exclamation cmsg{"Happy Birthday", 0};
|
||||
test = e_subst("Msg is <{}>", cmsg);
|
||||
EXPECT_EQ(test, "Msg is <Happy Birthday>");
|
||||
}
|
||||
//! [Method1]
|
||||
|
||||
/*!
|
||||
* @ingroup ConvertToStrExpr
|
||||
* @ru @page method2 Способ 2
|
||||
* Создайте тип-обёртку, который является строковым выражением и может инициализироваться
|
||||
* вашим типом. После задайте их соответствие с помощью специализации шаблона `convert_to_strexpr`.
|
||||
* @en @page method2 Method 2
|
||||
* Create a wrapper type that is a string expression and can be initialized
|
||||
* your type. Then set their correspondence using the `convert_to_strexpr` template specialization.
|
||||
* @ru @par Пример:
|
||||
* @en @par Example:
|
||||
* @~
|
||||
* @snippet test_tostrexpr.cpp Method2
|
||||
*/
|
||||
|
||||
//! [Method2]
|
||||
|
||||
// Тип / Type
|
||||
struct car_info {
|
||||
std::string model;
|
||||
int year;
|
||||
};
|
||||
|
||||
// Обёртка для превращения его в строковое выражение
|
||||
// Wrapper to turn it into a string expression
|
||||
struct car_info_expr {
|
||||
const car_info& car_;
|
||||
expr_num<char, int> year;
|
||||
|
||||
car_info_expr(const car_info& car) : car_(car), year(car.year){}
|
||||
inline static constexpr ssa ModelTag = "Model: ";
|
||||
inline static constexpr ssa YearTag = ", Year: ";
|
||||
|
||||
using symb_type = char;
|
||||
|
||||
size_t length() const {
|
||||
return ModelTag.length() + car_.model.length() + YearTag.length() + year.length();
|
||||
}
|
||||
|
||||
char* place(char* ptr) const {
|
||||
ptr = ModelTag.place(ptr);
|
||||
std::char_traits<char>::copy(ptr, car_.model.data(), car_.model.length());
|
||||
ptr += car_.model.length();
|
||||
ptr = YearTag.place(ptr);
|
||||
return year.place(ptr);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace simstr::tests
|
||||
|
||||
|
||||
namespace simstr {
|
||||
|
||||
// Специализируем шаблон, задавая соответствие типа и его обёртки
|
||||
// Specialize the template by specifying a match between the type and its wrapper
|
||||
template<>
|
||||
struct convert_to_strexpr<char, tests::car_info> {
|
||||
// Указываем тип, который будет "обёрткой" для нашего типа
|
||||
// Specify the type that will be a "wrapper" for our type
|
||||
using type = tests::car_info_expr;
|
||||
};
|
||||
|
||||
} // namespace simstr
|
||||
|
||||
namespace simstr::tests {
|
||||
|
||||
TEST(ToStrExpr, CheckCarInfo) {
|
||||
car_info ci{"Ford", 2020};
|
||||
std::string test = "Car is <"_ss + ci + ">";
|
||||
EXPECT_EQ(test, "Car is <Model: Ford, Year: 2020>");
|
||||
|
||||
ci.year++;
|
||||
test = e_concat("", "Car is <", ci, ">");
|
||||
EXPECT_EQ(test, "Car is <Model: Ford, Year: 2021>");
|
||||
|
||||
ci.year++;
|
||||
test = e_subst("Car is <{}>", ci);
|
||||
EXPECT_EQ(test, "Car is <Model: Ford, Year: 2022>");
|
||||
}
|
||||
//! [Method2]
|
||||
|
||||
/*!
|
||||
* @ingroup ConvertToStrExpr
|
||||
* @ru @page method3 Способ 3
|
||||
* Специализируйте шаблон `convert_to_strexpr` для вашего типа и создайте в нём статическую
|
||||
* функцию `convert`, принимающую ваш объект и возвращающую строковое выражение, строковый объект
|
||||
* simstr или std::basic_string.
|
||||
* @en @page method3 Method 3
|
||||
* Specialize the `convert_to_strexpr` template for your type and create a static
|
||||
* `convert` function in it that takes your object and returns a string expression, a simstr string object,
|
||||
* or std::basic_string.
|
||||
* @ru @par Пример:
|
||||
* @en @par Example:
|
||||
* @~
|
||||
* @snippet test_tostrexpr.cpp Method3
|
||||
*/
|
||||
|
||||
//! [Method3]
|
||||
|
||||
struct animal {
|
||||
std::string name_;
|
||||
std::string sound_;
|
||||
};
|
||||
|
||||
} //namespace simstr::tests
|
||||
|
||||
namespace simstr {
|
||||
|
||||
// Специализируем шаблон, задавая соответствие типа и его обёртки
|
||||
// Specialize the template by specifying a match between the type and its wrapper
|
||||
template<>
|
||||
struct convert_to_strexpr<char, tests::animal> {
|
||||
// Создаём функцию `convert`, которая вернёт строковое представление объекта
|
||||
// Create a function `convert`, that will return a string representation of the object
|
||||
static auto convert(const tests::animal& a) {
|
||||
// Так делать нельзя - операция + складывает в выражение ссылки на временные объекты,
|
||||
// которые разрушаются после ";", и возвращать такой объект нельзя.
|
||||
// This can't be done - the operator+ adds references to temporary objects to the expression,
|
||||
// which are destroyed after ";", and such an object cannot be returned.
|
||||
//return "Animal: " + a.name_ + ", Sound: " + a.sound_;
|
||||
|
||||
// А вот такой можно - он не хранит ссылки на временные объекты
|
||||
// But this one is possible - it doesn't store references to temporary objects
|
||||
return e_concat("", "Animal: ", a.name_, ", Sound: ", a.sound_);
|
||||
// Также можно возвращать просто std::string, stringa, lstringa
|
||||
// You can also return just std::string, stringa, lstringa
|
||||
}
|
||||
};
|
||||
|
||||
} //namespace simstr
|
||||
|
||||
namespace simstr::tests {
|
||||
|
||||
TEST(ToStrExpr, CheckAnimal) {
|
||||
animal cat{"Cat", "Meow"};
|
||||
|
||||
std::string test = "<"_ss + cat + ">";
|
||||
EXPECT_EQ(test, "<Animal: Cat, Sound: Meow>");
|
||||
|
||||
const animal dog{"Dog", "Woof"};
|
||||
test = e_concat("", "<", dog, ">");
|
||||
EXPECT_EQ(test, "<Animal: Dog, Sound: Woof>");
|
||||
|
||||
test = e_subst("\\_{}_/", animal{"Snake", "Pssstt"});
|
||||
EXPECT_EQ(test, "\\_Animal: Snake, Sound: Pssstt_/");
|
||||
}
|
||||
//! [Method3]
|
||||
|
||||
/*!
|
||||
* @ingroup ConvertToStrExpr
|
||||
* @ru @page method4 Способ 4
|
||||
* Просто в своём типе сделайте функцию `template<typename K> auto to_strexpr()const`, которая возвращает
|
||||
* строковое выражение или строковый объект.
|
||||
* @en @page method4 Method 4
|
||||
* Simply create a `template<typename K> auto to_strexpr()const` function in your type that returns a
|
||||
* string expression or string object.
|
||||
* @ru @par Пример:
|
||||
* @en @par Example:
|
||||
* @~
|
||||
* @snippet test_tostrexpr.cpp Method4
|
||||
*/
|
||||
|
||||
//! [Method4]
|
||||
|
||||
struct test {
|
||||
int number;
|
||||
int from;
|
||||
// Сделаем две отдельные реализации: для char (попроще) и для остальных типов (там придётся возвращать не литералы, а simple_str, и требуется копия)
|
||||
// Let's make two separate implementations: for char (simpler) and for other types (there we'll have to return not literals, but simple_str, and a copy is required)
|
||||
template<typename K> requires (std::is_same_v<K, char>)
|
||||
auto to_strexpr() const {
|
||||
return e_concat("", "test ", number, " from ", from);
|
||||
}
|
||||
|
||||
template<typename K> requires (!std::is_same_v<K, char>)
|
||||
auto to_strexpr() const {
|
||||
// uni_string возвращает локальный объект, а ссылку на них нельзя возвращать из функции,
|
||||
// поэтому в e_concat надо форсировать сохранение по копии, а не по ссылке.
|
||||
// uni_string returns a local object, and references to them cannot be returned from a function,
|
||||
// so in e_concat we need to force saving by copy, not by reference.
|
||||
return e_concat(force_copy{empty_expr<K>{}}, force_copy{uni_string(K, "test ")}, number, force_copy{uni_string(K, " from ")}, from);
|
||||
}
|
||||
};
|
||||
|
||||
TEST(ToStrExpr, CheckTest) {
|
||||
test t1{1, 10};
|
||||
|
||||
std::string t = "Begin <"_ss + t1 + ">";
|
||||
EXPECT_EQ(t, "Begin <test 1 from 10>");
|
||||
|
||||
const test t2{8, 12};
|
||||
|
||||
t = e_concat("", "<", t2, ">");
|
||||
EXPECT_EQ(t, "<test 8 from 12>");
|
||||
|
||||
t = e_subst("<{}>", test{99, 100});
|
||||
EXPECT_EQ(t, "<test 99 from 100>");
|
||||
|
||||
// Проверим работу для не char
|
||||
// Let's check the work for non-char
|
||||
std::wstring wt = L"aaa "_ss + test{99, 100};
|
||||
EXPECT_EQ(wt, L"aaa test 99 from 100");
|
||||
|
||||
std::u16string ut = u"aaa "_ss + test{99, 100};
|
||||
EXPECT_EQ(ut, u"aaa test 99 from 100");
|
||||
}
|
||||
//! [Method4]
|
||||
|
||||
TEST(ToStrExpr, ConcatCustom) {
|
||||
std::string tt;
|
||||
std::string c = e_concat(eea + "," + " ", u8"bb", tt, 1, e_if(true, "--"), e_hex<HexFlags::Short>(16), 1.2, test{10, 30});
|
||||
EXPECT_EQ(c, "bb, , 1, --, 0x10, 1.2, test 10 from 30");
|
||||
|
||||
std::string_view text = "testes";
|
||||
int count = 10;
|
||||
std::string t = e_concat("", text, " = ", count, " times.");
|
||||
EXPECT_EQ(t, "testes = 10 times.");
|
||||
}
|
||||
|
||||
TEST(ToStrExpr, SubstCustom) {
|
||||
const auto ttt = "test"_ss;
|
||||
int ii = 3;
|
||||
const test tr{10, 10};
|
||||
std::string t = e_subst("Test {{--}} {}={}, {}", ttt, tr, ii);
|
||||
EXPECT_EQ(t, "Test {--} test=test 10 from 10, 3");
|
||||
t = e_subst("Test {2}={1}, {2}, {1}", "test", 2);
|
||||
EXPECT_EQ(t, "Test 2=test, 2, test");
|
||||
|
||||
std::u16string u16t = e_subst(u"Test {}={}, {}", u"test", 2, u"test"sv);
|
||||
EXPECT_EQ(u16t, u"Test test=2, test");
|
||||
}
|
||||
|
||||
} // namespace simstr::tests
|
||||
Loading…
Reference in New Issue