π v2.0.36: Unify versions & docs for KotlinConf 2025-2026 submission #293
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
| # Performance Regression CI | ||
|
Check failure on line 1 in .github/workflows/performance.yml
|
||
| # Runs on every push/PR to detect performance regressions early | ||
| # Fails if thresholds are exceeded | ||
| name: Performance Regression | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| concurrency: | ||
| group: perf-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| performance-check: | ||
| name: Performance Regression Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
| cache: 'gradle' | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
| - name: Run Performance Benchmarks | ||
| id: benchmark | ||
| run: | | ||
| echo "π Running performance regression tests..." | ||
| ./gradlew :common:desktopTest \ | ||
| --tests "*PerformanceBenchmarkTest*" \ | ||
| --tests "*PerformanceRegressionTest*" \ | ||
| --no-daemon \ | ||
| --console=plain 2>&1 | tee benchmark-output.txt | ||
| - name: Check for Regressions | ||
| run: | | ||
| echo "π Checking for performance regressions..." | ||
| # Check if tests passed | ||
| if grep -q "BUILD SUCCESSFUL" benchmark-output.txt; then | ||
| echo "β All performance tests passed - no regressions detected" | ||
| echo "PERFORMANCE_STATUS=pass" >> $GITHUB_ENV | ||
| else | ||
| echo "β Performance regression detected!" | ||
| echo "PERFORMANCE_STATUS=fail" >> $GITHUB_ENV | ||
| exit 1 | ||
| fi | ||
| - name: Generate Performance Summary | ||
| if: always() | ||
| run: | | ||
| mkdir -p performance-results | ||
| cat <<EOF > performance-results/summary.md | ||
| # Performance Regression Report | ||
| **Commit:** \`${{ github.sha }}\` | ||
| **Branch:** \`${{ github.ref_name }}\` | ||
| **Date:** $(date -u +"%Y-%m-%d %H:%M UTC") | ||
| **Status:** ${{ env.PERFORMANCE_STATUS == 'pass' && 'β PASS' || 'β FAIL' }} | ||
| ## Thresholds | ||
| | Metric | Target | Status | | ||
| |--------|--------|--------| | ||
| | Full URL Analysis | <50ms | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| | P99 Latency | <50ms | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| | Heuristics Engine | <10ms | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| | ML Inference | <5ms | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| | Brand Detection | <15ms | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| | Throughput | >100 URLs/sec | ${{ env.PERFORMANCE_STATUS == 'pass' && 'β ' || 'β' }} | | ||
| ## Why This Matters | ||
| - **User Experience:** <50ms analysis enables real-time feedback during QR scanning | ||
| - **Battery Life:** Fast execution minimizes CPU time and energy consumption | ||
| - **Responsiveness:** No UI jank or delay during analysis | ||
| EOF | ||
| cat performance-results/summary.md | ||
| - name: Upload Performance Report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: performance-report | ||
| path: performance-results/ | ||
| retention-days: 30 | ||
| - name: Comment on PR | ||
| if: github.event_name == 'pull_request' && always() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| let report = '## π Performance Check\n\n'; | ||
| try { | ||
| report += fs.readFileSync('performance-results/summary.md', 'utf8'); | ||
| } catch (e) { | ||
| report += '${{ env.PERFORMANCE_STATUS == "pass" && "β All performance tests passed!" || "β Performance regression detected!" }}'; | ||
| } | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: report | ||
| }); | ||