in reply to Re(3)Module Efficiency (with a side order of facts, please)
in thread Module Efficiency
I interpreted the question to ask:
<paraphrase>Are their any performance penalties from the use of modules?</paraphrase>
I can think of several ways of answering this question.
I might discuss the trade-off between the load-time cost of use v the runtime cost of require. Or consider the trade-off between the load-regardless nature of use v the possible saving of conditional loading via require. Or consider the possibility of runtime autoloading etc.
I might point out that, once loaded, procedural subs within a module will carry exactly the same costs as those loaded via require.
I might discuss the performance penalty of tie and calling object methods and contrast that with the benefits of reusablility.
I would point out that code in modules is just as likely to be incorrect as code that isn't in a module. Modularisation has little or nothing to do with correctness. Fast code can be correct and modules can contain errors.
Having an interest in, and being aware of, both the benefits and the costs of the various Ways To Do It, does not automatically translate into 'give me speed at the cost of correctness'. If fact, awarness of the costs up front can lead to design decisions that can benefit the code in terms of both performance and correctness. Conversely, ignorance of them can lead to algorithms and implementations that become impossible to optimise to achieved the desired or required performance without resorting to the use of tricks and dodges in order to avoid total re-writes.
I would agree with you that there is no point in doing something wrong, very quickly, but there is equally no point in getting the right answer 2 days after it is needed.
Performance is just one of many factors that must be considered when setting out to design code. It should not take higher precedence in the process than anything else that is more important. Dumb statement, but the relative importance of the many design criteria is dependant upon the needs of each individual project. Some projects do need a certain level of performance, and being aware of the factors that can affect performance at the outset is no bad thing as it allows better decisions to be made in a timely fashion. A stitch in time and all that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re(3)Module Efficiency (with a side order of facts, please)
by Ovid (Cardinal) on Apr 10, 2003 at 22:54 UTC | |
by Anonymous Monk on Apr 10, 2003 at 23:19 UTC |