Phantasmal MUD Lib for DGD

Phantasmal Site > DGD > Writing a Library > Precompiling

Precompiling LPC Objects

If you're planning to precompile LPC objects, take a good look at dgd/src/lpc/Makefile in the DGD driver source. There are some commented-out lines in there that you can uncomment (while commenting others). Doing so will precompile the kernel library if you compile DGD. It's fairly easy to figure out.

If you're looking to precompile for the speed advantage, measure the code performance first. Using a mostly-hardcoded tool in LPC like parse_string, implode(), or explode() can vastly improve your performance. They're often better than a precompiling your LPC, and they're far more portable. Measure, measure, measure.

Similarly, before moving functionality into the driver itself and requiring all your users to run a patched DGD, first try an LPC solution, and then a precompiled LPC solution. You're not likely to get even a two times difference between one and another. DGD is already quite efficient, even when interpreted. So when in doubt, measure. When optimizing, optimize your algorithm first. It will make much, much more difference than optimizing what your code is compiled into.