in reply to Why so slow when using Perl/Tk?

What OS/Perl/Browser/Proxies are you running? Cos with Vista/AS1004/Opera/None, the HTML is displayed instantaneously when I click the button if the browser is running and takes (empirically) less than a second if it isn't.

In essence, you should probably look carefully at your particular set-up rather than attributing the problem to Tk.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW

Replies are listed 'Best First'.
Re^2: Why so slow when using Perl/Tk?
by RAS230 (Acolyte) on Jul 29, 2009 at 00:37 UTC
    I'd been seeing the problem on a few workstations, all winXP using activestate's perl (5.8.8) with either Firefox 3.5 or IE 8 as the default browser.

    I'd been testing with the browser already open but windows would start it up to load the file if it weren't. For me the slowdown starts as soon the button is clicked. The button itself even stays in a depressed state for almost the entire wait. After seeing that you guys aren't getting the same results I pulled out an old test box (XP with IE 6) and it worked fine on that machine so it looks like the problem might be limited to the workstations.

    I originally ruled out browser issues and focused on perl/tk as the source of the trouble because removing the perl/tk lines always fixes the problem and it's easy to blame the thing you least understand, but I'm going to have dig into this a little closer.

    This could be a problem with the install on the affected machines or even antivirus/security software related...

    Thanks once again for the help and the tips!

    I'll let you all know what the trouble was if I manage to track the source of this down to anything more interesting than a bad image or a conflict with some obscure internal application.

      You are writing each line separately?
      I suggest storing everything you want to write in a variable, and then write it all out in one big I/O operation. The writing process should be faster, and AV/Sec software won't be tempted to rescan the changed file fifty thousand times.