-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_bench.sh
More file actions
executable file
·56 lines (45 loc) · 1.64 KB
/
Copy pathrun_bench.sh
File metadata and controls
executable file
·56 lines (45 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# UTF Strings Simple Benchmark Script
# This script builds and runs benchmarks without profiling dependencies
set -e # Exit on any error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Script directory (project root)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo -e "${BLUE}=== UTF Strings Benchmark Runner ===${NC}"
echo -e "${YELLOW}Project directory: $SCRIPT_DIR${NC}"
# Check if conan dependencies are built
if [ ! -f "build/conan_toolchain.cmake" ]; then
echo -e "${RED}Error: Conan dependencies not found${NC}"
echo -e "${YELLOW}Run bootstrap script first:${NC}"
if [ -f "bootstrap_build.sh" ]; then
echo -e " ./bootstrap_build.sh"
else
echo -e " conan install . --build=missing -s build_type=Release"
fi
exit 1
fi
# Configure CMake for Release build
echo -e "${BLUE}=== Configuring CMake (Release) ===${NC}"
cmake -S . -B build/Release \
-DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DUTF_STRINGS_WITH_GPERFTOOLS=ON
# Build the project
echo -e "${BLUE}=== Building Release ===${NC}"
cmake --build build/Release
# Check if benchmark executable exists
BENCH_EXECUTABLE="build/Release/utf_strings-bench"
if [ ! -f "$BENCH_EXECUTABLE" ]; then
echo -e "${RED}Error: Benchmark executable not found at $BENCH_EXECUTABLE${NC}"
exit 1
fi
echo -e "${BLUE}=== Running Benchmark ===${NC}"
"./$BENCH_EXECUTABLE"
echo -e "${GREEN}=== Benchmark completed successfully ===${NC}"
echo -e "${YELLOW}For profiling, install perf and use: ./profile_bench.sh${NC}"