query()
performance
#1075
Replies: 1 comment
-
@felixhaeberle Can we close this in favor of #1009 to not have duplicate discussions? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
The current implementation of query operations, specifically the
get
,update
, anddelete
functions, relies on iterating over thebody
array to find a specific message based on its ID. This approach has a time complexity of O(n), where n represents the number of messages in the array.Proposal (Brainstorm)
Considering that the object structure (Resource / Message,...) cannot be changed because we want to prevent a breaking change, we could explore alternative strategies to enhance the performance of these operations within the given constraints. Here are a few suggestions, which come to my mind in general:
Indexing
Caching
Sorting
Partial Updates
Although these optimizations may introduce additional complexity, they could have the potential to significantly improve the performance of message operations without modifying the underlying object structure — but as I said, we need to observe the impact of those changes and if the resources are well spend here.
Beta Was this translation helpful? Give feedback.
All reactions