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 5197656
Show file tree
Hide file tree
Showing 17 changed files with 940 additions and 354 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
10 changes: 10 additions & 0 deletions .github/mock-font-locator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

mock_font_locator:
# Ubuntu 20.04
- { family: "monospace", slant: normal, weight: normal, path: "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" }
- { family: "emoji", slant: normal, weight: normal, path: "/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf" }

# That would be it for macOS
# - { family: "monospace", slant: normal, weight: normal, path: "/Users/trapni/Library/Fonts/JetBrains Mono Regular Nerd Font Complete Mono.ttf" }
# - { family: "emoji", slant: normal, weight: normal, path: "/System/Library/Fonts/Apple Color Emoji.ttc" }

96 changes: 42 additions & 54 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,30 @@ 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"
- name: "install dependencies"
run: ./scripts/xvfb-deps.sh
- name: "Install contour"
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
wget https://github.com/contour-terminal/contour/releases/download/v0.4.3.6442/contour-0.4.3.6442-ubuntu22.04-amd64.deb
sudo dpkg -i contour-0.4.3.6442-ubuntu22.04-amd64.deb
- name: "create and patch contour.yml config file"
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
set -ex
mkdir -p ~/.config/contour/
contour generate config to ~/.config/contour/contour.yml
sed -i -e 's/locator: native/locator: mock/' ~/.config/contour/contour.yml
sed -i -e 's/strict_spacing: true/strict_spacing: false/' ~/.config/contour/contour.yml
cat .github/mock-font-locator.yml >> ~/.config/contour/contour.yml
cat ~/.config/contour/contour.yml
- name: "Install other terminals and dependencies"
run: sudo apt install -y kitty xterm xvfb
- name: "run benchmarks"
run: ./scripts/Xvfb-bench-run.sh
- name: "ls"
run: ls -la
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
Loading

0 comments on commit 5197656

Please sign in to comment.