On 2005.12.7, at 04:10 AM, John Delacour wrote:
The script below prints a list of 34 Burmese characters. I happen to
have a font for these but I'm not sure that matters.
If I run the script in BBEdit or TextWrangler just after launching the
apps, there is a huge delay before the output is printed (up to 15
seconds) but subsequent runs produce no special delay.
First guess is font caching, which is mostly the time to find and load
glyphs. It looks like you might be also implicitly invoking the
relevant parsing attribute tables, which will also take some time to
find and load.
#!/usr/bin/perl
binmode STDOUT, q~:utf8~;
for (4096..4129) {
$c = chr();
$text .= qq~$_\t$c$/~;
}
print $text;
I get the same sort of behaviour if I run the script in Script Editor
or Smile as a shell script, but there is no delay running it in
Terminal.
Perhaps this reflects that terminal has advanced quite a bit since
jaguar, to the point of pre-loading many of the relevant tables?
Perhaps Script Editor and Smile are also loading some sort of run-time
interpreter which has to do its own caching of font and parsing tables?
Perhaps those two are using Java, maybe? Java does a lot of pre-flight
checking both syntax and rudimentary semantics for security purposes.
Perhaps they are loading a separate copy of the perl interpreter?
Can anyone explain what causes this delay?
Good question.
JD