in reply to Re^2: Most effective way to dynamically load a module?
in thread Most effective way to dynamically load a module?

Define expensive.

eval isn't free, but it doesn't cost that much. In any case this is all micro-optimization that is unlikely to matter much.

  • Comment on Re^3: Most effective way to dynamically load a module?

Replies are listed 'Best First'.
Re^4: Most effective way to dynamically load a module?
by BerntB (Deacon) on Aug 22, 2006 at 05:47 UTC
    "expensive" here means that I am nervous about this part of the code. :-)

    I think this bit of code (together with unpacking of objects) are in the critical path.

    Hmmm... to compile a single statement with one parameter shouldn't be much more than lex:ing a couple of strings and doing a jump in a parser's jump table, then mallocing a bit memory for the minimal parse tree and probably copying the parameter.

    OK, my instinctive fear of eval might be wrong, here. (-: You can take the compiler from the old C programmer but you can never stop him doing premature optimizations? :-)