in reply to Re: Re: Re: Optimizing away calls to functions defined in eval
in thread Optimizing away calls to functions defined in eval

I've got a slightly more complex structure than that.

I've got my main script. It's brings in Foo. Foo inherits from Bar. Within Bar lives define_attributes(), which creates the attributes and accessor functions. Foo calls Foo->define_attributes() with the attributes it wants to define.

Now, everything works just fine (without things like BEGIN, etc). I wanted to find out if there was a way I could optimize away the function calls while still being able to define them on-the-fly.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

  • Comment on Re4: Optimizing away calls to functions defined in eval

Replies are listed 'Best First'.
Re: Re4: Optimizing away calls to functions defined in eval
by perrin (Chancellor) on Oct 16, 2001 at 18:12 UTC
    I think we're going in circles. My comment about BEGIN blocks actually had nothing to do with optimizing function calls; it was about optimizing shared memory under mod_perl.

    As far as optimizing function calls goes, my original assertion still stands: eval() works the same way as any other kind of compiling and should perform the same kinds of optimizations. What makes you think that it's not happening?

      Because the conversion to auto-generated accessors is running slower than pre-defined accessors, even though the pre-defined ones were slower, 1-for-1 than the ones I'm generating in the auto-generated.

      Doesn't matter. I'm recompiling Perl for use with Devel::DProf and I'll figure it out soon enough. I was just wondering if anyone had a quick answer for me. :-)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.