Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
236b8f1
[TASK]: Require PHP 8.5 only, drop support for PHP 8.1-8.4
CybotTM Dec 29, 2025
23982e7
[TASK]: Add Rector and apply PHP 8.5 code modernization
CybotTM Dec 29, 2025
b3fa334
[TASK]: Apply first-class callable syntax
CybotTM Dec 29, 2025
38ae568
[TASK]: Apply PHP 8.3+ modernizations
CybotTM Dec 29, 2025
c27c90c
[TASK] replace is_null() with strict null comparison
CybotTM Dec 29, 2025
a3d1a09
[TASK] add PropertyHookRector rule for PHP 8.4 property hooks
CybotTM Dec 29, 2025
1904380
[TASK] apply PHP 8.x modernization patterns
CybotTM Dec 29, 2025
2bf0026
[TASK] add #[\Override] attributes to overriding methods
CybotTM Dec 29, 2025
15b5bd5
[TASK] apply PHP 8.x modernization patterns
CybotTM Dec 29, 2025
0e47404
[TASK]: Upgrade all major dependencies to latest versions
CybotTM Dec 29, 2025
7743d72
[TASK] update dependencies to latest patch/minor versions
CybotTM Jan 5, 2026
debd54c
[FEATURE] upgrade to Symfony 8
CybotTM Jan 5, 2026
6d84c3d
[TASK] add inventory caching for 53% render time improvement
CybotTM Dec 29, 2025
da5d4fa
[TASK] add Twig template caching and parallel loading support
CybotTM Dec 29, 2025
fe81033
[TASK] add AST caching for parsed documents
CybotTM Dec 29, 2025
bc72a07
[TASK] comprehensive rendering performance optimization
CybotTM Dec 30, 2025
b9640ca
[TASK] enable OPcache CLI in Docker container
CybotTM Dec 30, 2025
2410645
[FEATURE] Add cache infrastructure for incremental rendering
CybotTM Dec 31, 2025
fed3743
[FEATURE] Add compiler passes for export and dependency tracking
CybotTM Dec 31, 2025
de731cf
[FEATURE] Add incremental rendering with skip-unchanged logic
CybotTM Dec 31, 2025
dd7162e
[FEATURE] Register incremental rendering services in DI
CybotTM Dec 31, 2025
2d84253
[TASK] Ignore *-temp/ directories in git
CybotTM Dec 31, 2025
484d547
[TASK] Extend DocumentExports with document title and target data
CybotTM Jan 1, 2026
87ed0ae
[TASK] Collect full InternalTarget data in ExportsCollectorPass
CybotTM Jan 1, 2026
8a91817
[FEATURE] Skip parsing unchanged files in incremental builds
CybotTM Jan 1, 2026
c5e3b8d
[TASK] Parallelize localization rendering for better performance
CybotTM Jan 1, 2026
c3ed8b4
[TASK] Add composer-normalize to pre-commit workflow
CybotTM Jan 1, 2026
f7104c4
[FEATURE] Add parallel rendering infrastructure for document processing
CybotTM Jan 1, 2026
8e475c9
[TASK] Add RST parsing optimization patches
CybotTM Jan 3, 2026
d70a02b
[TASK] Configure composer patches for RST parsing optimizations
CybotTM Jan 3, 2026
35e8d55
[TASK] Apply RST parsing patches in Docker build
CybotTM Jan 3, 2026
5c368fd
[FEATURE] Add ForkingRenderer for parallel HTML rendering
CybotTM Jan 3, 2026
17fa4f1
[TASK] Add profiling and parallel parsing infrastructure
CybotTM Jan 3, 2026
59719d5
[TASK] Add additional regex caching patches
CybotTM Jan 3, 2026
b52728e
[TASK] Add parallel compilation infrastructure
CybotTM Jan 3, 2026
7bb6628
[TASK] Wire parallel parsing and rendering handlers
CybotTM Jan 3, 2026
7acc9ff
[FEATURE] wire --parallel-workers CLI option to ForkingRenderer
CybotTM Jan 5, 2026
9e0a976
[FEATURE] add shared utilities for parallel processing
CybotTM Jan 5, 2026
d836b78
[TASK] use shared utilities in parallel processing classes
CybotTM Jan 5, 2026
9bd3435
[TASK] add performance benchmark infrastructure for testing optimizat…
CybotTM Dec 31, 2025
58590e8
[DOCS] add performance report and rendered documentation
CybotTM Jan 4, 2026
85d2fdd
[BUGFIX] Wire IncrementalBuildCache to ParallelCompileDocumentsHandler
CybotTM Jan 8, 2026
f8a6f02
[DOCS] Update performance report with working incremental rendering r…
CybotTM Jan 8, 2026
f009bf3
[DOCS] Add comprehensive incremental build benchmarks for all documen…
CybotTM Jan 8, 2026
adcac52
[DOCS] Add file counts and memory usage to incremental build report
CybotTM Jan 8, 2026
6871052
[BUGFIX] Fix dependency cascade in incremental rendering
CybotTM Jan 8, 2026
f87dee5
[DOCS] Fix memory and cascade metrics in performance report
CybotTM Jan 8, 2026
9300ab8
[DOCS] Update all memory figures to total system memory
CybotTM Jan 8, 2026
fdb48ab
perf: optimize DependencyGraph to O(V+E) complexity
CybotTM Jan 8, 2026
60bf81b
perf: add cache sharding and optimize merge phase deduplication
CybotTM Jan 8, 2026
4c1e658
fix: resolve PHPStan type errors in cache and renderer classes
CybotTM Jan 8, 2026
ad2dfe7
docs: update performance report with new benchmark results
CybotTM Jan 9, 2026
b29779d
chore: ignore benchmark result JSON files
CybotTM Jan 9, 2026
8da39d6
test: add CrossRefs test documents for dependency cascade testing
CybotTM Jan 9, 2026
84e8b6a
feat: add cascade benchmark scenario for dependency re-rendering
CybotTM Jan 9, 2026
3c4ecba
docs: sync patches with upstream PRs and add PR status
CybotTM Jan 22, 2026
1873781
docs: restructure upstream contributions section
CybotTM Jan 22, 2026
01fefad
docs: add PR #1292 (project-node-cache) to upstream contributions
CybotTM Jan 22, 2026
c065d1e
feat: add new patches from upstream PRs
CybotTM Jan 23, 2026
d64f4c3
fix: sync patches with upstream PR diffs
CybotTM Jan 23, 2026
e31f8e7
chore: update composer patch config and regenerate lock files
CybotTM Jan 23, 2026
aceec9e
docs: update upstream PR references in performance report
CybotTM Jan 23, 2026
15a95ff
Update performance report with Phase 2 upstream PRs
CybotTM Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: render-guides
type: php
docroot: Documentation-GENERATED-temp
php_version: "8.1"
php_version: "8.5"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand All @@ -24,7 +24,7 @@ nodejs_version: "18"

# docroot: <relative_path> # Relative path to the directory containing index.php.

# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
# php_version: "8.5" # PHP version to use, "8.1", "8.2", "8.3", "8.4", "8.5"

# You can explicitly specify the webimage but this
# is not recommended, as the images are often closely tied to DDEV's' behavior,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on: # yamllint disable-line rule:truthy
name: "Test Dockerfile"

env:
DEFAULT_PHP_VERSION: "8.1"
DEFAULT_PHP_VERSION: "8.5"
RUN_ENVIRONMENT: "local"

jobs:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy
- "main"

env:
DEFAULT_PHP_VERSION: "8.1"
DEFAULT_PHP_VERSION: "8.5"
RUN_ENVIRONMENT: "local"

jobs:
Expand All @@ -18,10 +18,7 @@ jobs:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
/Documentation-GENERATED-*
/.phpdoc/
/phpdoc.dist.xml
*-temp/

# Benchmark test documentation (downloaded on demand)
/benchmark/test-docs/
!/benchmark/test-docs/.gitkeep

# Benchmark results (environment-specific, accumulate over time)
benchmark/results/*.json
163 changes: 163 additions & 0 deletions BENCHMARK_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Performance Benchmark Plan

## Objective

Measure and document the performance improvements from incremental rendering, providing concrete numbers for the PR.

## Metrics to Measure

1. **Render Time** (seconds)
2. **Peak Memory Usage** (MB)
3. **Files Processed** (count)
4. **Files Skipped** (incremental only)

## Test Scenarios

| Scenario | Description | Expected Improvement |
|----------|-------------|---------------------|
| Cold Render | First render, no cache | Baseline (similar) |
| Warm Render | Re-render, no changes | Major (skip all) |
| Partial Change | 1-2 files modified | Significant (skip most) |
| Config Change | guides.xml modified | None (full re-render) |

## Test Documentation Projects

1. **Small**: `Documentation/` (14 files) - quick validation
2. **Medium**: `Documentation-rendertest/` (~50 files) - included in repo
3. **Large**: External TYPO3 docs (e.g., reference-coreapi) - real-world test

## Implementation Options

### Option A: Standalone Benchmark Script
```bash
./benchmark.sh [branch] [scenario]
```
- Simple bash script with `time` and memory tracking
- Runs in Docker for reproducibility
- Outputs CSV/JSON for comparison

### Option B: PHPUnit Performance Tests
- `@group benchmark` tests
- Use PHPUnit's `assertLessThan` for regression detection
- Integrated with CI (can be slow)

### Option C: Makefile Targets
```make
make benchmark-cold
make benchmark-warm
make benchmark-compare
```
- Uses existing Docker setup
- Easy to run manually
- Outputs formatted report

## Recommended Approach: Hybrid (A + C)

1. **Makefile targets** for easy execution
2. **Bash script** for actual measurement logic
3. **Docker container** for reproducibility
4. **JSON output** for programmatic comparison
5. **Markdown report** for PR documentation

## Benchmark Script Design

```
benchmark/
β”œβ”€β”€ run-benchmark.sh # Main benchmark runner
β”œβ”€β”€ compare-branches.sh # Compare main vs feature
β”œβ”€β”€ scenarios/
β”‚ β”œβ”€β”€ cold.sh # Cold render scenario
β”‚ β”œβ”€β”€ warm.sh # Warm render (re-run)
β”‚ └── partial.sh # Modify file, re-render
└── results/
└── .gitkeep
```

## Measurements Approach

### Time Measurement
```bash
/usr/bin/time -v ./vendor/bin/guides ... 2>&1
# Extract: "Elapsed (wall clock) time"
```

### Memory Measurement
```bash
# From /usr/bin/time -v output:
# "Maximum resident set size (kbytes)"
```

### PHP-level Metrics
```php
$start = hrtime(true);
// ... render ...
$elapsed = (hrtime(true) - $start) / 1e9;
$memory = memory_get_peak_usage(true);
```

## Output Format

### JSON (machine-readable)
```json
{
"branch": "feature/php-8.5-only",
"scenario": "warm",
"project": "Documentation-rendertest",
"metrics": {
"time_seconds": 2.34,
"memory_mb": 128.5,
"files_total": 51,
"files_rendered": 0,
"files_skipped": 51
}
}
```

### Markdown (for PR)
```markdown
| Scenario | main | feature | Improvement |
|----------|------|---------|-------------|
| Cold | 5.2s | 5.1s | ~2% |
| Warm | 5.2s | 0.8s | 85% |
| Partial | 5.2s | 1.2s | 77% |
```

## Execution Plan

### Phase 1: Create Benchmark Infrastructure
- [ ] Create `benchmark/run-benchmark.sh`
- [ ] Add Makefile targets
- [ ] Test with local Documentation/

### Phase 2: Measure Current Branch
- [ ] Run cold/warm/partial scenarios
- [ ] Record results in JSON

### Phase 3: Compare with Main
- [ ] Checkout main, run same scenarios
- [ ] Generate comparison report

### Phase 4: Add to PR
- [ ] Include benchmark results in PR description
- [ ] Add benchmark scripts to repo (optional)

## Docker Command Template

```bash
docker run --rm \
-v $(pwd):/project \
-w /project \
ghcr.io/typo3-documentation/render-guides:latest \
/usr/bin/time -v \
./vendor/bin/guides \
--no-progress \
--output=/tmp/output \
Documentation-rendertest
```

## Notes

- Run multiple times (3-5) and average for accuracy
- Clear caches between cold runs
- Use same hardware/container for fair comparison
- Document system specs in results
30 changes: 26 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
FROM php:8.1-cli-alpine AS builder
FROM php:8.5-cli-alpine AS builder

COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN apk add --update $PHPIZE_DEPS
RUN apk add --update $PHPIZE_DEPS patch git
RUN pie install arnaud-lb/inotify && docker-php-ext-install pcntl

WORKDIR /opt/guides
COPY . /opt/guides

RUN composer install --no-dev --no-interaction --no-progress \
RUN composer install --no-dev --no-interaction --no-progress \
--no-suggest --optimize-autoloader --classmap-authoritative

FROM php:8.1-cli-alpine
# Apply performance patches for guides-restructured-text
# Use --forward to skip already-applied hunks, --reject-file=/dev/null to suppress reject files
RUN cd /opt/guides/vendor/phpdocumentor/guides-restructured-text && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/inline-parser-lexer-reuse.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/line-checker-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/buffer-unindent-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/inline-lexer-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/field-list-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/directive-rule-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/enumerated-list-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/link-rule-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/grid-table-rule-regex-cache.patch || true && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/simple-table-rule-regex-cache.patch || true

# Apply performance patches for guides
RUN cd /opt/guides/vendor/phpdocumentor/guides && \
patch -p1 --forward --reject-file=/dev/null < /opt/guides/patches/external-reference-resolver-cache.patch || true

FROM php:8.5-cli-alpine

COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie
RUN apk add --update $PHPIZE_DEPS
RUN pie install arnaud-lb/inotify && docker-php-ext-install pcntl

# Install GNU time for benchmarking (busybox time doesn't support -v)
RUN apk add --no-cache time
RUN apk del $PHPIZE_DEPS && rm -rf /var/cache/apk/* /tmp/* /usr/share/php/* /usr/local/lib/php/doc/* /usr/local/lib/php/test/*

COPY . /opt/guides
Expand All @@ -26,6 +46,8 @@ WORKDIR /opt/guides
COPY --from=builder /opt/guides/vendor /opt/guides/vendor
RUN echo "memory_limit=4G" >> /usr/local/etc/php/conf.d/typo3.ini
RUN echo "error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT" >> /usr/local/etc/php/conf.d/typo3.ini
RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/typo3.ini
RUN echo "opcache.interned_strings_buffer=16" >> /usr/local/etc/php/conf.d/typo3.ini

ARG TYPO3AZUREEDGEURIVERSION
ENV TYPO3AZUREEDGEURIVERSION=$TYPO3AZUREEDGEURIVERSION
Expand Down
Loading
Loading