Skip to content

Commit 5cbe7a0

Browse files
Merge pull request #230 from LibRapid/test
Include benchmarks in documentation
2 parents 9b889aa + 28174fe commit 5cbe7a0

File tree

7 files changed

+279
-65
lines changed

7 files changed

+279
-65
lines changed

.github/workflows/continuous-integration.yaml

+230-30
Original file line numberDiff line numberDiff line change
@@ -291,26 +291,8 @@ jobs:
291291
cd buildRelease
292292
ctest -C Release --output-on-failure
293293
294-
quodona:
295-
name: Run Qodana
296-
needs: compile
297-
runs-on: ubuntu-latest
298-
continue-on-error: true
299-
300-
steps:
301-
- name: Checkout LibRapid
302-
uses: actions/checkout@v3
303-
with:
304-
submodules: recursive
305-
306-
# - name: Qodana Scan
307-
# uses: JetBrains/qodana-action@main
308-
# env:
309-
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
310-
311294
build-docs:
312295
name: Build Documentation Locally
313-
needs: [ compile ]
314296
runs-on: ubuntu-latest
315297

316298
steps:
@@ -399,25 +381,243 @@ jobs:
399381
path: docs/build/**
400382

401383
run-benchmarks:
402-
name: Run Benchmarks
403-
needs: [ compile ]
384+
name: Run Benchmarks on ${{ matrix.os }} with ${{ matrix.cxx }}
385+
needs: [ compile, build-docs ]
386+
runs-on: ${{ matrix.os }}
387+
388+
strategy:
389+
fail-fast: false
390+
matrix:
391+
include:
392+
- os: ubuntu-latest
393+
cc: ../../llvm/bin/clang
394+
cxx: ../../llvm/bin/clang++
395+
clangVer: "15.0"
396+
smallArrays: ON
397+
pretty: "LibRapid_Ubuntu_Clang_OptimiseSmallArrays"
398+
399+
- os: ubuntu-latest
400+
cc: ../../llvm/bin/clang
401+
cxx: ../../llvm/bin/clang++
402+
clangVer: "15.0"
403+
smallArrays: OFF
404+
pretty: "LibRapid_Ubuntu_Clang"
405+
406+
- os: ubuntu-latest
407+
cc: gcc-11
408+
cxx: g++-11
409+
smallArrays: ON
410+
pretty: "LibRapid_Ubuntu_GCC_OptimiseSmallArrays"
411+
412+
- os: ubuntu-latest
413+
cc: gcc-11
414+
cxx: g++-11
415+
smallArrays: OFF
416+
pretty: "LibRapid_Ubuntu_GCC"
417+
418+
- os: macos-latest
419+
cc: ../../llvm/bin/clang
420+
cxx: ../../llvm/bin/clang++
421+
clangVer: "15.0"
422+
smallArrays: ON
423+
pretty: "LibRapid_MacOS_Clang_OptimiseSmallArrays"
424+
425+
- os: macos-latest
426+
cc: ../../llvm/bin/clang
427+
cxx: ../../llvm/bin/clang++
428+
clangVer: "15.0"
429+
smallArrays: OFF
430+
pretty: "LibRapid_MacOS_Clang"
431+
432+
- os: macos-latest
433+
cc: gcc-11
434+
cxx: g++-11
435+
smallArrays: ON
436+
pretty: "LibRapid_MacOS_GCC_OptimiseSmallArrays"
437+
438+
- os: macos-latest
439+
cc: gcc-11
440+
cxx: g++-11
441+
smallArrays: OFF
442+
pretty: "LibRapid_MacOS_GCC"
443+
444+
- os: windows-latest
445+
cc: ../../llvm/clang
446+
cxx: ../../llvm/clang++
447+
clangVer: "15.0"
448+
smallArrays: ON
449+
pretty: "LibRapid_Windows_Clang_OptimiseSmallArrays"
450+
451+
- os: windows-latest
452+
cc: ../../llvm/clang
453+
cxx: ../../llvm/clang++
454+
clangVer: "15.0"
455+
smallArrays: OFF
456+
pretty: "LibRapid_Windows_Clang"
457+
458+
- os: windows-latest
459+
cc: msvc
460+
cxx: msvc
461+
smallArrays: ON
462+
pretty: "LibRapid_Windows_MSVC_OptimiseSmallArrays"
463+
464+
- os: windows-latest
465+
cc: msvc
466+
cxx: msvc
467+
smallArrays: OFF
468+
pretty: "LibRapid_Windows_MSVC"
469+
470+
steps:
471+
- name: Install Clang
472+
if: matrix.clangVer != null
473+
uses: KyleMayes/install-llvm-action@v1
474+
with:
475+
version: ${{ matrix.clangVer }}
476+
directory: "./llvm"
477+
env: on
478+
479+
- name: Install XCode
480+
if: matrix.os == 'macos-latest'
481+
uses: maxim-lobanov/[email protected]
482+
483+
- name: Clone Benchmark Repository
484+
run: |
485+
git clone https://github.com/LibRapid/BenchmarksCPP.git --recursive
486+
487+
- name: Update LibRapid Submodule
488+
run: |
489+
cd BenchmarksCPP
490+
cd vendor/librapid
491+
git checkout ${{ github.head_ref || github.ref_name }} -- || git checkout ${{ github.ref }}
492+
git pull
493+
git submodule update --init --recursive
494+
495+
- name: Install Python
496+
uses: actions/setup-python@v2
497+
with:
498+
python-version: "3.9"
499+
500+
- name: Install Requirements
501+
run: |
502+
pip install --upgrade pip
503+
cd BenchmarksCPP
504+
pip install -r requirements.txt
505+
506+
- name: Compile Benchmarks
507+
run: |
508+
cd BenchmarksCPP
509+
mkdir build
510+
cd build
511+
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSING_GITHUB_ACTIONS=ON -DLIBRAPID_OPTIMISE_SMALL_ARRAYS=${{ matrix.smallArrays }}
512+
cmake --build . --config Release
513+
env:
514+
CC: ${{ matrix.cc }}
515+
CXX: ${{ matrix.cxx }}
516+
517+
# On Windows, the generated executable is in "build/Release"
518+
- name: Run Benchmarks
519+
if: matrix.os == 'windows-latest'
520+
run: |
521+
cd BenchmarksCPP/build/Release
522+
./BenchmarksCPP.exe
523+
524+
# On Unix systems, the generated executable is in "build"
525+
- name: Run Benchmarks
526+
if: matrix.os != 'windows-latest'
527+
run: |
528+
cd BenchmarksCPP/build
529+
./BenchmarksCPP
530+
531+
- name: Generate Benchmark Graphs
532+
if: matrix.os == 'windows-latest'
533+
run: |
534+
cd BenchmarksCPP/scripts
535+
python dataProcessor.py --directory ../build/Release --output ../../${{ matrix.pretty }} --relative Eigen --verbose
536+
537+
- name: Generate Benchmark Graphs
538+
if: matrix.os != 'windows-latest'
539+
run: |
540+
cd BenchmarksCPP/scripts
541+
python dataProcessor.py --directory ../build --output ../../${{ matrix.pretty }} --relative Eigen --verbose
542+
543+
- name: Upload Intermediate Benchmark Results
544+
uses: actions/upload-artifact@v3
545+
with:
546+
name: ${{ matrix.pretty }}
547+
path: ${{ matrix.pretty }}
548+
549+
upload-benchmarks:
550+
name: Upload Benchmark Results
551+
needs: run-benchmarks
404552
runs-on: ubuntu-latest
405553
steps:
406-
- name: Create a Test File
554+
- name: Checkout LibRapid
555+
uses: actions/checkout@v3
556+
with:
557+
submodules: recursive
558+
559+
560+
- name: Install Python
561+
uses: actions/setup-python@v2
562+
with:
563+
python-version: "3.9"
564+
565+
- name: Download Intermediate Benchmark Results
566+
uses: actions/download-artifact@v2
567+
with:
568+
path: IntermediateBenchmarkResults
569+
570+
- name: Tree IntermediateBenchmarkResults
407571
run: |
408-
mkdir BENCH_RESULTS
409-
touch BENCH_RESULTS/hello.txt
410-
echo "Hello, World!" > BENCH_RESULTS/hello.txt
572+
cd IntermediateBenchmarkResults
573+
tree
574+
575+
- name: Upload Intermediate Benchmark Results
576+
uses: actions/upload-artifact@v3
577+
with:
578+
name: IntermediateBenchmarkResults
579+
path: IntermediateBenchmarkResults
411580

412-
- name: Upload Benchmark Results
581+
- name: Auto-Generate Benchmark Documentation
582+
run: |
583+
git clone https://github.com/LibRapid/BenchmarksCPP.git
584+
cd BenchmarksCPP
585+
pip install --upgrade pip
586+
pip install -r requirements.txt
587+
cd scripts
588+
python docGenerator.py --input ../../IntermediateBenchmarkResults --output ../../BenchmarkDocumentation
589+
590+
- name: Tree BenchmarkDocumentation
591+
run: |
592+
cd BenchmarkDocumentation
593+
tree
594+
595+
- name: Upload Benchmark Documentation
413596
uses: actions/upload-artifact@v3
414597
with:
415-
name: benchmark-results-for-${{ github.sha }}
416-
path: BENCH_RESULTS/
598+
name: LibRapid_Benchmark_SHA_${{ github.sha }}
599+
path: BenchmarkDocumentation
600+
601+
quodona:
602+
name: Run Qodana
603+
needs: [ compile, upload-benchmarks ]
604+
runs-on: ubuntu-latest
605+
continue-on-error: true
606+
607+
steps:
608+
- name: Checkout LibRapid
609+
uses: actions/checkout@v3
610+
with:
611+
submodules: recursive
612+
613+
# - name: Qodana Scan
614+
# uses: JetBrains/qodana-action@main
615+
# env:
616+
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
417617

418618
code-coverage:
419619
name: Code Coverage
420-
needs: [ compile ]
620+
needs: [ compile, upload-benchmarks ]
421621
runs-on: ubuntu-latest
422622
continue-on-error: true
423623

@@ -460,7 +660,7 @@ jobs:
460660

461661
trigger-docs:
462662
name: Trigger Documentation Build
463-
needs: [ run-benchmarks, quodona, build-docs ]
663+
needs: [ compile, build-docs, quodona, code-coverage ]
464664
runs-on: ubuntu-latest
465665
if: github.event_name != 'pull_request'
466666
steps:
@@ -478,7 +678,7 @@ jobs:
478678

479679
success:
480680
name: Success
481-
needs: [ trigger-docs ]
681+
needs: trigger-docs
482682
runs-on: ubuntu-latest
483683
steps:
484684
- name: Print Success

.readthedocs.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ python:
1313
version: "3.8"
1414
# install:
1515
# - requirements: docs/requirements.txt
16-
system_packages: true
1716

1817
# Build documentation in the docs/ directory with Sphinx
1918
sphinx:

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
---
2121

22-
(As a student, it's difficult to spend a lot of time on this project. If you like what I'm doing, a
23-
small [donation](https://github.com/sponsors/Pencilcaseman) would mean a lot to me!)
24-
2522
![Simple Demo](https://raw.githubusercontent.com/LibRapid/librapid_extras/master/images/librapidSimpleDemo.png)
2623

2724
# What is LibRapid?

docs/source/conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@
9999
if os.environ.get("GITHUB_TOKEN") is not None:
100100
extensions.append("rtds_action")
101101
rtds_action_github_repo = "LibRapid/librapid"
102-
rtds_action_path = "BENCH_RESULTS"
103-
rtds_action_artifact_prefix = "benchmark-results-for-"
102+
rtds_action_path = "BenchmarkResults"
103+
rtds_action_artifact_prefix = "LibRapid_Benchmark_SHA_"
104104
rtds_action_github_token = os.environ["GITHUB_TOKEN"]
105-
rtds_action_error_if_missing = False
105+
rtds_action_error_if_missing = True
106106

107107
autosectionlabel_prefix_document = True
108108

@@ -182,10 +182,10 @@
182182
<img src="/en/latest/_static/LR_icon.png" alt="LibRapid" width="22.5"></img>
183183
<a href="https://github.com/sponsors/Pencilcaseman">
184184
<span class="banner-resize-text-lg">
185-
If you like LibRapid, please consider a small donation support its development!
185+
If you like LibRapid, please consider supporting its development!
186186
</span>
187187
<span class="banner-resize-text-sm">
188-
Please consider donating!
188+
Support LibRapid's Development!
189189
</span>
190190
</a>
191191
</div>

docs/source/index.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,18 @@ View LibRapid's API and documentation.
3838
Learn how to use some of LibRapid's features.
3939
:::
4040

41-
:::{grid-item-card} {octicon}`stopwatch` Performance and Benchmarks
41+
:::{grid-item-card} {octicon}`stopwatch` Performance Tips
4242
:link: performance/performance
4343
:link-type: doc
4444

45-
View LibRapid's benchmark results.
45+
Learn how to get the most out of LibRapid.
46+
:::
47+
48+
:::{grid-item-card} {octicon}`fold` Benchmarks
49+
:link: BenchmarkResults/BenchmarkResults
50+
:link-type: doc
51+
52+
See how LibRapid compares to other libraries.
4653
:::
4754

4855
:::{grid-item-card} {octicon}`alert` Caution

0 commit comments

Comments
 (0)