add first draft graph query implementation
Some checks failed
Go / build-and-release (push) Has been cancelled

This commit is contained in:
2025-12-04 09:28:13 +00:00
parent 8dbc19ee9e
commit 6b98c23606
40 changed files with 9078 additions and 46 deletions

View File

@@ -3,19 +3,25 @@
# Wrapper script to run the benchmark suite and automatically shut down when complete
#
# Usage:
# ./run-benchmark.sh # Use disk-based storage (default)
# ./run-benchmark.sh --ramdisk # Use /dev/shm ramdisk for maximum performance
# ./run-benchmark.sh # Use disk-based storage (default)
# ./run-benchmark.sh --ramdisk # Use /dev/shm ramdisk for maximum performance
# ./run-benchmark.sh --graph # Also run graph traversal benchmarks
set -e
# Parse command line arguments
USE_RAMDISK=false
USE_GRAPH_TRAVERSAL=false
for arg in "$@"; do
case $arg in
--ramdisk)
USE_RAMDISK=true
shift
;;
--graph)
USE_GRAPH_TRAVERSAL=true
shift
;;
--help|-h)
echo "Usage: $0 [OPTIONS]"
echo ""
@@ -23,6 +29,8 @@ for arg in "$@"; do
echo " --ramdisk Use /dev/shm ramdisk storage instead of disk"
echo " This eliminates disk I/O bottlenecks for accurate"
echo " relay performance measurement."
echo " --graph Run graph traversal benchmarks (100k pubkeys,"
echo " 1-1000 follows each, 3-degree traversal)"
echo " --help, -h Show this help message"
echo ""
echo "Requirements for --ramdisk:"
@@ -39,6 +47,9 @@ for arg in "$@"; do
esac
done
# Export graph traversal setting for docker-compose
export BENCHMARK_GRAPH_TRAVERSAL="${USE_GRAPH_TRAVERSAL}"
# Determine docker-compose command
if docker compose version &> /dev/null 2>&1; then
DOCKER_COMPOSE="docker compose"
@@ -97,6 +108,17 @@ else
echo ""
fi
# Show graph traversal status
if [ "$USE_GRAPH_TRAVERSAL" = true ]; then
echo "======================================================"
echo " GRAPH TRAVERSAL BENCHMARK ENABLED"
echo "======================================================"
echo " Will test 100k pubkeys with 1-1000 follows each"
echo " performing 3-degree graph traversal queries"
echo "======================================================"
echo ""
fi
# Clean old data directories (may be owned by root from Docker)
if [ -d "${DATA_BASE}" ]; then
echo "Cleaning old data directories at ${DATA_BASE}..."