Win95/98 Console Print Speed Problem: SOLVED! 
Author Message
 Win95/98 Console Print Speed Problem: SOLVED!

To All PB/CC Users:

The holiday season is approaching fast... Here's an early "present" from
Perfect Sync Software, the publishers of Console Tools
( http://www.*-*-*.com/ ).

Everybody knows that the Windows 95 Console has a problem with PRINT
speed.  And if you've installed Windows 98, you know that Microsoft
hasn't fixed the problem.

Well, finally, after a lot of experimentation, we've found a simple
solution!

All you have to do is change the size of the console window, and the
PRINT speed problem goes away instantly!  The Win95/98 console window is
only slow when it has 25, 43, or 50 rows.

All other console buffer sizes are between 10 and 50 times as fast as
25/43/50, depending on the machine!

There's a hitch, of course.  If you use the console window's Property
menu to change the size of the console, Windows 95 and 98 only allow you
to select 25, 43, and 50 rows.  But it *is* possible for your PB/CC
programs to *programmatically* change the size of the console window.

To be honest, it wouldn't hurt our feelings (at all!) if you used our
Console Tools DLL to change the console window's size, but here's the
source code for a small program that demonstrates how you can use the
Win32 API to change a PB/CC program's console window from 25 to 26 lines.

Happy holidays, and use it in good health!

-- Eric Pearson, Perfect Sync Software

P.S. Please post your results as a response to this message!

(Console Tools, a PB/CC add-on, contains over 60 console related
functions including a simple-to-use function that allows you to change
the size of the console window to virtually any size.  To download our
demo program, visit PerfectSync.com.)

'-------------------------------------------------------
'This first block of code is from the WIN32API.INC file.
TYPE SMALL_RECT
  xLeft   AS INTEGER
  xTop    AS INTEGER
  xRight  AS INTEGER
  xBottom AS INTEGER
END TYPE

DECLARE FUNCTION SetConsoleWindowInfo LIB "KERNEL32.DLL" _
        ALIAS "SetConsoleWindowInfo" _
        (BYVAL hConsoleOutput AS LONG, _
        BYVAL bAbsolute AS LONG, _
        lpConsoleWindow AS SMALL_RECT) AS LONG

DECLARE FUNCTION SetConsoleScreenBufferSize LIB "KERNEL32.DLL" _
        ALIAS "SetConsoleScreenBufferSize" _
        (BYVAL hConsoleOutput AS LONG, _
        BYVAL dwSize AS LONG) AS LONG

'-------------------------------------------------------

FUNCTION PBMain

    DIM Rect    AS LOCAL SMALL_RECT
    DIM spStart AS LOCAL SINGLE
    DIM spTest1 AS LOCAL SINGLE
    DIM spTest2 AS LOCAL SINGLE
    DIM lRow    AS LOCAL LONG
    DIM lCol    AS LOCAL LONG

    'Fill 20 rows with dashes and time how long it takes...
    spStart = TIMER    
    FOR lRow  = 1 TO 20
        FOR lCol = 1 TO 80
            PRINT "-";
        NEXT
    NEXT
    spTest1 = TIMER - spStart

    '--------------------------------------------------
    'This code changes the console window to 80x26...
    SetConsoleScreenBufferSize GETSTDOUT, MAKDWD(80,26)
    Rect.xBottom = 25
    Rect.xRight  = 79
    SetConsoleWindowInfo GETSTDOUT, 1, Rect
    '--------------------------------------------------

    'Now repeat the test using plus signs...
    LOCATE 1,1
    spStart = TIMER        
    FOR lRow  = 1 TO 20
        FOR lCol = 1 TO 80
            PRINT "+";
        NEXT
    NEXT
    spTest2 = TIMER - spStart

    'Display the results...
    PRINT
    PRINT "Elapsed Time with 25 rows = ";
    PRINT FORMAT$(spTest1,"##.##");" seconds."
    PRINT "Elapsed Time with 26 rows = ";
    PRINT FORMAT$(spTest2,"##.##");" seconds."
    PRINT "Difference in print speed = ";
    PRINT FORMAT$(spTest1-spTest2,"##.##");" seconds."
    PRINT "That's a `speedup ratio' of ";
    PRINT FORMAT$(spTest1/spTest2,"##.##");" (1.00 = no difference)"

    WAITKEY$

END FUNCTION



Sun, 29 Apr 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Printing Speed NT4 vs. Win95/98

2. Print Speed Nt4 vs. Win 98

3. Printing to lpt2, lpt3, etc using Mf Cobol on win95/98

4. VSE 3.1 Win95/98 printing

5. NT / win95/98 Date/time problem HELP!!

6. Lock problems with Win95/98

7. printing from console under win95

8. Windows 98 printing problem

9. problems printing in windows 98

10. Printing Problems in Windows 98

11. Windows 98 printing problem

12. Windows 95/98: Python uses console, not stdio

 

 
Powered by phpBB® Forum Software