in reply to Re: 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'?
Thank you, BrowserUk.
So this question depends on how much overhead or cost to create an object.
My benchmark shows 'reusing obj' is more efficient than 'creating new one' no matter complicated obj or simple obj, which is reasonable to me.
So for general, can we claim it is 'the best practice' to always reuse object instead of to create new one?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?
by davido (Cardinal) on Jan 11, 2016 at 18:06 UTC | |
by khandielas (Sexton) on Jan 11, 2016 at 18:28 UTC | |
|
Re^3: Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?
by Corion (Patriarch) on Jan 11, 2016 at 17:13 UTC | |
|
Re^3: Is there any Performance difference between 'Create new object' vs 'reset value and reuse object'?
by hotchiwawa (Scribe) on Jan 11, 2016 at 19:19 UTC |