-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-optimized.sh
More file actions
52 lines (43 loc) · 1.52 KB
/
build-optimized.sh
File metadata and controls
52 lines (43 loc) · 1.52 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
#!/bin/bash
# Ultra-optimized build script for maximum performance
# This script builds the IPA parser with all optimizations enabled
echo "🚀 Building IPA Parser with EXTREME optimizations..."
echo ""
# Set environment variables for maximum performance
export RUSTFLAGS="-C target-cpu=native -C opt-level=3 -C embed-bitcode=yes"
export CARGO_PROFILE_RELEASE_LTO=true
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
# Clean previous builds
echo "🧹 Cleaning previous builds..."
cargo clean
# Build with release profile
echo "⚡ Compiling with native CPU optimizations..."
echo " - Target CPU: native (using all available CPU features)"
echo " - Optimization level: 3 (maximum)"
echo " - LTO: fat (full link-time optimization)"
echo " - Codegen units: 1 (maximum optimization)"
echo ""
RUSTFLAGS="-C target-cpu=native -C opt-level=3" cargo build --release
if [ $? -eq 0 ]; then
echo ""
echo "✅ Build successful!"
echo ""
echo "📦 Binary location: target/release/ipa-parser"
# Show binary size
if [ -f "target/release/ipa-parser" ]; then
SIZE=$(du -h target/release/ipa-parser | cut -f1)
echo "📏 Binary size: $SIZE"
fi
echo ""
echo "🎯 Run with: ./target/release/ipa-parser --help"
echo ""
echo "⚡ Performance tips:"
echo " - This binary is optimized for YOUR specific CPU"
echo " - Use --multiple for parallel processing"
echo " - Use --no-icons for metadata-only (faster)"
echo ""
else
echo ""
echo "❌ Build failed!"
exit 1
fi