Feature: Don't clone values by default when retrieving values #26
Labels
feature
New feature or request
help wanted
Extra attention is needed
topic:performance
Improvements to database performance
Is your feature request related to a problem?
When fetching nested fields, array values, and remote records, we are currently cloning all values which are fetched. This has an impact on performance.
Describe the solution
Instead of using
clone()
by default when we are fetching or comparing fields , we should returnCow<'a, Value>
values, resulting in a value only being cloned when it needs to be updated / written to.We would also need to ensure that all
Value
types are based onCow<'a, Value>
values, as opposed to ownedValue
values.So the following:
would become:
In addition,
compute()
functions would need to returnCow<'a, Value>
values.Alternative methods
Currently the functionality works without modification, but query performance will be significantly improved when this change is made.
SurrealDB version
surreal 1.0.0-beta.5 for macos on aarch64
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: