in-memory cache: take owned values instead of borrowing #1417
Labels
c-cache
Affects the cache crate
m-breaking change
Breaks the public API.
t-refactor
Refactors APIs or code.
w-needs-more-docs
Needs more documentation before being worked on.
Taking an owned value instead of a borrowing means the cache doesn't have to clone data to construct it's cached models.
The advantage of this is no forced cloning of data but simply moving around owned data to avoid additional overhead. While minor at small scale, this can does add up with the amount of events per second that need to be processed goes up.
The disadvantage would be the caller has no ownership anymore so would be forced to clone it if they want to do anything with the event after the cache has been updated
The text was updated successfully, but these errors were encountered: