Add image processing benchmarks and UI folder open buttons
- Added MaddoShared.Benchmarks project with BenchmarkDotNet for comprehensive image processing performance tests (parallel, chunk, size, stress). - Included helper for generating test images and custom configs to ensure InProcess toolchain for .NET Windows compatibility. - Added cross-platform scripts to run benchmarks easily. - Updated .gitignore for benchmark artifacts and temp files. - Exposed GetFilesToProcessPublic in ImageCreationStuff for testability. - Added file name sanitization in ImageCreatorSharp to prevent IO errors. - Enhanced WinForms UI: added "Open" buttons for source/destination folders, handled folder opening in Explorer, and improved user messaging and layout. - Updated solution file to include new benchmark project.
This commit is contained in:
parent
39b0904a72
commit
c2fd4bf780
17 changed files with 1608 additions and 301 deletions
134
run-benchmarks.sh
Normal file
134
run-benchmarks.sh
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Image Processing Benchmark Runner (Linux/Mac)
|
||||
# This script provides easy access to common benchmark scenarios
|
||||
|
||||
show_help() {
|
||||
cat << EOF
|
||||
Image Processing Benchmark Runner
|
||||
==================================
|
||||
|
||||
Usage: ./run-benchmarks.sh [scenario] [--fast] [--verbose]
|
||||
|
||||
Scenarios:
|
||||
all - Run all benchmarks (60-120 minutes)
|
||||
quick - Fast test run for development (5-10 minutes)
|
||||
parallel - Test parallel processing strategies (20-30 minutes)
|
||||
chunks - Optimize chunk size (20-30 minutes)
|
||||
sizes - Test different image sizes (45-90 minutes)
|
||||
stress - Large-scale stress test (2-4 hours)
|
||||
help - Show this help message
|
||||
|
||||
Flags:
|
||||
--fast - Use dry run for faster but less accurate results
|
||||
--verbose - Show detailed output
|
||||
|
||||
Examples:
|
||||
./run-benchmarks.sh quick
|
||||
./run-benchmarks.sh parallel --fast
|
||||
./run-benchmarks.sh stress --verbose
|
||||
|
||||
Results will be saved to: MaddoShared.Benchmarks/BenchmarkDotNet.Artifacts/results/
|
||||
EOF
|
||||
}
|
||||
|
||||
run_benchmark() {
|
||||
local filter=$1
|
||||
local description=$2
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo " $description"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
local args="-c Release"
|
||||
|
||||
if [ -n "$filter" ]; then
|
||||
args="$args -- --filter \"$filter\""
|
||||
fi
|
||||
|
||||
if [ "$fast_mode" = true ]; then
|
||||
args="$args --job dry"
|
||||
fi
|
||||
|
||||
if [ "$verbose_mode" = true ]; then
|
||||
args="$args --verbose"
|
||||
fi
|
||||
|
||||
cd MaddoShared.Benchmarks
|
||||
eval "dotnet run $args"
|
||||
cd ..
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
scenario="${1:-help}"
|
||||
fast_mode=false
|
||||
verbose_mode=false
|
||||
|
||||
shift
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--fast)
|
||||
fast_mode=true
|
||||
;;
|
||||
--verbose)
|
||||
verbose_mode=true
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Main execution
|
||||
case "$scenario" in
|
||||
help)
|
||||
show_help
|
||||
;;
|
||||
|
||||
all)
|
||||
echo "Running ALL benchmarks..."
|
||||
echo "This will take 60-120 minutes. Press Ctrl+C to cancel."
|
||||
echo ""
|
||||
sleep 3
|
||||
run_benchmark "" "All Benchmarks"
|
||||
;;
|
||||
|
||||
quick)
|
||||
echo "Running QUICK test..."
|
||||
run_benchmark "*ImageProcessingBenchmarks*" "Quick Development Test"
|
||||
;;
|
||||
|
||||
parallel)
|
||||
echo "Running PARALLEL processing benchmarks..."
|
||||
run_benchmark "*ImageProcessingBenchmarks*" "Parallel Processing Strategies"
|
||||
;;
|
||||
|
||||
chunks)
|
||||
echo "Running CHUNK SIZE optimization..."
|
||||
run_benchmark "*ChunkSizeBenchmarks*" "Chunk Size Optimization"
|
||||
;;
|
||||
|
||||
sizes)
|
||||
echo "Running IMAGE SIZE comparison..."
|
||||
run_benchmark "*ImageSizeBenchmarks*" "Image Size Impact Analysis"
|
||||
;;
|
||||
|
||||
stress)
|
||||
echo "Running STRESS TEST..."
|
||||
echo "WARNING: This will take 2-4 hours and use significant disk space!"
|
||||
echo "Press Ctrl+C within 5 seconds to cancel..."
|
||||
echo ""
|
||||
sleep 5
|
||||
run_benchmark "*StressTestBenchmark*" "Large-Scale Stress Test"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown scenario: $scenario"
|
||||
echo "Run './run-benchmarks.sh help' for usage information"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo "Benchmark execution complete!"
|
||||
echo "Results saved to: MaddoShared.Benchmarks/BenchmarkDotNet.Artifacts/results/"
|
||||
Loading…
Add table
Add a link
Reference in a new issue