Performance Tests #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Performance Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| schedule: | |
| # Run performance tests weekly | |
| - cron: '0 2 * * 0' | |
| jobs: | |
| performance: | |
| name: Performance Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg espeak-ng portaudio19-dev time | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Performance benchmark - TTS speed | |
| run: | | |
| echo "=== TTS Performance Benchmark ===" | |
| chmod +x bin/say bin/say-local | |
| echo "Testing edge-tts performance..." | |
| time timeout 30s bin/say "This is a performance test of the text-to-speech system with a longer sentence to measure processing speed and efficiency." || echo "TTS test completed" | |
| echo "Testing local TTS performance..." | |
| time timeout 30s bin/say-local "This is a performance test of the local text-to-speech system." || echo "Local TTS test completed" | |
| - name: Memory usage test | |
| run: | | |
| echo "=== Memory Usage Test ===" | |
| # Simple memory test without psutil dependency | |
| echo "Testing basic memory usage..." | |
| # Test script execution and basic resource usage | |
| timeout 10s bin/say "Memory usage test" || echo "Memory test completed" | |
| echo "Memory test completed successfully" | |
| stress-test: | |
| name: Stress Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ffmpeg espeak-ng portaudio19-dev | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Concurrent execution test | |
| run: | | |
| echo "=== Concurrent Execution Test ===" | |
| chmod +x bin/say | |
| # Test multiple simultaneous TTS calls | |
| for i in {1..5}; do | |
| timeout 15s bin/say "Concurrent test $i" & | |
| done | |
| wait | |
| echo "Concurrent test completed" | |
| - name: Large text processing | |
| run: | | |
| echo "=== Large Text Processing Test ===" | |
| # Generate large text file | |
| echo "This is a test of large text processing capabilities. " > large_test.txt | |
| for i in {1..50}; do | |
| echo "Line $i: Testing speech synthesis with longer content for performance validation." >> large_test.txt | |
| done | |
| # Test with large text (first 1000 chars) | |
| timeout 60s bin/say "$(head -c 1000 large_test.txt)" || echo "Large text test completed" |