Skip to content

Commit 0b59931

Browse files
committed
Updating to keep up with benchmark_suite changes.
1 parent c416f5e commit 0b59931

File tree

8 files changed

+274
-254
lines changed

8 files changed

+274
-254
lines changed

.github/workflows/Benchmark.yml

Lines changed: 80 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ jobs:
8080
working-directory: ./
8181
run: |
8282
sudo apt-get install build-essential
83-
sudo apt-get install g++-12
83+
sudo apt-get install g++-14
8484
8585
- name: Configure CMake
8686
working-directory: ./
8787
run: |
88-
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=/usr/bin/g++-12
88+
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=/usr/bin/g++-14
8989
9090
- name: Build the Test
9191
working-directory: ./Build
@@ -132,7 +132,7 @@ jobs:
132132
sudo apt update
133133
wget https://apt.llvm.org/llvm.sh
134134
chmod u+x llvm.sh
135-
sudo ./llvm.sh 19
135+
sudo ./llvm.sh 20
136136
137137
- name: Install Seaborn
138138
run: |
@@ -141,7 +141,7 @@ jobs:
141141
- name: Configure CMake
142142
working-directory: ./
143143
run: |
144-
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=/usr/bin/clang++-19
144+
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=/usr/bin/clang++-20
145145
146146
- name: Build the Test
147147
working-directory: ./Build
@@ -173,77 +173,83 @@ jobs:
173173
sudo git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/RealTimeChris/Json-Performance.git temp-clang-ubuntu
174174
175175
Build-GNUCXX-MacOS:
176-
runs-on: macos-latest
176+
runs-on: macos-latest
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
build_type: [Release]
181+
steps:
182+
- uses: actions/checkout@v4
183+
184+
- name: Set up Python
185+
uses: actions/setup-python@v5
186+
with:
187+
python-version: '3.x'
188+
189+
- name: Create requirements.txt
190+
run: |
191+
echo seaborn > requirements.txt
192+
echo matplotlib >> requirements.txt
193+
echo pandas >> requirements.txt
194+
195+
- name: Install dependencies
196+
run: |
197+
python -m venv env
198+
source env/bin/activate
199+
pip install -r requirements.txt
200+
201+
- name: Install GCC
202+
run: |
203+
brew install gcc
204+
205+
- name: Set up GCC environment
206+
run: |
207+
GCC_PATH=$(brew --prefix gcc)
208+
GCC_VER=$(ls ${GCC_PATH}/bin/gcc-* 2>/dev/null | grep -oE '[0-9]+$' | sort -rn | head -1)
177209
178-
strategy:
179-
fail-fast: false
180-
matrix:
181-
build_type: [Release]
210+
echo "CC=${GCC_PATH}/bin/gcc-${GCC_VER}" >> $GITHUB_ENV
211+
echo "CXX=${GCC_PATH}/bin/g++-${GCC_VER}" >> $GITHUB_ENV
182212
183-
steps:
184-
- uses: actions/checkout@v4
185-
186-
- name: Set up Python
187-
uses: actions/setup-python@v5
188-
with:
189-
python-version: '3.x'
190-
191-
- name: Create requirements.txt
192-
run: |
193-
echo seaborn > requirements.txt
194-
echo matplotlib >> requirements.txt
195-
echo pandas >> requirements.txt
196-
197-
- name: Install dependencies
198-
run: |
199-
python -m venv env
200-
source env/bin/activate
201-
pip install -r requirements.txt
202-
203-
- name: Install the latest GNUCXX compiler
204-
run: |
205-
brew install gcc --force-bottle
206-
207-
- name: Determine g++ path
208-
id: gpp_path
209-
run: |
210-
echo "G++ Path: $(which g++)"
211-
echo "GXX_PATH=$(which g++)" >> $GITHUB_ENV
212-
213-
- name: Configure CMake
214-
working-directory: ./
215-
run: |
216-
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{env.GXX_PATH}}
217-
218-
- name: Build the Test
219-
working-directory: ./Build
220-
run: |
221-
cmake --build . --config=${{ matrix.build_type }}
222-
223-
- name: Install the Test
224-
working-directory: ./Build
225-
run: |
226-
sudo cmake --install . --config=${{ matrix.build_type }}
227-
sudo chmod +x /Users/runner/work/Json-Performance/Json-Performance/Install/bin/Json-Performance
228-
229-
- name: Run the Test
230-
working-directory: /Users/runner/work/Json-Performance/Json-Performance/Install/bin/
231-
run: |
232-
source /Users/runner/work/Json-Performance/Json-Performance/env/bin/activate
233-
./Json-Performance
234-
continue-on-error: true
235-
236-
- name: Commit and push the changes to a temp branch.
237-
env:
238-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
239-
working-directory: /Users/runner/work/Json-Performance/Json-Performance/
240-
run: |
241-
sudo git config --global user.email "[email protected]"
242-
sudo git config --global user.name "RealTimeChris"
243-
sudo git checkout -b temp-gnucxx-macos
244-
sudo git add .
245-
sudo git commit -m "Updates - GNUCXX-MacOS"
246-
sudo git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/RealTimeChris/Json-Performance.git temp-gnucxx-macos
213+
${GCC_PATH}/bin/gcc-${GCC_VER} --version
214+
${GCC_PATH}/bin/g++-${GCC_VER} --version
215+
216+
- name: Configure CMake
217+
working-directory: ./
218+
run: |
219+
cmake -S . -B ./Build \
220+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
221+
-DCMAKE_C_COMPILER=${{ env.CC }} \
222+
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
223+
224+
- name: Build the Test
225+
working-directory: ./Build
226+
run: |
227+
cmake --build . --config=${{ matrix.build_type }}
228+
229+
- name: Install the Test
230+
working-directory: ./Build
231+
run: |
232+
sudo cmake --install . --config=${{ matrix.build_type }}
233+
sudo chmod +x /Users/runner/work/Json-Performance/Json-Performance/Install/bin/Json-Performance
234+
235+
- name: Run the Test
236+
working-directory: /Users/runner/work/Json-Performance/Json-Performance/Install/bin/
237+
run: |
238+
source /Users/runner/work/Json-Performance/Json-Performance/env/bin/activate
239+
./Json-Performance
240+
continue-on-error: true
241+
242+
- name: Commit and push the changes to a temp branch.
243+
env:
244+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
245+
working-directory: /Users/runner/work/Json-Performance/Json-Performance/
246+
run: |
247+
sudo git config --global user.email "[email protected]"
248+
sudo git config --global user.name "RealTimeChris"
249+
sudo git checkout -b temp-gnucxx-macos
250+
sudo git add .
251+
sudo git commit -m "Updates - GNUCXX-MacOS"
252+
sudo git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/RealTimeChris/Json-Performance.git temp-gnucxx-macos
247253
248254
Build-CLANG-MacOS:
249255
runs-on: macos-latest
@@ -280,7 +286,7 @@ jobs:
280286
- name: Configure CMake
281287
working-directory: ./
282288
run: |
283-
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++
289+
cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
284290
285291
- name: Build the Test
286292
working-directory: ./Build

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ FetchContent_MakeAvailable(glaze)
3333
getCommitHash("${glaze_SOURCE_DIR}" GLAZE_COMMIT_HASH)
3434

3535
FetchContent_Declare(
36-
BenchmarkSuite
37-
GIT_REPOSITORY https://github.com/RealTimeChris/BenchmarkSuite.git
36+
benchmarksuite
37+
GIT_REPOSITORY https://github.com/RealTimeChris/benchmarksuite.git
3838
GIT_TAG main
3939
GIT_SHALLOW TRUE
4040
)
41-
FetchContent_MakeAvailable(BenchmarkSuite)
41+
FetchContent_MakeAvailable(benchmarksuite)
4242

4343
FetchContent_Declare(
4444
simdjson
@@ -56,7 +56,7 @@ add_executable(
5656

5757
target_link_libraries(
5858
"Json-Performance" PUBLIC
59-
Jsonifier::Jsonifier glaze::glaze simdjson BenchmarkSuite::BenchmarkSuite
59+
Jsonifier::Jsonifier glaze::glaze simdjson benchmarksuite::benchmarksuite
6060
)
6161

6262
target_compile_options(

ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Here's a few benchmarks on a few common operating system/compiler platforms. Alt
3636
6. Run the executable from wherever it was installed to!
3737
1.
3838
#### Note:
39-
These benchmarks were executed using the CPU benchmark library [BenchmarkSuite](https://github.com/RealTimeChris/BenchmarkSuite)
39+
These benchmarks were executed using the CPU benchmark library [benchmarksuite](https://github.com/RealTimeChris/benchmarksuite)

Source/Common.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// https://github.com/RealTimeChris/jsonifier
2323
#pragma once
2424

25-
#include <BnchSwt/BenchmarkSuite.hpp>
25+
#include <bnch_swt/index.hpp>
2626
#include "UnicodeEmoji.hpp"
2727
#include "CitmCatalog.hpp"
2828
#include "Twitter.hpp"
@@ -42,7 +42,7 @@ static constexpr auto measuredIterations{ 25 };
4242

4343
constexpr auto getCurrentOperatingSystem() {
4444
constexpr bnch_swt::string_literal osName{ OPERATING_SYSTEM_NAME };
45-
constexpr auto osNameNew = bnch_swt::internal::toLower(osName);
45+
constexpr auto osNameNew = bnch_swt::internal::to_lower(osName);
4646
if constexpr (osNameNew.operator std::string_view().contains("linux")) {
4747
return bnch_swt::string_literal{ "Ubuntu" };
4848
} else if constexpr (osNameNew.operator std::string_view().contains("windows")) {
@@ -56,11 +56,11 @@ constexpr auto getCurrentOperatingSystem() {
5656

5757
constexpr auto getCurrentCompilerId() {
5858
constexpr bnch_swt::string_literal compilerId{ COMPILER_ID };
59-
constexpr auto osCompilerIdNew = bnch_swt::internal::toLower(compilerId);
59+
constexpr auto osCompilerIdNew = bnch_swt::internal::to_lower(compilerId);
6060
if constexpr (osCompilerIdNew.operator std::string_view().contains("gnu") || osCompilerIdNew.operator std::string_view().contains("gcc") ||
61-
osCompilerIdNew.operator std::string_view().contains("g++") || osCompilerIdNew.operator std::string_view().contains("apple")) {
61+
osCompilerIdNew.operator std::string_view().contains("g++")) {
6262
return bnch_swt::string_literal{ "GNUCXX" };
63-
} else if constexpr (osCompilerIdNew.operator std::string_view().contains("clang")) {
63+
} else if constexpr (osCompilerIdNew.operator std::string_view().contains("clang") || osCompilerIdNew.operator std::string_view().contains("appleclang")) {
6464
return bnch_swt::string_literal{ "CLANG" };
6565
} else if constexpr (osCompilerIdNew.operator std::string_view().contains("msvc")) {
6666
return bnch_swt::string_literal{ "MSVC" };
@@ -144,7 +144,7 @@ std::string getCPUInfo() {
144144
}
145145

146146
void executePythonScript(const std::string& scriptPath, const std::string& argument01, const std::string& argument02) {
147-
#if defined(JSONIFIER_WIN)
147+
#if JSONIFIER_PLATFORM_WINDOWS
148148
static std::string pythonName{ "python " };
149149
#else
150150
static std::string pythonName{ "python3 " };
@@ -367,13 +367,13 @@ template<result_type type> struct result {
367367
result& operator=(const result&) noexcept = default;
368368
result(const result&) noexcept = default;
369369

370-
result(const std::string& colorNew, const bnch_swt::performance_metrics& results) {
371-
byteLength.emplace(results.bytesProcessed);
372-
jsonTime.emplace(results.timeInNs);
373-
jsonSpeedPercentageDeviation.emplace(results.throughputPercentageDeviation);
374-
jsonSpeed.emplace(results.throughputMbPerSec);
375-
if (results.cyclesPerByte.has_value()) {
376-
jsonCycles.emplace(results.cyclesPerByte.value() * 1024 * 1024);
370+
result(const std::string& colorNew, const bnch_swt::performance_metrics<bnch_swt::benchmark_types::cpu>& results) {
371+
byteLength.emplace(results.bytes_processed);
372+
jsonTime.emplace(results.time_in_ns);
373+
jsonSpeedPercentageDeviation.emplace(results.throughput_percentage_deviation);
374+
jsonSpeed.emplace(results.throughput_mb_per_sec);
375+
if (results.cycles_per_byte.has_value()) {
376+
jsonCycles.emplace(results.cycles_per_byte.value() * 1024 * 1024);
377377
}
378378
color = colorNew;
379379
}
@@ -459,7 +459,7 @@ struct test_results {
459459
};
460460

461461
std::tm getTime() {
462-
#if defined(JSONIFIER_WIN)
462+
#if JSONIFIER_PLATFORM_WINDOWS
463463
std::time_t result = std::time(nullptr);
464464
std::tm resultTwo{};
465465
localtime_s(&resultTwo, &result);

Source/Glaze.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// https://github.com/RealTimeChris/jsonifier
2323
#pragma once
2424

25-
#include <BnchSwt/BenchmarkSuite.hpp>
25+
#include <bnch_swt/index.hpp>
2626
#include <glaze/glaze.hpp>
2727
#include "Common.hpp"
2828

Source/Jsonifier.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// https://github.com/RealTimeChris/jsonifier
2323
#pragma once
2424

25-
#include <BnchSwt/BenchmarkSuite.hpp>
25+
#include <bnch_swt/index.hpp>
2626
#include <jsonifier/Index.hpp>
2727
#include "Common.hpp"
2828

Source/Simdjson.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// https://github.com/RealTimeChris/jsonifier
2323
#pragma once
2424

25-
#include <BnchSwt/BenchmarkSuite.hpp>
25+
#include <bnch_swt/index.hpp>
2626
#include "simdjson.h"
2727
#include "Common.hpp"
2828

0 commit comments

Comments
 (0)