Skip to content

Commit

Permalink
Update of termbench with scripts to create plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Mar 16, 2024
1 parent 7f86c88 commit 01ba522
Show file tree
Hide file tree
Showing 15 changed files with 799 additions and 356 deletions.
81 changes: 81 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
BasedOnStyle: Microsoft
AccessModifierOffset: '-2'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'true'
AllowAllConstructorInitializersOnNextLine: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'true'
ColumnLimit: '110'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: Inner
PenaltyBreakAssignment: '0'
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'false'
SpaceBeforeInheritanceColon: 'false'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '4'
UseTab: Never
IncludeCategories:
- Regex: '^<(tb)/'
Priority: 0
- Regex: '^<(libtermbench)/'
Priority: 1
- Regex: '^<sys/'
Priority: 80
- Regex: '^<[[:alnum:]_]+>'
Priority: 81
- Regex: '<[[:alnum:]_]+\.h>'
Priority: 82
- Regex: '.*'
Priority: 99
83 changes: 27 additions & 56 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:


check_clang_format:
name: "Check C++ style"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-format-17
- name: "Clang-format libtermbench"
run: find ./libtermbench -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --Werror --dry-run
- name: "Clang-format tb1"
run: find ./tb -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --Werror --dry-run
- name: "Check includes"
run: ./scripts/check-includes.sh

ubuntu_linux:
name: "Ubuntu Linux 22.04"
runs-on: ubuntu-22.04
Expand All @@ -43,62 +63,13 @@ jobs:
set -ex
sudo apt -q update
sudo ./scripts/install-deps.sh
- name: "Install GCC 13"
run: sudo apt install g++-13
- name: "cmake"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -D CMAKE_CXX_COMPILER="g++-13"
- name: "build"
run: cmake --build build/ -- -j3

osx:
name: "OS/X"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{github.workflow}}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: set variables
id: set_vars
run: ./scripts/ci-set-vars.sh
env:
REPOSITORY: ${{ github.event.repository.name }}
- name: "Install dependencies"
run: |
set -ex
#brew update
./scripts/install-deps.sh
- name: "Create build directory"
run: mkdir build
- name: "Generate build files"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo"
- name: "Build"
run: cmake --build build/

windows:
name: "Windows"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: setup environment
shell: powershell
id: set_vars
run: .\scripts\ci-set-vars.ps1
env:
REPOSITORY: ${{ github.event.repository.name }}
- name: "vcpkg: Install dependencies"
uses: lukka/[email protected]
id: runvcpkg
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgGitCommitId: 3e93bb69a1cadeb36fe9eca3b6f3912d84f618d5
- name: "create build directory"
shell: powershell
run: |
If (!(Test-Path build))
{
New-Item -ItemType Directory -Force -Path build
}
- name: "Generate build files"
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows -B build .
- name: "Build"
run: cmake --build build/ --config Release
- name: "Install other terminals"
run: sudo apt install alacritty kitty xterm
- name: "run benchmarks"
run: ./scripts/Xvfb-bench-run.sh
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ if(DEFINED MSVC)
add_definitions(-D_USE_MATH_DEFINES)
endif()

if(NOT TARGET fmt)
find_package(fmt REQUIRED)
endif()

add_subdirectory(libtermbench)
add_subdirectory(tb)
72 changes: 72 additions & 0 deletions alacritty_results
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
All 65 tests finished.
---------------------

many_lines: 0.0390 seconds, 82.051 MB/s (normalized: 48.623 KB/s)
long_lines: 0.0310 seconds, 103.226 MB/s (normalized: 61.171 KB/s)
sgr_fg_lines: 0.0182 seconds, 175.824 MB/s (normalized: 104.192 KB/s)
sgr_fg_bg_lines: 0.0189 seconds, 169.312 MB/s (normalized: 100.333 KB/s)
binary: 0.0387 seconds, 82.687 MB/s (normalized: 49.000 KB/s)
0 chars per line: 4.0861 seconds, 6.583 MB/s (normalized: 3.901 KB/s)
1 chars per line: 3.0264 seconds, 9.804 MB/s (normalized: 5.810 KB/s)
2 chars per line: 2.0195 seconds, 14.579 MB/s (normalized: 8.639 KB/s)
3 chars per line: 1.0657 seconds, 19.312 MB/s (normalized: 11.444 KB/s)
4 chars per line: 1.0338 seconds, 23.916 MB/s (normalized: 14.173 KB/s)
5 chars per line: 1.0134 seconds, 28.219 MB/s (normalized: 16.722 KB/s)
6 chars per line: 0.0963 seconds, 33.229 MB/s (normalized: 19.692 KB/s)
7 chars per line: 0.0852 seconds, 37.559 MB/s (normalized: 22.257 KB/s)
8 chars per line: 0.0768 seconds, 41.667 MB/s (normalized: 24.691 KB/s)
9 chars per line: 0.0696 seconds, 45.977 MB/s (normalized: 27.246 KB/s)
10 chars per line: 0.0653 seconds, 49.005 MB/s (normalized: 29.040 KB/s)
11 chars per line: 0.0596 seconds, 53.691 MB/s (normalized: 31.817 KB/s)
12 chars per line: 0.0549 seconds, 58.288 MB/s (normalized: 34.541 KB/s)
13 chars per line: 0.0512 seconds, 62.500 MB/s (normalized: 37.037 KB/s)
14 chars per line: 0.0494 seconds, 64.777 MB/s (normalized: 38.387 KB/s)
15 chars per line: 0.0472 seconds, 67.797 MB/s (normalized: 40.176 KB/s)
16 chars per line: 0.0455 seconds, 70.330 MB/s (normalized: 41.677 KB/s)
17 chars per line: 0.0450 seconds, 71.111 MB/s (normalized: 42.140 KB/s)
18 chars per line: 0.0432 seconds, 74.074 MB/s (normalized: 43.896 KB/s)
19 chars per line: 0.0422 seconds, 75.829 MB/s (normalized: 44.936 KB/s)
0 chars with sgr per line: 0.0284 seconds, 112.676 MB/s (normalized: 66.771 KB/s)
1 chars with sgr per line: 0.0296 seconds, 108.108 MB/s (normalized: 64.064 KB/s)
2 chars with sgr per line: 0.0289 seconds, 110.727 MB/s (normalized: 65.616 KB/s)
3 chars with sgr per line: 0.0286 seconds, 111.888 MB/s (normalized: 66.304 KB/s)
4 chars with sgr per line: 0.0275 seconds, 116.364 MB/s (normalized: 68.956 KB/s)
5 chars with sgr per line: 0.0274 seconds, 116.788 MB/s (normalized: 69.208 KB/s)
6 chars with sgr per line: 0.0274 seconds, 116.788 MB/s (normalized: 69.208 KB/s)
7 chars with sgr per line: 0.0279 seconds, 114.695 MB/s (normalized: 67.968 KB/s)
8 chars with sgr per line: 0.0285 seconds, 112.281 MB/s (normalized: 66.537 KB/s)
9 chars with sgr per line: 0.0276 seconds, 115.942 MB/s (normalized: 68.706 KB/s)
10 chars with sgr per line: 0.0290 seconds, 110.345 MB/s (normalized: 65.390 KB/s)
11 chars with sgr per line: 0.0265 seconds, 120.755 MB/s (normalized: 71.558 KB/s)
12 chars with sgr per line: 0.0272 seconds, 117.647 MB/s (normalized: 69.717 KB/s)
13 chars with sgr per line: 0.0268 seconds, 119.403 MB/s (normalized: 70.757 KB/s)
14 chars with sgr per line: 0.0277 seconds, 115.523 MB/s (normalized: 68.458 KB/s)
15 chars with sgr per line: 0.0290 seconds, 110.345 MB/s (normalized: 65.390 KB/s)
16 chars with sgr per line: 0.0276 seconds, 115.942 MB/s (normalized: 68.706 KB/s)
17 chars with sgr per line: 0.0269 seconds, 118.959 MB/s (normalized: 70.494 KB/s)
18 chars with sgr per line: 0.0244 seconds, 131.148 MB/s (normalized: 77.717 KB/s)
19 chars with sgr per line: 0.0261 seconds, 122.605 MB/s (normalized: 72.655 KB/s)
0 chars with sgr and bg per line: 0.0246 seconds, 130.081 MB/s (normalized: 77.085 KB/s)
1 chars with sgr and bg per line: 0.0252 seconds, 126.984 MB/s (normalized: 75.250 KB/s)
2 chars with sgr and bg per line: 0.0260 seconds, 123.077 MB/s (normalized: 72.934 KB/s)
3 chars with sgr and bg per line: 0.0255 seconds, 125.490 MB/s (normalized: 74.365 KB/s)
4 chars with sgr and bg per line: 0.0214 seconds, 149.533 MB/s (normalized: 88.612 KB/s)
5 chars with sgr and bg per line: 0.0228 seconds, 140.351 MB/s (normalized: 83.171 KB/s)
6 chars with sgr and bg per line: 0.0272 seconds, 117.647 MB/s (normalized: 69.717 KB/s)
7 chars with sgr and bg per line: 0.0254 seconds, 125.984 MB/s (normalized: 74.657 KB/s)
8 chars with sgr and bg per line: 0.0242 seconds, 132.231 MB/s (normalized: 78.359 KB/s)
9 chars with sgr and bg per line: 0.0223 seconds, 143.498 MB/s (normalized: 85.036 KB/s)
10 chars with sgr and bg per line: 0.0221 seconds, 144.796 MB/s (normalized: 85.805 KB/s)
11 chars with sgr and bg per line: 0.0224 seconds, 142.857 MB/s (normalized: 84.656 KB/s)
12 chars with sgr and bg per line: 0.0267 seconds, 119.850 MB/s (normalized: 71.022 KB/s)
13 chars with sgr and bg per line: 0.0249 seconds, 128.514 MB/s (normalized: 76.156 KB/s)
14 chars with sgr and bg per line: 0.0232 seconds, 137.931 MB/s (normalized: 81.737 KB/s)
15 chars with sgr and bg per line: 0.0218 seconds, 146.789 MB/s (normalized: 86.986 KB/s)
16 chars with sgr and bg per line: 0.0243 seconds, 131.687 MB/s (normalized: 78.037 KB/s)
17 chars with sgr and bg per line: 0.0238 seconds, 134.454 MB/s (normalized: 79.676 KB/s)
18 chars with sgr and bg per line: 0.0236 seconds, 135.593 MB/s (normalized: 80.352 KB/s)
19 chars with sgr and bg per line: 0.0225 seconds, 142.222 MB/s (normalized: 84.280 KB/s)
all tests: 34.0550 seconds, 60.203 MB/s (normalized: 35.676 KB/s)

screen size: 72x24
data size: 32.000 MB
72 changes: 72 additions & 0 deletions kitty_results
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
All 65 tests finished.
---------------------

many_lines: 0.0547 seconds, 58.501 MB/s (normalized: 42.187 KB/s)
long_lines: 0.0490 seconds, 65.306 MB/s (normalized: 47.094 KB/s)
sgr_fg_lines: 0.0492 seconds, 65.041 MB/s (normalized: 46.903 KB/s)
sgr_fg_bg_lines: 0.0489 seconds, 65.440 MB/s (normalized: 47.190 KB/s)
binary: 0.0552 seconds, 57.971 MB/s (normalized: 41.804 KB/s)
0 chars per line: 5.0859 seconds, 5.462 MB/s (normalized: 3.939 KB/s)
1 chars per line: 3.0544 seconds, 9.029 MB/s (normalized: 6.511 KB/s)
2 chars per line: 2.0494 seconds, 12.831 MB/s (normalized: 9.253 KB/s)
3 chars per line: 1.0836 seconds, 17.429 MB/s (normalized: 12.569 KB/s)
4 chars per line: 1.0449 seconds, 22.084 MB/s (normalized: 15.926 KB/s)
5 chars per line: 1.0248 seconds, 25.641 MB/s (normalized: 18.490 KB/s)
6 chars per line: 1.0063 seconds, 30.103 MB/s (normalized: 21.708 KB/s)
7 chars per line: 0.0960 seconds, 33.333 MB/s (normalized: 24.038 KB/s)
8 chars per line: 0.0837 seconds, 38.232 MB/s (normalized: 27.570 KB/s)
9 chars per line: 0.0801 seconds, 39.950 MB/s (normalized: 28.809 KB/s)
10 chars per line: 0.0719 seconds, 44.506 MB/s (normalized: 32.095 KB/s)
11 chars per line: 0.0665 seconds, 48.120 MB/s (normalized: 34.701 KB/s)
12 chars per line: 0.0638 seconds, 50.157 MB/s (normalized: 36.169 KB/s)
13 chars per line: 0.0618 seconds, 51.780 MB/s (normalized: 37.340 KB/s)
14 chars per line: 0.0601 seconds, 53.245 MB/s (normalized: 38.396 KB/s)
15 chars per line: 0.0574 seconds, 55.749 MB/s (normalized: 40.202 KB/s)
16 chars per line: 0.0565 seconds, 56.637 MB/s (normalized: 40.843 KB/s)
17 chars per line: 0.0565 seconds, 56.637 MB/s (normalized: 40.843 KB/s)
18 chars per line: 0.0581 seconds, 55.077 MB/s (normalized: 39.718 KB/s)
19 chars per line: 0.0565 seconds, 56.637 MB/s (normalized: 40.843 KB/s)
0 chars with sgr per line: 0.0543 seconds, 58.932 MB/s (normalized: 42.497 KB/s)
1 chars with sgr per line: 0.0542 seconds, 59.041 MB/s (normalized: 42.576 KB/s)
2 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
3 chars with sgr per line: 0.0535 seconds, 59.813 MB/s (normalized: 43.133 KB/s)
4 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
5 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
6 chars with sgr per line: 0.0540 seconds, 59.259 MB/s (normalized: 42.733 KB/s)
7 chars with sgr per line: 0.0532 seconds, 60.150 MB/s (normalized: 43.376 KB/s)
8 chars with sgr per line: 0.0540 seconds, 59.259 MB/s (normalized: 42.733 KB/s)
9 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
10 chars with sgr per line: 0.0536 seconds, 59.701 MB/s (normalized: 43.052 KB/s)
11 chars with sgr per line: 0.0539 seconds, 59.369 MB/s (normalized: 42.813 KB/s)
12 chars with sgr per line: 0.0533 seconds, 60.038 MB/s (normalized: 43.295 KB/s)
13 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
14 chars with sgr per line: 0.0531 seconds, 60.264 MB/s (normalized: 43.458 KB/s)
15 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
16 chars with sgr per line: 0.0539 seconds, 59.369 MB/s (normalized: 42.813 KB/s)
17 chars with sgr per line: 0.0532 seconds, 60.150 MB/s (normalized: 43.376 KB/s)
18 chars with sgr per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
19 chars with sgr per line: 0.0530 seconds, 60.377 MB/s (normalized: 43.540 KB/s)
0 chars with sgr and bg per line: 0.0540 seconds, 59.259 MB/s (normalized: 42.733 KB/s)
1 chars with sgr and bg per line: 0.0531 seconds, 60.264 MB/s (normalized: 43.458 KB/s)
2 chars with sgr and bg per line: 0.0537 seconds, 59.590 MB/s (normalized: 42.972 KB/s)
3 chars with sgr and bg per line: 0.0529 seconds, 60.491 MB/s (normalized: 43.622 KB/s)
4 chars with sgr and bg per line: 0.0541 seconds, 59.150 MB/s (normalized: 42.654 KB/s)
5 chars with sgr and bg per line: 0.0530 seconds, 60.377 MB/s (normalized: 43.540 KB/s)
6 chars with sgr and bg per line: 0.0537 seconds, 59.590 MB/s (normalized: 42.972 KB/s)
7 chars with sgr and bg per line: 0.0528 seconds, 60.606 MB/s (normalized: 43.705 KB/s)
8 chars with sgr and bg per line: 0.0531 seconds, 60.264 MB/s (normalized: 43.458 KB/s)
9 chars with sgr and bg per line: 0.0535 seconds, 59.813 MB/s (normalized: 43.133 KB/s)
10 chars with sgr and bg per line: 0.0526 seconds, 60.837 MB/s (normalized: 43.871 KB/s)
11 chars with sgr and bg per line: 0.0539 seconds, 59.369 MB/s (normalized: 42.813 KB/s)
12 chars with sgr and bg per line: 0.0528 seconds, 60.606 MB/s (normalized: 43.705 KB/s)
13 chars with sgr and bg per line: 0.0527 seconds, 60.721 MB/s (normalized: 43.788 KB/s)
14 chars with sgr and bg per line: 0.0539 seconds, 59.369 MB/s (normalized: 42.813 KB/s)
15 chars with sgr and bg per line: 0.0526 seconds, 60.837 MB/s (normalized: 43.871 KB/s)
16 chars with sgr and bg per line: 0.0538 seconds, 59.480 MB/s (normalized: 42.892 KB/s)
17 chars with sgr and bg per line: 0.0528 seconds, 60.606 MB/s (normalized: 43.705 KB/s)
18 chars with sgr and bg per line: 0.0535 seconds, 59.813 MB/s (normalized: 43.133 KB/s)
19 chars with sgr and bg per line: 0.0528 seconds, 60.606 MB/s (normalized: 43.705 KB/s)
all tests: 50.0164 seconds, 41.464 MB/s (normalized: 29.901 KB/s)

screen size: 71x20
data size: 32.000 MB
1 change: 0 additions & 1 deletion libtermbench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set_target_properties(termbench PROPERTIES
VERSION "${PROJECT_VERSION}"
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
)
target_link_libraries(termbench PUBLIC fmt::fmt-header-only)

target_include_directories(termbench PUBLIC $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
Expand Down
Loading

0 comments on commit 01ba522

Please sign in to comment.