-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differentiation of operations regarding operands' preservation #15
Comments
We could simply add more functions, having a If I understand things right, we will add functions which allocate new objects instead of altering old ones, right? From my understanding, this has only to be implemented for some functions:
And it also relates to the AVL implementation, as the AVL Tree needs features which allow to revert such changes. But, after reviewing the code again:
Or am I misunderstanding something? |
Relates to #12 |
The second operand will currently be unaffected in every case. For unios this may result in copying ever single item in that operand, which may be unneccessary. |
👍 How to? |
Same function, but with the last set-parameter being non-const and with some suffix ("_nc" for "Non Const")? |
Maybe "_d" for "destructive"? |
Maybe. |
👍 for consuming |
👍 |
I just relized that we have to differentiate whether an operation should preserve the previous operands or not.
Always preserving the operands of an operation has a huge performance impact, which we did not consider when defining the interface. (We're speaking O(log(n)) vs. O(n) for merges)
If we'd write the lib in C++, we would simply create overloads using move-semantics to differentiate both cases, but as the lib will be C-code, we should discuss how to represent non-preservative versions of the operations in our interface (e.g. as additional functions).
The text was updated successfully, but these errors were encountered: