-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark_kill.sh
More file actions
32 lines (22 loc) · 1.41 KB
/
benchmark_kill.sh
File metadata and controls
32 lines (22 loc) · 1.41 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
#!/bin/bash
# benchmark_kill.sh
# مقارنة الموت: VenomShell vs Bash
TARGET_SHELL="./build/venom"
echo "══════════════════════════════════════════"
echo " ⚡ VENOM SHELL vs BASH BENCHMARK ⚡ "
echo "══════════════════════════════════════════"
# 1.(Arithmetic & Logic)
echo "[1] Testing Pure Logic (1,000,000 iterations)..."
time_bash=$( (time bash -c 'i=0; while [ $i -lt 1000000 ]; do i=$((i+1)); done') 2>&1 | grep real | awk '{print $2}' )
echo "🐢 Bash: $time_bash"
time_venom=$( (time $TARGET_SHELL -c 'i=0; while [ $i -lt 1000000 ]; do i=$((i+1)); done') 2>&1 | grep real | awk '{print $2}' )
echo "🚀 Venom: $time_venom"
echo "------------------------------------------"
# 2. (String Expansion)
echo "[2] Testing String Expansion..."
# Bash Memory Allocation for string concatenation
time_bash_str=$( (time bash -c 's=""; for i in $(seq 1 50000); do s="x$s"; done') 2>&1 | grep real | awk '{print $2}' )
echo "🐢 Bash: $time_bash_str"
time_venom_str=$( (time $TARGET_SHELL -c 's=""; for i in $(seq 1 50000); do s="x$s"; done') 2>&1 | grep real | awk '{print $2}' )
echo "🚀 Venom: $time_venom_str"
echo "══════════════════════════════════════════"