Skip to content

Instantly share code, notes, and snippets.

@samdoidge
Last active January 21, 2026 15:19
Show Gist options
  • Select an option

  • Save samdoidge/3bd408e872aacd24adb933fea469d024 to your computer and use it in GitHub Desktop.

Select an option

Save samdoidge/3bd408e872aacd24adb933fea469d024 to your computer and use it in GitHub Desktop.
VS Code vs VSCodium benchmark script - tests startup time, memory usage, and file opening performance on macOS
#!/bin/bash
# VS Code vs VSCodium Benchmark Script
# Tests startup time, memory usage, and file opening performance
# Run on macOS with both editors installed
set -e
# Configuration
VSCODE="code"
CODIUM="/Applications/VSCodium.app/Contents/Resources/app/bin/codium"
RUNS=3
TEST_DIR="/tmp/editor_benchmark"
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}=== VS Code vs VSCodium Benchmark ===${NC}"
echo ""
# Check both are installed
if ! command -v $VSCODE &> /dev/null; then
echo "VS Code not found. Install it or update the VSCODE path."
exit 1
fi
if [ ! -f "$CODIUM" ]; then
echo "VSCodium not found at $CODIUM. Update the CODIUM path."
exit 1
fi
# Print versions
echo "VS Code version: $($VSCODE --version | head -1)"
echo "VSCodium version: $($CODIUM --version | head -1)"
echo ""
# Create test file
echo -e "${BLUE}Creating test files...${NC}"
mkdir -p "$TEST_DIR"
if [ ! -f "$TEST_DIR/large_file.js" ]; then
for i in $(seq 1 100000); do
echo "const variable_$i = { id: $i, name: 'item_$i', value: Math.random() * $i };"
done > "$TEST_DIR/large_file.js"
fi
echo "Test file: $(wc -l < "$TEST_DIR/large_file.js") lines"
echo ""
# Function to measure startup time
measure_startup() {
local cmd=$1
local name=$2
local flags=$3
echo -e "${GREEN}--- $name Cold Startup ($RUNS runs) ---${NC}"
for i in $(seq 1 $RUNS); do
# Ensure app is closed
pkill -f "$name" 2>/dev/null || true
sleep 1
# Measure startup
start=$(date +%s.%N)
$cmd $flags --wait --new-window -n "$TEST_DIR" &
pid=$!
sleep 2
kill $pid 2>/dev/null || true
end=$(date +%s.%N)
elapsed=$(echo "$end - $start - 2" | bc)
printf "Run %d: %.3fs\n" $i $elapsed
done
echo ""
}
# Function to measure memory
measure_memory() {
local app_name=$1
local display_name=$2
echo -e "${GREEN}--- $display_name Memory Usage ---${NC}"
# Get memory for all processes matching the app
ps aux | grep -i "$app_name" | grep -v grep | awk '{sum += $6} END {printf "Total RSS: %.1f MB\n", sum/1024}'
ps aux | grep -i "$app_name" | grep -v grep | wc -l | xargs echo "Process count:"
echo ""
}
# Close both apps
echo -e "${BLUE}Closing any running instances...${NC}"
osascript -e 'quit app "Visual Studio Code"' 2>/dev/null || true
osascript -e 'quit app "VSCodium"' 2>/dev/null || true
sleep 2
# Startup benchmarks
echo -e "${BLUE}=== STARTUP TIME BENCHMARKS ===${NC}"
echo ""
measure_startup "$VSCODE" "VS Code" "--disable-extensions"
measure_startup "$CODIUM" "VSCodium" ""
# Memory benchmarks
echo -e "${BLUE}=== MEMORY BENCHMARKS ===${NC}"
echo ""
# Start both fresh
pkill -f "Visual Studio Code" 2>/dev/null || true
pkill -f "VSCodium" 2>/dev/null || true
sleep 2
echo "Starting VS Code (extensions disabled)..."
$VSCODE --disable-extensions --new-window "$TEST_DIR" &
sleep 5
measure_memory "Visual Studio Code" "VS Code"
echo "Starting VSCodium..."
$CODIUM --new-window "$TEST_DIR" &
sleep 5
measure_memory "VSCodium" "VSCodium"
# File opening benchmark
echo -e "${BLUE}=== FILE OPENING BENCHMARK ===${NC}"
echo "(Opening 100,000 line file)"
echo ""
for editor in "VS Code:$VSCODE:--disable-extensions" "VSCodium:$CODIUM:"; do
IFS=':' read -r name cmd flags <<< "$editor"
echo -e "${GREEN}--- $name ---${NC}"
for i in $(seq 1 $RUNS); do
start=$(date +%s.%N)
$cmd $flags --wait --reuse-window "$TEST_DIR/large_file.js" &
pid=$!
sleep 3
kill $pid 2>/dev/null || true
end=$(date +%s.%N)
elapsed=$(echo "$end - $start - 3" | bc)
printf "Run %d: %.2fs\n" $i $elapsed
done
echo ""
done
# Cleanup
echo -e "${BLUE}=== BENCHMARK COMPLETE ===${NC}"
echo ""
echo "Note: For a fair comparison, VS Code was run with --disable-extensions"
echo "Your VS Code extensions: $($VSCODE --list-extensions 2>/dev/null | wc -l | xargs)"
echo "Your VSCodium extensions: $($CODIUM --list-extensions 2>/dev/null | wc -l | xargs)"
#!/bin/bash
# VS Code vs VSCodium vs Zed Benchmark Script
# Tests startup time, memory usage, and file opening performance
# Run on macOS with all three editors installed
set -e
# Configuration - adjust paths if needed
VSCODE="code"
CODIUM="/Applications/VSCodium.app/Contents/Resources/app/bin/codium"
ZED="zed"
RUNS=3
TEST_DIR="/tmp/editor_benchmark"
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ VS Code vs VSCodium vs Zed Performance Benchmark ║${NC}"
echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
echo ""
# Check all editors are installed
check_editor() {
if ! command -v $1 &> /dev/null && [ ! -f "$1" ]; then
echo -e "${YELLOW}Warning: $2 not found at $1${NC}"
return 1
fi
return 0
}
check_editor "$VSCODE" "VS Code"
check_editor "$CODIUM" "VSCodium"
check_editor "$ZED" "Zed"
# Print versions
echo -e "${GREEN}Versions:${NC}"
echo " VS Code: $($VSCODE --version 2>/dev/null | head -1 || echo 'Not found')"
echo " VSCodium: $($CODIUM --version 2>/dev/null | head -1 || echo 'Not found')"
echo " Zed: $($ZED --version 2>/dev/null | head -1 || echo 'Not found')"
echo ""
# Create test files
echo -e "${BLUE}Creating test files...${NC}"
mkdir -p "$TEST_DIR"
if [ ! -f "$TEST_DIR/large_file.js" ]; then
echo "Generating 100,000 line JS file..."
for i in $(seq 1 100000); do
echo "const variable_$i = { id: $i, name: 'item_$i', value: Math.random() * $i };"
done > "$TEST_DIR/large_file.js"
fi
echo "Test file: $(wc -l < "$TEST_DIR/large_file.js" | tr -d ' ') lines"
echo ""
# Close all editors
close_all() {
pkill -f "Visual Studio Code" 2>/dev/null || true
pkill -f "VSCodium" 2>/dev/null || true
pkill -f "Zed" 2>/dev/null || true
sleep 2
}
# === STARTUP BENCHMARK ===
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BLUE} COLD STARTUP TIME ${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
close_all
echo -e "${GREEN}--- Zed ($RUNS runs) ---${NC}"
for i in $(seq 1 $RUNS); do
pkill -f "Zed" 2>/dev/null || true
sleep 2
result=$(/usr/bin/time -p $ZED "$TEST_DIR" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
pkill -f "Zed" 2>/dev/null || true
done
echo ""
echo -e "${GREEN}--- VS Code --disable-extensions ($RUNS runs) ---${NC}"
for i in $(seq 1 $RUNS); do
pkill -f "Visual Studio Code" 2>/dev/null || true
sleep 2
result=$(/usr/bin/time -p $VSCODE --disable-extensions --new-window -n "$TEST_DIR" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
pkill -f "Visual Studio Code" 2>/dev/null || true
done
echo ""
echo -e "${GREEN}--- VSCodium ($RUNS runs) ---${NC}"
for i in $(seq 1 $RUNS); do
pkill -f "VSCodium" 2>/dev/null || true
sleep 2
result=$(/usr/bin/time -p $CODIUM --new-window -n "$TEST_DIR" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
pkill -f "VSCodium" 2>/dev/null || true
done
# === MEMORY BENCHMARK ===
echo ""
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BLUE} MEMORY USAGE ${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
close_all
echo "Starting all editors with test directory..."
open -a Zed "$TEST_DIR"
sleep 3
$VSCODE --disable-extensions --new-window "$TEST_DIR" &
sleep 3
$CODIUM --new-window "$TEST_DIR" &
sleep 3
echo ""
echo -e "${GREEN}--- Zed ---${NC}"
ps aux | grep -i "[Z]ed" | awk '{sum += $6; count++} END {printf " Total: %.1f MB (%d processes)\n", sum/1024, count}'
echo ""
echo -e "${GREEN}--- VS Code ---${NC}"
ps aux | grep -i "[V]isual Studio Code" | awk '{sum += $6; count++} END {printf " Total: %.1f MB (%d processes)\n", sum/1024, count}'
echo ""
echo -e "${GREEN}--- VSCodium ---${NC}"
ps aux | grep -i "[V]SCodium" | awk '{sum += $6; count++} END {printf " Total: %.1f MB (%d processes)\n", sum/1024, count}'
# === FILE OPENING BENCHMARK ===
echo ""
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BLUE} FILE OPENING (100K line file) ${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
TEST_FILE="$TEST_DIR/large_file.js"
echo -e "${GREEN}--- Zed ---${NC}"
for i in $(seq 1 $RUNS); do
result=$(/usr/bin/time -p $ZED "$TEST_FILE" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
sleep 1
done
echo ""
echo -e "${GREEN}--- VS Code ---${NC}"
for i in $(seq 1 $RUNS); do
result=$(/usr/bin/time -p $VSCODE --disable-extensions --reuse-window "$TEST_FILE" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
sleep 1
done
echo ""
echo -e "${GREEN}--- VSCodium ---${NC}"
for i in $(seq 1 $RUNS); do
result=$(/usr/bin/time -p $CODIUM --reuse-window "$TEST_FILE" 2>&1 | grep real | awk '{print $2}')
echo " Run $i: ${result}s"
sleep 1
done
# === SUMMARY ===
echo ""
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BLUE} NOTES ${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
echo "- VS Code was run with --disable-extensions for fair comparison"
echo "- Your installed extensions:"
echo " VS Code: $($VSCODE --list-extensions 2>/dev/null | wc -l | tr -d ' ')"
echo " VSCodium: $($CODIUM --list-extensions 2>/dev/null | wc -l | tr -d ' ')"
echo ""
echo "Benchmark complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment