in reply to Re^3: Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?
in thread Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?

Thanks, Dave.

That is exactly what I mean. I think it is good to create a method to partially reset the values/properties so that this object can be reused properly. So basically the code will be like below:

my $obj = myClass->new(); while ( ... ) { $obj->reset(); $obj->otherMethods(); .... } $obj->cleanup(); #Instead of while( ... ) { my $obj = myClass-<new(); $obj->otherMethods(); }
  • Comment on Re^4: Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?
  • Download Code