in reply to Module Efficiency
The primary objective of a PM is to make a module/class that can be reused easy/fast in many different ways, with different applications. And a script is made just to work in some situation.
But is possible to make a PM that works fast too, you just need to make a good work. The advantage of the module is to make it in a architecture better than scripts, since you project it to be used in many ways. The best way to make reusable codes is with Object-Oriented Classes, take a look at perlmodlib, that enable the multi use of your code, since you can make each object of your PM independent of the other.
About speed improvement, you will read a lot of peoples saying that OO is slower, since paste the object reference is slower than normal variables. But in the end you will see that speed is really lost in point that are runned a lot, specially loops, in your code, or when you are working with the memory/HD, and not in the OO point. The best way to make a fast code is to know what hapens in the interpreter and try to use better ways, but never forget the maintenance of your code!
Soo, here are some nodes about speed improvement:
And don't forget:
But first you need to learn how to write nice PM, and than spend time with deep speed improvement. One good tip is to always use strict in the top of your code, at least for variables. And in the end you can use XS, that can bring another world for you, not only fast codes in C. ;-P
Graciliano M. P.
"The creativity is the expression of the liberty".
|
|---|