Skip to content

Refactor for PHP 8.4 and above#36

Merged
hyperized merged 22 commits intomasterfrom
refactor/architecture-overhaul
Apr 11, 2026
Merged

Refactor for PHP 8.4 and above#36
hyperized merged 22 commits intomasterfrom
refactor/architecture-overhaul

Conversation

@hyperized
Copy link
Copy Markdown
Owner

No description provided.

Upgrade to PHP-DI 7, Symfony 7, adbario 3. Add PHPStan (level 8),
PHP-CS-Fixer (PER-CS2.0), and GitHub Actions CI workflow.
Typed properties, constructor promotion, strict_types, readonly.
Replace opendir/readdir with RecursiveDirectoryIterator. Update
Symfony 7 FileLoader signatures. Remove Table and Visual classes.
Readonly DTOs implementing JsonSerializable for PHP, CPU, Disk,
MySQL, and aggregate BenchmarkResult.
Modules no longer render output. Each implements BenchmarkModuleInterface
with isEnabled() and a typed run() method. Add OutputMode enum for
CLI/HTML detection.
CliRenderer with ANSI colors and Unicode box-drawing tables.
HtmlRenderer with standalone styled HTML dashboard and responsive
CSS grid layout.
Save timestamped JSON reports to reports/ on each benchmark run.
Benchmark.php orchestrates modules, builds results, saves reports,
and dispatches to the appropriate renderer. Auto-detects output mode
from SAPI with config override support.
Document output modes, report system, and configuration options.
Tests allocation speed for array fill, array sort, string concat,
object creation, array map, and array merge. Reports both execution
time and peak memory usage per operation.
@hyperized hyperized self-assigned this Apr 11, 2026
Use memory_reset_peak_usage() and memory_get_peak_usage() instead
of memory_get_usage(true) which reports OS-level allocations in
large chunks and misses reused memory.
Network: DNS resolution and TCP connection latency to configurable hosts.
JSON: encode/decode across small, medium, and large payloads.
Regex: match and replace across 10 pattern types.
File Read: sequential reads across 1KB to 4MB file sizes.
…head, Type Casting, Autoloading, and Compression
…ng, Object Instantiation, and Compression modules

Serialization: serialize vs json_encode vs var_export, with igbinary/msgpack if available.
Hashing: md5, sha1, sha256, sha512, xxh3, crc32, hmac-sha256, bcrypt, argon2id.
Encryption: AES-128/256-CBC/GCM, ChaCha20-Poly1305 encrypt and decrypt.
Function Overhead: named function, closure, first-class callable, static/instance method, arrow function.
Type Casting: int/string/float/bool conversions and intval().
Object Instantiation: stdClass, DateTime, DateTimeImmutable, SplStack, SplPriorityQueue, ArrayObject.
Compression: gzip, zlib, deflate with brotli/lzf if available. Reports time and compression ratio.
Also reduces network connection timeout from 5s to 2s.
Shows [1/15] Running Module... on a single updating line so the user
knows work is in progress. Clears the line before rendering results.
Only displayed in CLI mode.
@hyperized hyperized merged commit 97712eb into master Apr 11, 2026
2 checks passed
@hyperized hyperized deleted the refactor/architecture-overhaul branch April 11, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant