Merged
Conversation
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.
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.