in reply to Just how efficent is using system() ?
Both good points above (don't optimize things that are not too slow, don't call the shell).
I can suggest two possible ways to make this faster. First, if you can get the kadmin program to insert all the records at once, perhaps by reading the records from stdin, then you can just call system() one time (or open() with the pipe feature to feed data into the stdin). If kadmin does not have a way to do that, then you'll be stuck with calling system() many times.
Second, you could find a way to avoid using kadmin at all and just connect to the database directly in your script.
Either of these approaches will make it more efficient, but if neither one is possible, then there is no magic way to make system() faster.
|
|---|