PERF: FUTURE: Default default-constructor of SymmetricSecondRankTensor#4473
Conversation
|
I assume this PR is similar to the RGBPixel improvement with the goal of improving the performance of the Image::Allocate method. Perhaps this is a case there the optimization should go into the Allocate method. In SimpleITK and when interfacing with other libraries and buffers, the Image container buffer is considered a raw buffer. Perhaps if certain conditions, c++ traits or itk PixelTraits then a special optimization in this method could occur where the buffer is initialized as some type of raw buffer, then case to the component type. These initialized objects can be an insidious thing to track down as the behavior is not deterministic and varies with debug and release builds. So I have some concern with the proposed future changes. |
3e8ad23 to
0b2e0f2
Compare
Indeed, I have indeed seen huge ("future") performance improvements of TPixel pixel1; // May not be initialized.
TPixel pixel2{}; // Properly zero-initialized.
TPixel pixel3 = TPixel{}; // Properly initialized.
TPixel pixel4 = TPixel(); // Properly initialized.As I mentioned at #4469 (comment) Note that Slightly off-topic, I think it would help if |
Follow-up to pull request InsightSoftwareConsortium#4469 commit 755cd10 "PERF: FUTURE: Default default-constructors of `RGBPixel` and `RGBAPixel`"
0b2e0f2 to
e701c15
Compare
SymmetricSecondRankTensorSymmetricSecondRankTensor
Follow-up to pull request #4469 commit 755cd10
"PERF: FUTURE: Default default-constructors of
RGBPixelandRGBAPixel"