Ownership (to avoid copying) #712
emil14
started this conversation in
Optimization
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When we want to change a message we always create a copy to avoid data races. However, for big messages that's a lot of performance overhead. It's possible in theory to introduce concept of "ownership/borrowing" and check if message is owned by one or more nodes. If so, then it's safe to mutate, otherwise a copy must be created.
This is different from Rust/FBP concept of ownership because there only one "node" may own a message. What we discuss here is just a property that can be used for optimiziation.
Idea that only one node may own message is interesting and could get us ability to mutate but is hard to implement without making programming harder which we must avoid. However, we're free to think about that too.
Beta Was this translation helpful? Give feedback.
All reactions