Releases: moonwalker/bedrock
Releases · moonwalker/bedrock
v0.3.5
v0.3.4
use variant url
v0.3.3
v0.3.2 - Adaptive Batching
Performance and Reliability Improvements
Adaptive Batching Strategy
Replaced single large fetch with intelligent batching approach:
- Batch size: 5,000 messages per batch
- Adaptive timeout: Scales with batch size (batch_size/20 ms, minimum 100ms)
- Smart termination: Stops when server returns ErrNoMessages
Performance Results
Small streams (15k messages):
- v0.3.0/v0.3.1: 1-2s
- v0.3.2: ~750ms → 2-3x faster ⚡
Medium streams (65k messages):
- v0.3.0/v0.3.1: 1-2s (inconsistent)
- v0.3.2: ~3.3s → Consistent and reliable ✅
Large streams (200k messages):
- v0.3.0/v0.3.1: Timeouts or incomplete results
- v0.3.2: ~10s → Handles correctly ✅
Fixes
- ❌ v0.3.1 bug fixed:
invalid argument: batch size must be at least 1error when NumPending was 0 - ✅ Race condition eliminated: No longer uses NumPending approach that caused inconsistent results
- ✅ Consistency guaranteed: Timeout per batch ensures server completes gathering
- ✅ Scales correctly: Time proportional to actual data size
Dependencies
Updated all dependencies to latest versions:
- AWS SDK v2: v1.32.5 → v1.40.1
- imroc/req: v3.48.0 → v3.56.0
- Ginkgo: v2.20.2 → v2.27.2
- And more...
Migration from v0.3.1
If you're on v0.3.1: Upgrade immediately - it has a critical bug causing batch size must be at least 1 errors
Recommended version: v0.3.2 (this release) for both performance and reliability
v0.3.1 - Performance Optimization
Performance Improvements
LastPerSubject Optimization
- 19.42x faster execution using NumPending approach
- Eliminates arbitrary timeout waits by checking exact message count
- Uses ConsumerInfo NumPending + FetchNoWait for optimal performance
- Maintains 100% consistency across all runs
Technical Changes
- Reuse context instead of creating multiple context.Background instances
- Reduced InactiveThreshold from 5s to 1s for faster ephemeral consumer cleanup
- Removed old timeout-based implementation
Benchmark Results
- Old method: ~1s per call (timeout-based)
- New method: ~50ms per call (NumPending-based)
- 5/5 runs consistently return identical results
v0.3.0 - NATS Upgrade & Performance Improvements
🚀 Features
- Upgrade nats.go to v1.47.0 (from v1.37.0) for latest performance improvements
- Optimize for consistent results with
⚡ Performance Improvements
- Fix inconsistency by using with timeout instead of
- Use ephemeral consumer with for automatic cleanup
- Reduce timeout from 30s to 1s for faster operation
- Remove unnecessary consumer config (, )
- Add consistency testing with 5 runs to verify reliable results
📦 Dependencies Updated
nats.go: v1.37.0 → v1.47.0nkeys: v0.4.7 → v0.4.12klauspost/compress: v1.17.9 → v1.18.2golang.org/x/crypto: v0.29.0 → v0.45.0golang.org/x/net: v0.31.0 → v0.47.0golang.org/x/sys: v0.27.0 → v0.38.0
✅ Backward Compatibility
No breaking changes - all APIs maintain backward compatibility. Existing code will work without modifications.
🔗 Full Changelog
Upload video minus debug code
v0.2.33