In my project we had, 1 user defined default destructor, which was written to follow some coding standard requirements of the project. The Class of this destructor was instantiated more than 200 times, which had increased the overall response time, when this mentioned destructor was removed, I observed improvement in response time by 28 msec. Can anyone explain why this timing difference, though those were default destructors only but defined by users, which anyways will be called by the compiler.
With the usage of "user defined default destructor" I meant a destructor which is empty :
~Classname(){ };
Doing nothing, but is added to fulfill project's standards.
Just to add more clarity, this destructor doesn't fall in following categories:
1.Destructors declared as 'virtual'.
2.The destructors of static and singleton classes.
3.The destructors of the classes whose objects created using the 'new' keyword.
4.The destructors of the classes whose objects deleted using the 'delete' keyword.