English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 21 May 2014, 19:13   #1
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Print to screen

I run a maths program on an Amiga 4000/040 involving repetitive outputs printed to screen. The data produced are stored on hard disk. Would the print to screen process slow the calculations? If this display was omitted would the maths coprocessor work more quickly?

Thanks for any response.
alphagemini is offline  
Old 21 May 2014, 21:28   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,024
Surely console output slows down the processing. In fact nothing decelerates a program more than a scrolling Shell window, especially if you don't have a graphics card.

There is already a huge speed difference if you redirect console output into a file.

Removing the output altogether gains another lot of speed.

It depends however on the amount of output produced. If you only print "200 of 1000 done" every second or so, there is almost no slowdown.

But a "for i=1 to 1000000: print i: next" is a lot slower than the same loop without print.
thomas is offline  
Old 22 May 2014, 06:56   #3
alphagemini
Registered User
 
Join Date: Nov 2011
Location: Folkestone, Kent
Posts: 119
Thanks for the help. I have tried to clock the speed with and without screen print but can't see any difference. I will try again. One cycle takes about 4 seconds so its difficult simply using a counter to check properly.

Thanks again
alphagemini is offline  
Old 22 May 2014, 14:46   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
I don`t know where is the boarder where you notice speed differences but 4 sec. for one cycle shouldn`t slow down calculation if every 4 sec. a print to screen is done.
daxb is offline  
Old 22 May 2014, 15:16   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,024
Like I said, it depends on the amount of output. If there are seconds between two lines, then no difference will be seen. But if you print 1000 messages per second, the difference will be huge.

Take this Rexx script:

Code:
/* rexx */

x = time('R')

do verbose = 4 to 0 by -1

   do i=0 to 9
      if verbose >= 1 then say "i =" i
      do j=0 to 9
         if verbose >= 2 then say "i =" i"; j =" j
         do k=0 to 9
            if verbose >= 3 then say "i =" i"; j =" j"; k =" k
            do l=0 to 9
               if verbose >= 4 then say "i =" i"; j =" j"; k =" k"; l =" l
            end
         end
      end
   end

   say "verbose =" verbose"; elapsed time:" time('R')

end
With verbose = 4 it prints 10,000 lines and needs 12.52 seconds. On WinUAE with gfx card. Probably much longer on a real Amiga and/or with native display.

verbose = 3 prints only 1,000 lines and is already much faster: 1.5 seconds.
verbose = 2 -> 100 lines -> 0.22 seconds
verbose = 1 -> 10 lines -> 0.1 seonds
verbose = 0 -> no output -> 0.08 seconds

The same script run with redirection to a file in RAM shows the huge overhead of console output:

verbose = 4 -> 0.52 seconds
verbose = 3 -> 0.12 seconds
verbose = 2, 1, 0 -> 0.08 seconds
thomas is offline  
Old 22 May 2014, 18:19   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
Results for my A1200 040/40 AGA OS3.1 if someone wants to compare:

To KingCON Shell:

verbose = 4; elapsed time: 289.66
verbose = 3; elapsed time: 30.76
verbose = 2; elapsed time: 5.18
verbose = 1; elapsed time: 2.62
verbose = 0; elapsed time: 2.36

Redirect to RAM:

verbose = 4; elapsed time: 11.88
verbose = 3; elapsed time: 3.20
verbose = 2; elapsed time: 2.42
verbose = 1; elapsed time: 2.30
verbose = 0; elapsed time: 2.32
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Screen directories RuySan support.FS-UAE 2 29 November 2013 17:05
Turbo Print shrub3056 support.Apps 1 23 August 2011 13:03
print screen button jimbob005 New to Emulation or Amiga scene 2 01 August 2008 15:05
NEWS: Print in WinUAE ; Print with WinUAE Borg_Number_One support.WinUAE 7 27 August 2004 23:15
Print Delay Unregistered support.WinUAE 0 11 August 2002 22:02

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:05.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07318 seconds with 15 queries