-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
PERF: Remove SystemInformation data from ResourceProbe, fix issue #350 #351
PERF: Remove SystemInformation data from ResourceProbe, fix issue #350 #351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good to me. I don't know whether anyone used GetSystemInformation
via this class instead of directly, but even if they did the remedy would not be hard. It should be documented in ITK5 MigrationGuide document.
Interestingly, Mac build fails with this incomprehensible message:
Undefined symbols for architecture x86_64:
"___cxa_deleted_virtual", referenced from:
vtable for itk::MemoryProbe in itkMemoryProbe.cxx.o
vtable for itk::ResourceProbe<unsigned long, double> in itkMemoryProbe.cxx.o
vtable for itk::TimeProbe in itkTimeProbe.cxx.o
vtable for itk::ResourceProbe<double, double> in itkTimeProbe.cxx.o
ld: symbol(s) not found for architecture x86_64
The other build have not finished as of now.
@dzenanz Thanks! It looks like Mac doesn't like the way I "deleted"
It could be a compiler bug, because I think my code is fine P.S. Note that |
I think it would be better if you properly deprecated it. |
Thanks @dzenanz I'll make it a deprecated member function that does completely nothing. (It did not return anything anyway.) PS I hope it will then eventually be removed with ITK 5.1. (It does not seem useful to keep a |
ITK 4.9 added system info to `itk::ResourceProbe` (the base class of `itk::TimeProbe` and `itk::MemoryProbe`), by calling `GetSystemInformation()` in its constructor. This function call appeared very time consuming. Using Visual Studio 2017 (Release configuration), it was observed that a single `GetSystemInformation()` function call took more than 0.1 second. This commit removes the `this->GetSystemInformation()` function call from ResourceProbe, deprecates the member function, removes the related data members, and only retrieves the system info when and where it is actually being used: in `PrintSystemInformation` and `PrintJSONSystemInformation`. Fixes issue #350, "Major performance issue TimeProbe, ResourceProbe constructor", which was based on the analysis of an `elastix` example case by Theo van Walsum (@tvanwalsum).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a great cleanup.
Follow-up to: "PERF: Remove SystemInformation data from ResourceProbe, fix issue InsightSoftwareConsortium#350" Pull request InsightSoftwareConsortium#351 Commit 747f3d1, 2018-12-24
Follow-up to: "PERF: Remove SystemInformation data from ResourceProbe, fix issue InsightSoftwareConsortium#350" Pull request InsightSoftwareConsortium#351 Commit 747f3d1, 2018-12-24
Follow-up to: "PERF: Remove SystemInformation data from ResourceProbe, fix issue InsightSoftwareConsortium#350" Pull request InsightSoftwareConsortium#351 Commit 747f3d1, 2018-12-24
Follow-up to: "PERF: Remove SystemInformation data from ResourceProbe, fix issue InsightSoftwareConsortium#350" Pull request InsightSoftwareConsortium#351 Commit 747f3d1, 2018-12-24
ITK 4.9 added system info to
itk::ResourceProbe
(the base class ofitk::TimeProbe
anditk::MemoryProbe
), by callingGetSystemInformation()
in its constructor. This function call appeared very time consuming.
Using Visual Studio 2017 (Release configuration), it was observed that a single
GetSystemInformation()
function call took more than 0.1 second.This commit removes the
this->GetSystemInformation()
function call fromResourceProbe, deprecates the member function, removes the related data
members, and only retrieves the system info when and where it is actually being
used: in
PrintSystemInformation
andPrintJSONSystemInformation
.Fixes issue #350, "Major performance issue TimeProbe, ResourceProbe
constructor", which was based on the analysis of an
elastix
examplecase by Theo van Walsum (@tvanwalsum).