in reply to Creating a Moose object and serializing it

I may sound like broken record for saying this since it is common advice, but it's good advice so I just have to ask. What is your specific performance issue with the if statement in question, and what profiler data do you have to back up that assertion?

Many optimization problems over which people agonize, plan, and scheme aren't really problems at all. If serialization is important, I can't imagine what performance degradation a simple conditional is causing that would be worth a bunch of extra code to do the serialization. I could see that degradation in a hot spot of the code, though, if a profiler actually showed it.

Replies are listed 'Best First'.
Re^2: Creating a Moose object and serializing it
by daverave (Scribe) on Oct 23, 2010 at 07:48 UTC
    I don't have any performance issues with the if. I didn't actually check it. I thought it would be more elegant to skip this check-every-time-the-method-is-invoked and I had no idea it will complicate things (it seemed quite simple).

    I might very well stay with the `if`, but now I'm curious in general as to how to do this stuff.