On 23 Jun, 2010,at 10:41 AM, Tom Browder <tom.browder@...> wrote:
On Wed, Jun 23, 2010 at 07:06, Christopher Sean Morrison <brlcad@...> wrote:
> On Jun 23, 2010, at 6:58 AM, Tom Browder wrote:
>> How much efficiency is gained (or lost) by writing the complete series
>> of commands to a script first, and then feeding it to mged in one
> Batching the segments together in sets of 200 (i.e., 1800 commands at
> a time) takes LESS overall runtime than invoking MGED one segment at
> a time for just 10 segments (i.e., 9 commands at a time, 90 total
Then wouldn't it be better still to do it in one script fed to mged?
Ah! Yes, of course! I misread your original message, particularly the "in one chunk" part feeding it as one script Having mged invoke only once will be the clear winner and obviously fully minimizes the overhead. I can't think of a situation where it won't always be the fastest.
The script was originally implemented to create one segment at a time, which was clearly non-optimal with several minutes runtime. The batching into larger groups was a simple compromise that only takes 12s here. I didn't want to deviate from the original script too much and was intentionally avoiding writing out a script file for simplicity. Unfortunately, all of the commands are too long to be run as a single command line (about 260k characters) and I didn't want to jump the hoops needed to feed mged's standard input from within Perl.