Use copy_construct() instead of two set() call for rectangle assign()#13
Use copy_construct() instead of two set() call for rectangle assign()#13plopresti wants to merge 1 commit intoboostorg:developfrom
Conversation
…gn(). This produces significantly better code when the rectangle representation is an immutable pair of points (lower left / upper right); e.g. SSE vectors. And there is no cost in speed for the normal case, since modern compilers are very good at copy elision.
|
I realize my justification for this is basically "trust me". But trust me, this is a good change... OK OK. What would you like to see for justification? Thanks. |
|
Hi, I am on vacation right now. I am going to look at the changes on On Jul 15, 2016 7:44 PM, "plopresti" notifications@github.com wrote:
|
|
Thanks for your contribution! However it doesn't seem that this pull request solves any problem. That's why I am reluctant to merge it, cause there is no active development on the library and any such small changes potentially can break the existing functionality. |
|
I understand. Still, this makes a big performance difference in my application... What if I create a patch that preserves the existing behavior by default, but allows me to override the implementation? (I am thinking of changing y_r_assign to a template class and having it default to "true"; then I can specialize it to provide a more efficient "assign" function for my own class.) If this sounds vaguely acceptable, I will work up a pull request. Thanks. |
This produces significantly better code when the rectangle representation is an immutable pair of points (lower left / upper right); e.g. SSE vectors. And there is no cost in speed for the normal case, since modern compilers are very good at copy elision.