benchmarks: add descriptions

Benchmark scripts now have optional descriptions that will be persisted
into the JSON output.
This commit is contained in:
Edward Thomson
2025-01-16 08:59:57 +00:00
parent 42b162d796
commit e5fbaf181e
17 changed files with 35 additions and 1 deletions

View File

@@ -200,6 +200,8 @@ for TEST_PATH in "${BENCHMARK_DIR}"/*; do
continue
fi
TEST_DESCRIPTION=$(( grep '^# Description: ' "${TEST_PATH}" || test $? = 1 ) | sed -e "s/^# Description: //")
ANY_FOUND=1
TEST_NAME="${TEST_FILE/__/::}"
@@ -267,7 +269,7 @@ for TEST_PATH in "${BENCHMARK_DIR}"/*; do
fi
# add our metadata to the hyperfine json result
jq ". |= { \"name\": \"${TEST_NAME}\" } + ." < "${JSON_FILE}" > "${JSON_FILE}.new" && mv "${JSON_FILE}.new" "${JSON_FILE}"
jq ". |= { \"name\": \"${TEST_NAME}\", \"description\": \"${TEST_DESCRIPTION}\" } + ." < "${JSON_FILE}" > "${JSON_FILE}.new" && mv "${JSON_FILE}.new" "${JSON_FILE}"
# run with flamegraph output if requested
if [ "${FLAMEGRAPH}" ]; then

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: blame a file in the core git repository
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: blame a file in the linux repository
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: blame a simple file in the test repository
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 100kb text file
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 10mb text file
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 1kb text file
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 100kb text file (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 10mb text file (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: hash a 1kb text file (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 100kb text file to the object database
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 10mb text file to the object database
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 1kb text file to the object database
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 100kb text file to the ODB (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 10mb text file to the ODB (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: write a 1kb text file to the ODB (after flushing disk cache)
. "$(dirname "$0")/benchmark_helpers.sh"

View File

@@ -1,4 +1,6 @@
#!/bin/bash -e
#
# Description: index a 250mb packfile
. "$(dirname "$0")/benchmark_helpers.sh"