Skip to content

Commit

Permalink
Use std::mismatch where appropriate to save on performance budget of …
Browse files Browse the repository at this point in the history
…incrementing the iterator.

Pray to god std::ranges lands in more compilers sometime before I die.
Vastly improve usage for latest generation compilers for GCC, MSVC, and Clang.
  • Loading branch information
ThePhD committed Mar 30, 2020
1 parent d268ef8 commit bec0a81
Show file tree
Hide file tree
Showing 46 changed files with 1,555 additions and 3,492 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "vendor/benchmark"]
path = vendor/benchmark
url = https://github.com/google/benchmark
[submodule "vendor/span-lite"]
path = vendor/span-lite
url = https://github.com/martinmoene/span-lite.git
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ if (ITSY_BITSY_IS_TOP_LEVEL_PROJECT)
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(ITSY_BITSY_CLANG_CL ON)
else()
set(ITSY_BITSY_CLANG_CL OFF)
endif()
endif()


Expand Down
9 changes: 0 additions & 9 deletions benchmarks/include/span

This file was deleted.

172 changes: 86 additions & 86 deletions benchmarks/results/fresh/sources.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
{
"name": "bit",
"scale": {
"type": "relative",
"to": "base"
},
"categories": [
{
"name": "find",
"prefix": "find_",
"suffix": ""
},
{
"name": "count",
"prefix": "count_",
"suffix": ""
},
{
"name": "fill",
"prefix": "fill_",
"suffix": ""
},
{
"name": "copy",
"prefix": "copy_",
"suffix": ""
},
{
"name": "copy_n",
"prefix": "sized_copy_",
"suffix": ""
},
{
"name": "swap_ranges",
"prefix": "swap_ranges_",
"suffix": ""
},
{
"name": "rotate",
"prefix": "rotate_",
"suffix": ""
},
{
"name": "equal",
"prefix": "equal_",
"suffix": ""
}
],
"data_labels": [
{
"ascending": true,
"name": "real_time",
"format": "clock"
},
{
"ascending": true,
"name": "cpu_time",
"format": "clock"
}
],
"remove_suffixes": [
",",
"_"
],
"remove_prefixes": [
",",
"_"
],
"sources": [
{
"prefix": "libc++",
"file": "libc++.itsy.bitsy.benchmarks.json",
"required": false
},
{
"prefix": "libstdc++",
"file": "libstdc++.itsy.bitsy.benchmarks.json",
"required": false
},
{
"prefix": "vc++",
"file": "vc++.itsy.bitsy.benchmarks.json",
"required": false
}
]
}
{
"name": "bit",
"scale": {
"type": "relative",
"to": "base"
},
"categories": [
{
"name": "find",
"prefix": "find_",
"suffix": ""
},
{
"name": "count",
"prefix": "count_",
"suffix": ""
},
{
"name": "fill",
"prefix": "fill_",
"suffix": ""
},
{
"name": "copy",
"prefix": "copy_",
"suffix": ""
},
{
"name": "copy_n",
"prefix": "sized_copy_",
"suffix": ""
},
{
"name": "swap_ranges",
"prefix": "swap_ranges_",
"suffix": ""
},
{
"name": "rotate",
"prefix": "rotate_",
"suffix": ""
},
{
"name": "equal",
"prefix": "equal_",
"suffix": ""
}
],
"data_labels": [
{
"ascending": true,
"name": "real_time",
"format": "clock"
},
{
"ascending": true,
"name": "cpu_time",
"format": "clock"
}
],
"remove_suffixes": [
",",
"_"
],
"remove_prefixes": [
",",
"_"
],
"sources": [
{
"prefix": "libc++",
"file": "libc++.itsy.bitsy.benchmarks.json",
"required": false
},
{
"prefix": "libstdc++",
"file": "libstdc++.itsy.bitsy.benchmarks.json",
"required": false
},
{
"prefix": "vc++",
"file": "vc++.itsy.bitsy.benchmarks.json",
"required": false
}
]
}
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ foreach (example_source_name ${itsy.bitsy.example.sources})
endif()
target_compile_definitions(${example_target} PRIVATE __STDC_WANT_LIB_EXT1__=1)
target_link_libraries(${example_target}
PRIVATE

PRIVATE
itsy::bitsy
)
target_include_directories(${example_target} PRIVATE
"include"
"../vendor/span-lite/include/"
)
if (ITSY_BITSY_TESTS)
add_test(NAME ${example_target} COMMAND ${example_target})
Expand Down
Loading

0 comments on commit bec0a81

Please sign in to comment.