-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbenchmark.sh
More file actions
executable file
·51 lines (42 loc) · 1.83 KB
/
benchmark.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.83 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
#!/bin/bash
# MANTRA Vanity Address Generator - Performance Benchmark Script
# This script runs performance tests to verify parallel processing improvements
echo "🚀 MANTRA Vanity Address Parallel Processing Benchmark"
echo "======================================================"
# Check if server is running
if ! curl -s http://localhost:8000 > /dev/null; then
echo "❌ Local server not running on port 8000"
echo " Please run: python3 -m http.server 8000"
exit 1
fi
echo "✅ Server is running on localhost:8000"
# Get system info
echo ""
echo "💻 System Information:"
echo " CPU cores: $(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 'unknown')"
echo " Memory: $(sysctl -n hw.memsize 2>/dev/null | awk '{print $1/1024/1024/1024 " GB"}' || echo 'unknown')"
# Check WASM files
echo ""
echo "📦 WASM Module Information:"
echo " vanity_wasm.js: $(ls -lh vanity_wasm.js | awk '{print $5}')"
echo " vanity_wasm_bg.wasm: $(ls -lh vanity_wasm_bg.wasm | awk '{print $5}')"
# Test file access
echo ""
echo "🔍 Testing file accessibility..."
for file in vanity_wasm.js vanity_wasm_bg.wasm worker.js main.js; do
if curl -s "http://localhost:8000/$file" > /dev/null; then
echo " ✅ $file - accessible"
else
echo " ❌ $file - not accessible"
fi
done
echo ""
echo "🧪 Test Results:"
echo " Open http://localhost:8000/test-parallel.html in your browser"
echo " Click the test buttons to verify parallel processing"
echo ""
echo "📊 Expected Performance Improvements:"
echo " - Single-threaded: ~1,000-5,000 addresses/second"
echo " - Multi-threaded: ~$(echo "$(sysctl -n hw.ncpu 2>/dev/null || echo 4) * 1500" | bc 2>/dev/null || echo "6,000")-$(echo "$(sysctl -n hw.ncpu 2>/dev/null || echo 4) * 3000" | bc 2>/dev/null || echo "12,000") addresses/second"
echo ""
echo "✨ Happy testing!"