Skip to content

Conversation

@bittcrafter
Copy link
Collaborator

Performance Improvements:

  • Changed offline_messages from Vec to VecDeque for efficient FIFO operations
  • Replaced pop() with pop_front() for proper queue behavior in message processing
  • Used push_back() instead of push() for correct message ordering in storage

Structural Changes:

  • Added explicit VecDeque import for clarity
  • Updated OfflineInfo struct to use VecDeque for offline_messages
  • Maintained all existing functionality with improved performance

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. Ordering: Maintains message sequence during offline storage and retrieval

The changes ensure that offline messages are processed in the correct order while improving performance for queue operations, maintaining full backward compatibility.

Performance Improvements:
- Changed offline_messages from Vec to VecDeque for efficient FIFO operations
- Replaced pop() with pop_front() for proper queue behavior in message processing
- Used push_back() instead of push() for correct message ordering in storage

Structural Changes:
- Added explicit VecDeque import for clarity
- Updated OfflineInfo struct to use VecDeque for offline_messages
- Maintained all existing functionality with improved performance

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. **Ordering**: Maintains message sequence during offline storage and retrieval

The changes ensure that offline messages are processed in the correct order while improving performance for queue operations, maintaining full backward compatibility.
@bittcrafter bittcrafter merged commit f430b46 into rmqtt:master Aug 22, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant