Feat: Add performance stress tests and documentation polish (P5)#444
Feat: Add performance stress tests and documentation polish (P5)#444
Conversation
Add performance/stress tests with 50 custom nodes covering add/persist, selectedNode lookup, mid-list removal, batch metadata update, and init timing. Update CLAUDE.md with multi-Mostro architecture section. Expand Phase 5 documentation in MULTI_MOSTRO_SUPPORT.md with implementation details and updated test coverage (74 total).
WalkthroughThis PR documents the completion of Phase 5 multi-Mostro instance support feature, adds comprehensive architectural documentation in CLAUDE.md describing node connection and management workflows, and introduces a new performance test suite with five stress tests validating large-scale node operations and persistence behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CLAUDE.md (1)
583-583:⚠️ Potential issue | 🟡 MinorStale "Last Updated" date.
This line still reads "October 8, 2025" but the file is being modified now (February 2026). Consider updating to the current date.
Proposed fix
-**Last Updated**: October 8, 2025 +**Last Updated**: February 11, 2026
🧹 Nitpick comments (2)
test/features/mostro/mostro_nodes_performance_test.dart (2)
158-192: Iteratingnotifier.statewhile mutating state — safe but subtle.The
for (final node in notifier.state)loop captures the list reference at iteration start. SinceupdateNodeMetadatareplacesstatewith a new list, the loop iterates the stale snapshot — which is fine here because you only readnode.pubkey. However, this subtlety could confuse future maintainers.Consider capturing the list explicitly for clarity:
Optional: make the snapshot explicit
- for (final node in notifier.state) { + final snapshot = List.of(notifier.state); + for (final node in snapshot) {
194-224: Timing assertion tests mocked I/O, not real SharedPreferences.The
< 1000msthreshold is a reasonable regression guard against algorithmic blowup, but sinceMockSharedPreferencesAsyncis backed by an in-memoryMap, it doesn't measure actual disk I/O latency. The test name and the docs (line 208 inMULTI_MOSTRO_SUPPORT.md: "Init with 50 pre-existing nodes completes promptly") could be slightly misleading. Worth noting in a comment that this validates algorithmic/parsing performance, not storage I/O.
mostronator
left a comment
There was a problem hiding this comment.
Clean Phase 5 completion! 👏
Performance tests:
- 5 stress tests with 50 nodes covering add/persist, lookup, mid-list removal, batch metadata, and init timing
makePubkey()helper is a nice pattern for deterministic test data- Init timing assertion (<1s) is a good safeguard against O(n²) regressions
- Persistence round-trip verification (create notifier1 → populate → create notifier2 → verify) is thorough
CLAUDE.md:
- Multi-Mostro architecture section is well-structured — covers all the key design decisions in bullet form
Docs:
- Phase 5 expanded with clear work item analysis table showing what was done where
- Test coverage summary updated (74 total)
LGTM! 🚀
AndreaDiazCorreia
left a comment
There was a problem hiding this comment.
LGTM, clean perf tests with good persistence round-trip coverage, docs look solid, ACK
Add performance/stress tests with 50 custom nodes covering add/persist, selectedNode lookup, mid-list removal, batch metadata update, and init timing. Update CLAUDE.md with multi-Mostro architecture section. Expand Phase 5 documentation in MULTI_MOSTRO_SUPPORT.md with implementation details and updated test coverage (74 total).
Summary by CodeRabbit
New Features
Documentation
Tests