You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some methods (friend operators), we create a temporary inside the function which is never used again before returning. We assign our digits from these members' digits. These variables can be moved, but I'm not sure if the compiler is smart enough to use move semantics here. We might need to use std::move() on each one to gain the benefits of move semantics in these places, and if it avoids a copy then it will likely increase performance.
I have marked the places where I think this can be done in the linked commit. Not sure I caught all of them, there may be others in the math support header...
The text was updated successfully, but these errors were encountered:
FWIW, there is no performance benefit in moving a digit individually, but there is a potential performance benefit in moving the digits container itself, as that prevents a copy. When I build sharray (which I intend to use instead of vector), I should definitely include a move constructor and move-assignment operator.
In some methods (friend operators), we create a temporary inside the function which is never used again before returning. We assign our digits from these members' digits. These variables can be moved, but I'm not sure if the compiler is smart enough to use move semantics here. We might need to use
std::move()
on each one to gain the benefits of move semantics in these places, and if it avoids a copy then it will likely increase performance.I have marked the places where I think this can be done in the linked commit. Not sure I caught all of them, there may be others in the math support header...
The text was updated successfully, but these errors were encountered: