perf(session): optimize offline message handling with VecDeque#259
Merged
bittcrafter merged 3 commits intormqtt:release/0.13.xfrom Aug 22, 2025
Merged
perf(session): optimize offline message handling with VecDeque#259bittcrafter merged 3 commits intormqtt:release/0.13.xfrom
bittcrafter merged 3 commits intormqtt:release/0.13.xfrom
Conversation
Version & Core: - Bumped workspace version from 0.13.3 to 0.13.4 Performance Improvements: - Changed offline_messages from Vec to VecDeque for efficient FIFO operations - Replaced pop() with pop_front() for proper queue behavior - Used push_back() instead of push() for correct queue ordering Key Benefits: 1. **Efficiency**: VecDeque provides O(1) amortized time for both ends 2. **Correctness**: Ensures proper first-in-first-out delivery of offline messages 3. **Memory**: Better memory utilization for queue operations 4. **Behavior**: Maintains message ordering during offline storage and retrieval The changes ensure that offline messages are processed in the correct order while improving performance for queue operations.
…row checking API Consistency: - Added explicit lifetime annotations to HTTP API Message::decode() - Added missing allow(dead_code) for AtomicFlags methods Type Safety: - Added lifetime parameter to last_will() return type in ConnectInfo - Added explicit lifetimes to plugin manager methods: * get() -> EntryRef<'_> * get_mut() -> EntryRefMut<'_> * iter() -> EntryIter<'_> Key Benefits: 1. **Clarity**: Makes lifetime relationships explicit in function signatures 2. **Safety**: Helps Rust compiler verify proper borrow checking rules 3. **Consistency**: Uniform lifetime annotation patterns across codebase 4. **Maintenance**: Reduces potential lifetime-related bugs The changes improve code robustness by making lifetime dependencies explicit without altering runtime behavior.
Code Simplification: - Removed unnecessary curly braces around `matches()` calls in all bridge implementations: * Kafka egress bridge * MQTT egress bridge * NATS egress bridge * Pulsar egress bridge * ReductStore egress bridge Pattern Matching Improvements: - Removed redundant `ref` patterns in Pulsar ingress bridge: * Simplified `RemoteProperties(name, ref placeholder)` → `RemoteProperties(name, placeholder)` * Simplified `RemotePayload(path, ref placeholder)` → `RemotePayload(path, placeholder)` * Removed unnecessary `ref` keyword for string parameters Key Benefits: 1. **Readability**: Cleaner, more idiomatic Rust code 2. **Performance**: Eliminates unnecessary scoping blocks 3. **Consistency**: Uniform pattern matching style across bridges 4. **Maintenance**: Reduced cognitive load for future changes The changes maintain identical functionality while improving code clarity and consistency across all bridge components.
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.
Version & Core:
Performance Improvements:
Key Benefits:
The changes ensure that offline messages are processed in the correct order while improving performance for queue operations.