Open
Conversation
Multi-process architecture with 8 workers using pcntl_fork, each parsing newline-aligned file chunks via fread 8MB buffers. Key optimizations: integer date keys (YYYYMMDD) for 57% faster hash lookups during merge, zero-copy leftover handling across buffers, 2x loop unrolling, reference-based merge, igbinary when available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
Benchmarking complete! Mean execution time: 7.88241270524s |
Replace nested hash tables with flat integer array for O(1) packed array access in each worker. Key changes: - Pre-computed slug->ID and date->ID mappings from Visit::all() - 8-char date keys (YY-MM-DD) for faster hash lookups - Comma search with fixed 52-char jump - Element-wise array addition merge (replaces nested hash merge) - ~30% faster parsing per worker + simpler merge phase Benchmarked: 1.4-2.0s on 10M rows (vs 2.5s before). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Children now serialize only non-zero count entries (~60K) instead of full flat array (880K entries), reducing temp file size ~14x and speeding up serialization, deserialization, and merge phases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
/bench |
Member
|
Benchmarking complete! Mean execution time: 4.5404760714s |
Member
|
Milliseconds were harmed in the making of this improvement. ⏱️ |
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.
Summary
pcntl_forkwith 8 workersTest plan
php tempest data:validatepasses/bench