I am writing an application that should be very fast. I am using Qt 5.5 with Qt Creator, the 64-bit MSVC2013 compiled version of Qt.
I used very sleepy CS to profile my application, and I saw that the function that took the most exclusive time was the + = overload operator (which is called, as you assume, many times).
Here is a snippet of code.
struct Coordinate
{
float x;
float y;
Coordinate operator+=(const Coordinate &coord)
{
this->x += coord.x;
this->y += coord.y;
return (*this);
}
};
I wondered if there is a way to improve the performance of such a simple function like this.
source
share