Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / December 2005



Tip: Looking for answers? Try searching our database.

Delay in BBEdit/TextWrangler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Delacour - 06 Dec 2005 19:10 GMT
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.

#!/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.

Can anyone explain what causes this delay?

JD
Joel Rees - 06 Dec 2005 21:41 GMT
> 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~;
[quoted text clipped - 7 lines]
> 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
John Delacour - 06 Dec 2005 22:47 GMT
>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.

It's interesting (to me) that if I go for Korean characters rather
than Burmese, there is no appreciable delay.  It seems some sort of
obstacle exists in the way of finding the necessary font/glyphs.

#!/usr/bin/perl
binmode STDOUT, q~:utf8~;
###for (4096..4129) {
for (44032..44066) {
  $c = chr();
  $text .= qq~$_\t$c$/~;
}
print $text;

I'll try to narrow it down by testing with various runs of characters.

JD
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.