mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 13:10:33 +00:00
Run the json_view comparison on GitHub runners on demand
A workflow runs compare.py with pinned downloads on GitHub-hosted Ubuntu runners and shows the results as the job summary and as an artifact: started by hand (workflow_dispatch: x86-64 or AArch64, GCC or Clang), or when a pull request gets the label "benchmark" (both architectures, GCC). The label trigger gives numbers before the workflow is on the default branch, which workflow_dispatch needs. Shared runners are noisy, so the numbers show where json_view stands on another architecture; published numbers still need a quiet machine. compare.py takes the CPU name from lscpu where /proc/cpuinfo has none (AArch64 Linux), and falls back to the architecture. Checked in Linux containers (AArch64, Clang 15 and GCC 9, offline with the pinned archives). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -183,7 +183,11 @@ def cpu_model():
|
||||
return line.split(':', 1)[1].strip()
|
||||
except OSError:
|
||||
pass
|
||||
return platform.processor()
|
||||
# (AArch64 Linux: /proc/cpuinfo has no model name, lscpu knows it)
|
||||
for line in output(['lscpu']).splitlines():
|
||||
if line.startswith('Model name:'):
|
||||
return line.split(':', 1)[1].strip()
|
||||
return platform.processor() or platform.machine()
|
||||
|
||||
|
||||
def git_commit():
|
||||
|
||||
Reference in New Issue
Block a user