perf: parallelize computationally expensive block processing in pkgs/types/src/block.zig
- Dominant language
- Zig
- Stars
- 97
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
## Background
Raised as a follow-up suggestion by @anshalshukla in a review comment on #686 (devnet4):
> as a followup PR we can do parallel processing here something similar to how it can be done using rayon, this being a computationally expensive task.
See: https://github.com/blockblaz/zeam/pull/686#discussion_r3056196584
## Problem
Block processing in `pkgs/types/src/block.zig` is computationally expensive and currently runs serially. This is a bottleneck that could benefit from parallel execution.
## Proposed Solution
Introduce parallel processing for the expensive computation in `block.zig`, analogous to how [Rayon](https://docs.rs/rayon) enables data-parallelism in Rust. Options in Zig include:
- Using `std.Thread.Pool` / `std.Thread.spawn` for coarse-grained parallelism
- Splitting work items into chunks and processing in parallel worker threads
## Notes
- This is a performance improvement, not a correctness fix — low priority
- Needs benchmarking before and after to confirm wins
- Should not block devnet4 or any current PRs
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading pkgs/types/src/block.zig and identify the computationally expensive block-processing work that currently runs serially. Establish a benchmark before changing execution, then evaluate std.Thread.Pool or std.Thread.spawn and chunking options. Done means parallel processing is correct and benchmarks demonstrate a worthwhile improvement without blocking current work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- zig
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100