You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0762f00
Browse filesBrowse the repository at this point in the historyBrowse files
**Lightweight, attribute-driven DTOs for PHP 8.4+ — up to 37× faster hydration and serialization than the most popular alternative, zero reflection at runtime.**
11
+
**Lightweight, attribute-driven DTOs for PHP 8.4+ — up to 60× faster hydration and serialization than the most popular alternative, zero reflection at runtime.**
Benchmarked against **the most popular full-featured data-object library in the PHP/Laravel ecosystem** — identical DTO shapes, 20,000 iterations per scenario, PHP 8.4:
34
+
Benchmarked against **the most popular full-featured data-object library in the PHP/Laravel ecosystem** — identical DTO shapes, 20,000 iterations per scenario, PHP 8.4, inside a fully booted Laravel app (not a synthetic standalone script). Medians of 5 runs:
35
35
36
36
| Scenario | Simple Data Objects | Popular alternative | Advantage |
Absolute numbers vary with hardware; the ratios stay stable across runs. CPU time per operation follows the same ratios — less CPU burned per request means more headroom per server.
45
+
Absolute numbers vary with hardware; the ratios stay stable across runs. CPU time per operation follows the same ratios — less CPU burned per request means more headroom per server. Streaming a large import with `lazyCollection()` keeps memory flat regardless of row count — the win there is architectural (no full materialization), not a per-row memory difference from the alternative, which also streams comparably once both sides are measured on equal footing.
46
46
47
47
Don't take the numbers on faith — **[run the benchmarks yourself](https://github.com/std-out/simple-data-objects-benchmark)**: clone the companion repo, `make bench`, or swap in your own payload shapes.
48
48
@@ -147,7 +147,7 @@ Every worker then starts with opcache-compiled metadata **and** hydration/serial
147
147
148
148
```php
149
149
foreach (UserData::lazyCollection($csvRows) as $user) {
0 commit comments