mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
perf(feed): optimize moderation stage with batch author lookups (perf-optimization-agent)
- Implement `getModerationInfoForAuthors` in `ModerationService` for batching. - Extract utility functions to `js/services/moderationUtils.js` to reduce `ModerationService` size. - Update `createModerationStage` to use batch lookup, reducing sequential overhead. - Benchmarks show ~50% improvement (454ms -> 227ms) for 5000 items. - All unit tests pass. - Task log: `docs/agents/task-logs/weekly/2026-02-22_01-25-01_perf-optimization-agent_completed.md` Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
e6e85ff845
commit
0ae813ea66
7 files changed
+856
-539
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# After Benchmark for Moderation Stage Batching
|
||||
|
||||
## Command
|
||||
`node benchmarks/moderation_batch_bench.js`
|
||||
|
||||
## Environment
|
||||
- Node.js v22.22.0
|
||||
- 5000 items
|
||||
- 500 authors
|
||||
- 100 muters per author
|
||||
- Forced prune check (lastPrunedAt = 0)
|
||||
|
||||
## Results
|
||||
- Run 1: 184.34ms
|
||||
- Run 2: 277.68ms
|
||||
- Run 3: 188.89ms
|
||||
- Run 4: 256.48ms
|
||||
- **Average: ~227ms**
|
||||
|
||||
## Comparison
|
||||
- Baseline: ~454ms
|
||||
- After: ~227ms
|
||||
- **Improvement: ~50% faster**
|
||||
Reference in new issue
Block a user