For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > December 2005 > Slow Performance using Perl script and DOSEMU









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Slow Performance using Perl script and DOSEMU
Brian Hancock

2005-12-03, 9:55 pm

Hi,

I am using WordPerfect 5.1 for DOS to merge information from a database (WP
secondary file) with a WP form file (WP Primary file), then print it from
WP5.1 using a PostScript printer driver to a PostScript File. After exiting
DOSEMU I run ps2pdf to convert the previous output to a PDF file, and
deliver the result back to the browser.

I am using Fedora Core 4, apache 2.0.54, Perl 3.5.8.

The operation was taking a long time to merge and print a very simple
document so I did some timings. By way of comparison on the same hardware:

Windows 2000 0.7 seconds
Linux/DOSEMU 6.8 seconds
Linux/Perl/DOSEMU 125 seconds

Although the program runs considerably faster under Windows, my main concern
here in this forum is the 20 times longer it takes to run it from Perl.

The Perl script I am using to run the program is:
#!/usr/bin/perl -w
my $home = "/home/www/web1" ;
my $doshome = "/home/www/web1/dosemu/freedos" ;
$cmd = "dosemu.bin -D-a -I 'keystroke \"\\rwpw.bat test\\rexitemu\\r\"'[color=darkred]
>errors-dpweb.log 2>&1;" ;

$ENV{'TERM'} = "xterm";
$ENV{'HOME'} = $home ;
$ENV{'DOSDRIVE_D'} = $doshome ;
#print "Content-type:text/html\n\n";
system ("$cmd") ;

print "Content-type:application/pdf\n\n";
my $epsfile = $doshome."/output/test.eps" ;
my $pdffile = $doshome."/output/test.pdf" ;
system ("ps2pdf $epsfile $pdffile") ;
open(TXT, "<".$pdffile) ;
my @text = <TXT> ;
close(TXT) ;
print @text ;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Many thanks
Brian


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com