Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Why so slow when using Perl/Tk?

by ww (Archbishop)
on Jul 28, 2009 at 23:12 UTC ( [id://784065]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why so slow when using Perl/Tk?
in thread Why so slow when using Perl/Tk?

Eminently reasonable. Seems sensible!

But your distinction between a plain text file and the .html output of your OP puzzles me again, as any difference should be negligible: the .html source is, to all intents and purposes as far as writing the file is concerned, a "plain text file."

Or does your actual script open a browser after writing the output? That, of course, would add a bit more overhead. In that case, you cantrim the rendering time by assigning width to table and the ten tds.

In any case, it may be useful to profile your actual script: see http://search.cpan.org/~timb/Devel-NYTProf-2.10/lib/Devel/NYTProf.pm.

OTOH, it may be even more useful to await better answers from Tk gurus here.

Replies are listed 'Best First'.
Re^4: Why so slow when using Perl/Tk?
by RAS230 (Acolyte) on Jul 29, 2009 at 00:05 UTC
    But your distinction between a plain text file and the .html output of your OP puzzles me again, as any difference should be negligible: the .html source is, to all intents and purposes as far as writing the file is concerned, a "plain text file."

    I know what you mean. In the end I suspect that it was just because when I tried sending the output as plain text it greatly reduced the number of lines I sent out. All the HTMLSTUFF was removed and my do_this sub was reduced to a few lines.

    sub do_this() { open FILE, "> $filename" or die "ERROR WRITTING FILE: $filename\nSyste +m reported $!"; print FILE "\n"; foreach (sort keys(%stuff1) ) { print FILE "$stuff1{$_} | ";} print FILE "\n"; foreach (sort keys(%stuff2) ) { print FILE "$stuff2{$_} | ";} close FILE; system "start /b $filename"; }
      If going from HTML to plain text speeds things up considerably then Tk isn't your problem! Take BrowserUK's advice in 784062 and look at your setup to see what could be causing the problem.

      Elda Taluta; Sarks Sark; Ark Arks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://784065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found