Skip to content

Commit b654a70

Browse files
authored
Add PHP alternatives benchmark and reorganize benchmark folders (#46)
* Add PHP alternatives benchmark and reorganize benchmark folders - Compare against league/commonmark, parsedown, michelf/php-markdown - Add dev dependencies for benchmark alternatives - Update docs and path references
1 parent a991b9e commit b654a70

27 files changed

+1103
-194
lines changed

docs/performance.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,19 @@ All stress tests pass successfully:
160160

161161
```bash
162162
# Quick PHP benchmark
163-
php tests/performance/benchmark.php
163+
php tests/benchmark/benchmark.php
164164

165165
# Full benchmark with cross-language comparison
166-
./tests/performance/run-all.sh --compare
166+
./tests/benchmark/run-all.sh --compare
167167

168168
# Memory profiling
169-
php tests/performance/memory-profile.php --detailed
169+
php tests/benchmark/memory-profile.php --detailed
170170

171171
# Stress testing
172-
php tests/performance/stress-test.php
172+
php tests/benchmark/stress-test.php
173173

174174
# Generate HTML report
175-
php tests/performance/generate-report.php
175+
php tests/benchmark/generate-report.php
176176
```
177177

178178
## Key Takeaways

example.php

Lines changed: 0 additions & 169 deletions
This file was deleted.
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Comprehensive performance benchmarking suite for djot-php, including cross-langu
66

77
```bash
88
# Run PHP benchmarks only
9-
php tests/performance/benchmark.php
9+
php tests/benchmark/benchmark.php
1010

1111
# Run with cross-language comparison
12-
./tests/performance/run-all.sh --compare
12+
./tests/benchmark/run-all.sh --compare
1313

1414
# Quick benchmark (fewer iterations)
15-
./tests/performance/run-all.sh --quick
15+
./tests/benchmark/run-all.sh --quick
1616
```
1717

1818
## Benchmark Scripts
@@ -45,27 +45,27 @@ php tests/performance/benchmark.php
4545
### Basic PHP Benchmark
4646

4747
```bash
48-
php tests/performance/benchmark.php --iterations=100 --warmup=10
49-
php tests/performance/benchmark.php --json > results.json
48+
php tests/benchmark/benchmark.php --iterations=100 --warmup=10
49+
php tests/benchmark/benchmark.php --json > results.json
5050
```
5151

5252
### Memory Profiling
5353

5454
```bash
55-
php tests/performance/memory-profile.php
56-
php tests/performance/memory-profile.php --detailed
57-
php tests/performance/memory-profile.php --json
55+
php tests/benchmark/memory-profile.php
56+
php tests/benchmark/memory-profile.php --detailed
57+
php tests/benchmark/memory-profile.php --json
5858
```
5959

6060
### Stress Testing
6161

6262
```bash
6363
# Run all stress tests
64-
php tests/performance/stress-test.php
64+
php tests/benchmark/stress-test.php
6565

6666
# Run specific scenario
67-
php tests/performance/stress-test.php --scenario=pathological
68-
php tests/performance/stress-test.php --scenario=deep_nesting
67+
php tests/benchmark/stress-test.php --scenario=pathological
68+
php tests/benchmark/stress-test.php --scenario=deep_nesting
6969
```
7070

7171
Available scenarios:
@@ -83,7 +83,7 @@ Available scenarios:
8383

8484
```bash
8585
# Install JavaScript dependencies
86-
cd tests/performance && npm install
86+
cd tests/benchmark && npm install
8787

8888
# Run JavaScript benchmark
8989
node benchmark-js.mjs
@@ -102,10 +102,10 @@ node compare-languages.mjs
102102

103103
```bash
104104
# Generate from latest results
105-
php tests/performance/generate-report.php
105+
php tests/benchmark/generate-report.php
106106

107107
# Generate from specific results file
108-
php tests/performance/generate-report.php results/benchmark-*.json
108+
php tests/benchmark/generate-report.php results/benchmark-*.json
109109
```
110110

111111
## Output Formats
@@ -174,8 +174,8 @@ Add to your CI pipeline:
174174
```yaml
175175
- name: Run performance benchmarks
176176
run: |
177-
php tests/performance/benchmark.php --iterations=50 --json > benchmark.json
178-
php tests/performance/stress-test.php
177+
php tests/benchmark/benchmark.php --iterations=50 --json > benchmark.json
178+
php tests/benchmark/stress-test.php
179179
```
180180
181181
## Requirements
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* and complexity levels.
88
*
99
* Usage:
10-
* php tests/performance/benchmark.php [--iterations=100] [--warmup=10] [--json]
10+
* php tests/benchmark/benchmark.php [--iterations=100] [--warmup=10] [--json]
1111
*/
1212

1313
declare(strict_types=1);

0 commit comments

Comments
 (0)