home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
editors
/
amac41.arj
/
TIMER14.QM
< prev
next >
Wrap
Text File
|
1991-08-26
|
26KB
|
600 lines
* TIMER14.QM, v1.4b
* Macros To Time QEdit Command Sequences
* Written by Tom Hogshead
* 8/15/91
* Key Subfile Standard Timing Techniques
* ===== ========= =====================================================
* @(1) {e:\up\tim001}
* --Times Macro Command Sequences For 1 To 100,000 Repeats
* (Inserted) In @1 Using [Del_Ch] Timing Counter
* @(2) {e:\up\tim002}
* --Times Macro Command Sequences For ONE Repeat Only
* (Inserted_In) @2
*
* Key Subfile Other Timing Techniques
* ===== ========= =====================================================
* @(q) {e:\up\tim003}
* --Times Macro Command Sequences For ONE Repeat Only, |new
* Simple, Quick And Foolproof!
* @(r) {e:\up\tim004}
* --Times Macro Command Sequences For 1 To 100,000 Repeats|new
* Using [Cursor_Right] Timing Counter
* @(p) {e:\up\tim005}
* --Times Macro Command Sequences For 1 To 100,000 Repeats|new
* Using [Command n] Timing Counter
* @(n) {e:\up\tim006}
* --Makes Files Needed For @1/@p/@r
* Misc
* ------
* (Description)
* (Timing) Loop Description
* (Usage)
* (Base) Time For Your System, How To Measure
* (Comparison) of 6/29/91 (v1.1) and 7/7/91 (v1.2) Base Time
* (Example), "CursorRight CursorLeft" Timing
* (Other) Commands' Timing
* (Calculating) Run Time
* (Accuracy) / Repeatability
* (TSR) Interference
* (Requirements) For Timing Macro Command Sequences
* (Hardware)
* (Software)
* (Allocated) Memory Map
* (QCONFIG) Setup
*
* (Locate) Macros and Index Items in File, How To Jump To
* (AMACxx).ZIP
* (Uploaded) sources for AMACxx
* (Problems) or suggestions?
*
* (M) A C R O S
* (Version) History
*
*-- eoi
*
* (Description)
* ---------------
* TIMER14.QM are macros enabling the user to measure execution time
* of QEdit macro command sequences with unparalleled accuracy and
* versatility. Timing macro commands provides the capability to
* optimize macros for speed. Relative speed of many commands are
* compared. The number of repeats can be timed from 1 to 100,000 for
* different command sequences.
* My conclusions are based only on the timing tests I conducted with
* specific command sequences. I am not attempting to make a
* determination of the absolute speed of QEdit. Although limited by
* my inability to measure any command's speed without some synergism
* with other commands and the testing system, I believe these
* conclusions, as they relate to speeds of specific command sequences
* timed, are accurate and valid in this necessarily limited context.
*
* (Timing) Loop Description
* --------------------------
* Macro @1 uses the following timing loop with Del_Ch as the timing
* mechanism or counter:
* make block of characters = number of repeats up to 100,000
* InsertTime (start time)
* TIME:
* < commands to time inserted here >
* Del_Ch
* jtrue TIME:
* cursorup
* jtrue TIME:
* InsertTime (end time)
* Command sequences to be timed are first inserted by the user into
* the macro timing loop just prior to Del_Ch. After compiling the
* macro with QMAC, the macro first makes and fills a block with 500
* characters / line until the total number of characters equals the
* user selected number of repeats (From 1 to 100,000 repeats).
* Timing begins when the timing loop is entered. The cursor remains
* in column 1 deleting characters until Del_Ch tests false signifying
* the 500 characters in the last line of the block have been deleted.
* The macro then cursors up one line and begins deleting characters
* in that line starting in column 1. The timing loop continues until
* cursorup tests false indicating all characters in the block have
* been deleted, and timing ends.
*
* (Usage)
* ---------
* To measure execution time of QEdit macro commands, the desired
* command sequences to time are first inserted by the user into a
* either @1 or @2. The macro is then compiled using QMAC.
* Macro time is then calculated in seconds by subtracting start time
* from end time as measured and reported by InsertTime. Time for
* the inserted command sequences is calculated by first subtracting
* "Base" time from "macro" time, and then dividing the resulting
* "commands" time by the number of user selected repeats. This gives
* a precise timing measurement significant to 0.000001 seconds for
* 100,000 repeats. I was unable to come up with any other practical
* way to accurately time the many fast commands like cursorright,
* delch etc:
* Macro Time = End Time - Start Time
* Commands Time = Macro Time - Base Time
* Commands Time = End Time - Start Time - Base Time
* Commands Time/ = Commands Time / Number of Repeats
* Per Repeat
* See Example for calculating time for [ cursorright cursorleft ].
*
* Measuring (Base) Time For Your System
* ---------------------------------------
* 1. Load a file for macro timing output.
* 2. Read TIMER14.MAC:
* <escape>
* MR
* TIMER14.MAC
* <enter>
* 3. Run macro @1 without any inserted commands by pressing
* the Alternate key and 1 at the same time.
* 4. At the first prompt, answer "Y <enter>", meaning the
* macro will cycle until Control Break Escape is pressed.
* 5. At the second prompt, cursor down to the line beginning
* with "100k", meaning the macro will time 100,000 repeats,
* and press <enter>.
* 6. After the macro runs for 10 cycles (010 in the last
* column of the output) press Control Break Escape. Be
* patient, this will take some time (4 minutes per cycle on
* my machine). You are now ready to calculate the macro
* "Base" time for your system. It is important to measure
* this accurately because "Base" Time is used in ALL
* subsequent timings:
* Cycle number ──────────────────────────────────┐
* Number of repeats (k=1,000) ─────────────────────────────┐ │
* Macro ─────────────────────────────────────────────┐ │ │
* Date ───────────────────────────────────────┐ │ │ │
* End time ──────────────────────────────┐ │ │ │ │
* Start time ───────────────────────┐ │ │ │ │ │
* End - Start ──────┐ │ │ │ │ │ │
* 252 * 16:58:40 02:52 06-23-91 @1 100k 010
* 252 * 16:54:25 58:37 06-23-91 @1 100k 009
* 252 * 16:50:09 54:21 06-23-91 @1 100k 008
* 252 * 16:45:53 50:05 06-23-91 @1 100k 007
* 251 * 16:41:38 45:49 06-23-91 @1 100k 006
* 252 * 16:37:22 41:34 06-23-91 @1 100k 005
* 251 * 16:33:07 37:18 06-23-91 @1 100k 004
* 252 * 16:28:51 33:03 06-23-91 @1 100k 003
* 251 * 16:24:36 28:47 06-23-91 @1 100k 002
* 252 * 16:20:20 24:32 06-23-91 @1 100k 001
* -----
* Total = 2517 seconds
* Base Time = 2517 seconds for 1,000,000 repeats
* = 0.002517 ( seconds / repeat )
* -- Base Time --
* # of Repeats ( seconds )
* ============== ===============
* ½k 1.3
* 1k 2.5
* 5k 12.6
* 10k 25.2
* 25k 63.0
* 50k 126.0
* 100k 252.0
* Base Time is proportional to the number of repeats, and may be
* calculated for different "number of repeats" from 100k Base Time.
* (Comparison) of 6/29/91 (v1.1) and 7/7/91 (v1.2) Base Time
* ------------------------------------------------------------
*
* Cycle number ──────────────────────────────────┐
* Number of repeats (k=1,000) ─────────────────────────────┐ │
* Macro ─────────────────────────────────────────────┐ │ │
* Date ───────────────────────────────────────┐ │ │ │
* End time ──────────────────────────────┐ │ │ │ │
* Start time ───────────────────────┐ │ │ │ │ │
* End - Start ──────┐ │ │ │ │ │ │
* 252 * 00:57:56 02:08 07-08-91 @1 100k 010
* 252 * 00:53:38 57:50 07-08-91 @1 100k 009
* 252 * 00:49:20 53:32 07-08-91 @1 100k 008
* 252 * 00:45:02 49:14 07-08-91 @1 100k 007
251 * 00:40:45 44:56 07-08-91 @1 100k 006
* 252 * 00:36:27 40:39 07-08-91 @1 100k 005
* 252 * 00:32:10 36:22 07-08-91 @1 100k 004
* 252 * 00:27:53 32:05 07-08-91 @1 100k 003
* 251 * 00:23:37 27:48 07-08-91 @1 100k 002
* 250 * 00:19:21 23:31 07-08-91 @1 100k 001
* -----
* Total = 2516 seconds
* Base Time = 2516 seconds for 1,000,000 repeats, 7/7/91 version 1.2,
* compared to 2517 seconds for 1,000,000 repeats, 6/28/91 version 1.0. |
*
* (Example), "CursorRight CursorLeft" Timing
* --------------------------------------------
* To measure execution time of "CursorRight CursorLeft":
* 1. Insert "CursorRight CursorLeft" in @1 as follows;
* TIME:
* CursorRight CursorLeft * <<<
* Del_Ch
* jtrue TIME:
* 2. Compile using QMAC.
* 3. Read TIMER14.MAC:
* <escape>
* MR
* TIMER14.MAC
* <enter>
* 4. Load desired file to record macro timing output.
* 5. Execute @1 pressing Alternate key and 1 at the same time.
* 6. At the first prompt, press <enter> for now. The macro will
* cycle once. Alternatively, answering "Y", then <enter>,
* cycles the macro until Control Break Escape is pressed.
* 7. At the second prompt, cursor down to the line beginning
* with "100k", meaning the macro will time 100,000 repeats
* of this command sequence, and press <enter>.
* 8. Press Control Break Escape to stop cycling and begin
* calculations.
*
* (Calculating) Run Time
* -----------------------
*******************************************
* Macro Output ==> * 16:22:02 28:44 06-23-91 @1 100k 001 *
*******************************************
* 6 x 60 = 360
* +44
* -----
* 404 start
* -2 end
* -----
* 402 Macro Time
* -252 Base Time, 100k repeats
* -----
* 150 Net
* "CursorRight CursorLeft" Timing
* ====================================
* Time ( seconds ) # Repeats
* ------------------ -----------
* 150 100,000
* 1.50 1,000
* 0.00150 1
*
* (Other) Commands Timing
* -------------------------
* See TIMER.SUM for timing results of other command sequences.
*
* (Accuracy) / Repeatability
* ----------------------------
* Accuracy, or repeatability, of calculated times (End Time minus
* Begin Time) is accurate to +/- 1 second. Accuracy of calculated
* time per repeat may be determined as follows:
* Accuracy = 1 / ( number of repeats)
* For 100k repeats:
* Accuracy = 1 / ( 100,000 ) = 0.000010 seconds
* (TSR) Interference
* -------------------
* TSR's that interfere with timing should be removed. TSR's that do
* interfere with timing may only slow down results, but their effect
* should be consistent across tests. This effect can be seen by
* measuring my 100k Base Time with/without TSR's:
* Seconds Norton
* Setup 100k Base SI
* ---------- ----------- --------
* Standard 252 10.2
* No TSR's 231 10.7
*
* (Requirements) For Timing Macro Command Sequences With @1
* ----------------------------------------------------------
* - Commands must return cursor to the beginning of the counting
* line in file "0k" upon completion of each inserted command
* sequence.
* - Commands must not add/delete any characters to/from
* counting line.
* - Commands must not quit or reload any file unless QConfig is
* set to *not* close windows on quit.
* - No TSR should access the disk or in any way effect timing.
*
* (Hardware)
* ----------
* two Seagate 20 meg ST250 MFM hard drives, configured E: and F:
* 5 1/4" 360k floppy, A:
* 3 1/2" 720k floppy, B:
* Logix VGA card, 256k
* Magnavox VGA paper white monitor
* 10 MHz XT clone with Everex 12 MHz Accelerator card
* Norton v4.50 (SI) = 10.2
* (DI) = 2.4
* (PI) = 7.6
* Landmark v2.00 (CPU) = 10.73 MHz
* (Video)= 520 chr/ms
* 5 meg expanded memory using one AST Six Pack Plus and
* two AST Rampage Plus boards, LIM 4.0, 256k chips, 150 ns
*
* (Software)
* ----------
* Buffers=7
* Files=25
* Break=off
* 1 meg PcKwik ram disk, with 2 sub directories C: and D:
* Software Carousel v5.00, three 509k partitions
* 64k of high memory added to low ram with EEMRAM
* 492,048 bytes free ram after adding 64k of expanded with EEMRAM
* PcKwik v3.52 with 1.3 meg hard disk cache
* Newkey v5.4
* PCED v2.00(A4)
* Other software used:
* QEdit v2.10, ( 45,782, 9/6/90 )
* QMAC v2.10, February 1990
* DOS v3.3
* (Allocated) Memory Map
* ======================================================================
* MCB adr PSP adr paras bytes owner hooked vectors
* ------- ------- ------- ------- ---------- -------------------------
* 10d9 1002 003f 1008 (DOS)
* 113b 113c 0014 320 SHFTLOCK.COM
* 1172 1173 003e 992 ASTCLOCK.COM
* 11ce 11cf 0021 528 DISKSHW2.COM
* 1213 1214 036c 14016 SUPERPCK.COM
* 159e 159f 01ad 6864 PCKSCRN.COM 29
* 1769 176a 032a 12960 PCKSPL.COM 05 0f 17
* 1ab1 1ab2 0016 352 NUMCLICK.COM
* 1ae5 1ae6 0020 512 TIMEPARK.COM
* 1b23 1b24 00d3 3376 HOTLINE.EXE
* 1c14 1c15 0009 144 COLON.EXE
* 1c61 1c62 0060 1536 STACKEY.COM
* 1cdf 1ce0 0225 8784 QTSR.EXE 1c 2f
* 1f05 1f23 80f9 528272 CAROUSEL.EXE 00 08 09 10 12 13 14
* 15 16 1a 1b 21 27 28
* 30 33 5c 61 66 67
* Allocated Memory Map - by TurboPower Software - Version 2.9
* PSP blks bytes owner command line chained vectors
* ----- ---- ----- -------- ------------------- ------------------------
* 22CE 1 144 config j:\-A1
* 22D8 2 4208 WATCH TSR WATCHER 16 21 27
* 23E6 2 880 CLICKER 09
* 241F 1 1024 SMAX 13
* 247E 1 18464 PCED 200 /X/B4000,100,260... 1B 21 61
* 2901 1 5008 VSTACK /A112;62;112
* 2A3B 1 1056 SEND
* 2A7E 1 1248 FL
* 2ACD 1 608 CDIR 200 /X /D500
* 2AF4 1 608 RAW on 21
* 2B1B 2 39312 NEWKEY N/A 08 09 10 16 1B 28 66
* 3498 2 5440 RUNSCOUT 08 09 13 16 28
* 35F3 1 7696 SETUP u:\np10.pmf 09
* 37D5 1 144 FMARK j:\-end
* 37DF 2 492048 free
* block bytes (Expanded Memory) Name
* ----- ------ ----
* 0 393216 SYSTEM
* 1 16384 XPANDISK
* 2 1425408 SUPERPCK
* 3 98304 HOTLINE
* 4 212992 QEditTSR
* 5 49152
* 6 1458176 CAROUSEL
* 7 49152 PCED 200
* 8 32768 CDIR 200
* 9 65536 EEMRAM
* 10 49152 NEWKEY
* 11 163840 SCOUT-EM
* free 1032192
* total 5046272
*
* (QCONFIG) Setup
* ----------------
* General
* ---------
* Test for presence of EGA or VGA adapters (Y/N)? [Y] : Y
* Test for presence of enhanced keyboard (Y/N)? [Y] : Y
* Swap to Expanded memory or DISK on the Dos and Shell commands
* (Y/N)? [Y] : Y
* Drive for disk swapping on the Dos/Shell commands
* *=default-drive [A..Z] [J] : J
* Should QEdit change the cursor size (Y/N)? [Y] : Y
* Do you want a large flashing cursor (Y/N)? [N] : N
* Fast screen updating with flicker OK (CGA's only)(Y/N)? [N] : N
* Get num rows on screen from BIOS data area
* (100% IBM PC only)(Y/N)? [N] : N
* Number of rows on screen (NOT NEEDED with EGA/VGA) [25..255] [25] : 25
* Do you want the return command to split lines
* in insert mode (Y/N)? [Y] : Y
* Should Cut and Copy use current line if no block marked (Y/N)? [Y] : Y
* Amount of memory to reserve from DOS
* (in paragraphs) [0,8..32767] [0] : 0
* Code generated by ALT numeric keypad [0..255] [0] : 0
* Do you want the ESCAPE command to invoke the menus (Y/N)? [Y] : Y
* Should the editor restore the starting drive/dir
* on program exit (Y/N)? [Y] : Y
* Should the editor change the DOS PROMPT during a shell (Y/N)? [Y] : Y
* Should [TabRt]/[TabLt] be allowed to shift
* an entire block (Y/N)? [Y] : Y
* Advanced
* --------
* Do you want the del_ch command to join lines if at EOL (Y/N)? [N] : N
* Should PQuit, Exit and File return to the edit
* file prompt (Y/N)? [N] : N
* Do you want the editor to start in wordwrap mode (Y/N)? [Y] : Y
* Default right margin for wordwrap [1..500] [80] : 80
* Do you want the editor to start in insertmode (Y/N)? [Y] : Y
* Do you want the editor to start in autoindent mode (Y/N)? [Y] : Y
* Do you want the editor to use sticky autoindent (Y/N)? [N] : N
* Load wildcarded filespecs from the command line (Y/N)? [Y] : Y
* Load wildcarded filespecs from inside the editor (Y/N)? [Y] : Y
* Do you want the editor to start in enter matching mode (Y/N)? [N] : N
* Use CMODE for .c, .cpp, .cxx, .h, .hpp, and .hxx files (Y/N)? [Y] : Y
* Default number of deleted lines to keep per file [0..300] [100] : 100
* Remove trailing blanks from edited lines (Y/N)? [Y] : Y
* Delete white space after words with del_rt_word command (Y/N)? [Y] : Y
* Terminate files with a Control Z (Y/N)? [N] : N
* Do you want backups of saved files (Y/N)? [Y] : Y
* Prompt for filename on open window (Y/N)? [N] : N
* Close window when a file is quit (Y/N)? [Y] : Y
* Display End Of File marker (Y/N)? [Y] : Y
* Insert line blocks ABOVE the cursor line (Y/N)? [Y] : Y
* Do you want a beep on warning messages and
* missed searches (Y/N)? [N] : N
* Default Find options [IWBG] [I] : I
* Default Find_Replace options [IWBNG] [I] : I
* Default file extension number 1 [.bat] : .bat
* Default file extension number 2 [.qm] : .qm
* Default file extension number 3 [.doc] : .doc
* Default file extension number 4 [.inf] : .inf
* Default file extension number 5 [.lst] : .lst
* Default file extension number 6 [.let] : .let
*
* (AMACxx).ZIP Sources
* --------------------
* AMACxx.ZIP is a collection of QEdit macros I have put together. Many
* I have written, and John Goodman has recently contributed
* extensively to this effort. As of this writing, the latest version
* is xx=38 with new macros and subsequent changes in AMAC-x.ZIP(x = K)
* Program files used with these macros are in AMAC-PRG.ZIP. AMACxx.ZIP
* is (uploaded) to CompuServe IBMAPP Lib 0 (Lib 1 after 30 days in
* Lib 0), Exec-PC (414-789-4210), and SemWare (404-641-8968). All are
* PC "Pursuitable" except CompuServe.
*
* (Problems) or suggestions?
* --------------------------
* Any problems or suggestion, I would like to hear from you. I can
* be reached daily on either SemWare, Exec-PC or NewWare. I check
* CompuServe only once a month. I will also try to include your useful
* macros in AMAC if you send them to me. Hope you find some of these
* macros useful. I have enjoyed writing them. Thanks.
* Tom Hogshead
* (Locate) Macros and Index Items in File, How To Jump To
* ---------------------------------------------------------
* See BOOKxx.QM for how to locate items in Index.
*
(M) A C R O S
* ========================================================================
*
* -------------------------------------------------------------------------
* @(1) Times Macro Command Sequences For 1 To 100,000 Repeats
* -------------------------------------------------------------------------
* See tim001.QM for macro. Use @f to jump to macro.
*
* ----------------------------------------------------------------------
* @(2) Measures Running Time of Macro Command Sequences, ONE Repeat Only
* ----------------------------------------------------------------------
* See tim002.QM for macro. Use @f to jump to macro.
*
* ----------------------------------------------------------------------
* @(q) Times Macro Command Sequences For ONE Repeat Only,
* Simple and Quick!
* ----------------------------------------------------------------------
* See tim003.QM for macro. Use @f to jump to macro.
*
* -------------------------------------------------------------------------
* @(r) Times Macro Command Sequences For 1 To 100,000 Repeats
* -------------------------------------------------------------------------
* See tim004.QM for macro. Use @f to jump to macro.
*
* -------------------------------------------------------------------------
* @(p) Times Macro Command Sequences For 1 To 100,000 Repeats
* Using [command n] Timing Counter
* -------------------------------------------------------------------------
* See tim005.QM for macro. Use @f to jump to macro.
*
* ----------------------------------------------------------------------
* @(n) Makes Files: Sequential Line Number File (001-999), < $line# >
* : Zero Length File for Counting, < 0k >
* : File to Select Number of Repeats/Cycle, < $repeat >
* ----------------------------------------------------------------------
* See tim006.QM for macro. Use @f to jump to macro.
*
* (Version) History
* --------------------------------------------------------------------
* June 29, 1991 1.0 - Initial, named TIME10.QM
* July 2, 1991 1.1 - Changed name to TIMER, minor documentation
* changes, added @n. First release of TIMERxx.ZIP.
* July 7, 1991 1.2 - Added timing loop description to documentation.
* - Moved makectrofscreen in @h down.
* - Changed ONE_CYCLE: to ONE_REPEAT: in @1.
* - Removed extra space from "@1 " in @1.
* - Added insertline to @2.
* - Added 1/5/50/100 repeats to @1 and @n.
* - Changes in this version do not affect timing.
* July 8, 1991 1.3 - Corrected documentation.
* July 11, 1991 1.3a - Added latest version of @h.
* July 14, 1991 1.3b - Added other timing techniques @p and @r.
* July 19, 1991 1.3c - Added @q for simple, quick and foolproof timing
* one repeat.
* July 21, 1991 1.4 - Made macros separate files tim001...tim006.
* - Replaced @h with @f.
* - Included v1.4 in AMAC39.ZIP.
* July 27, 1991 1.4a - Minor Documentation changes.
* - Removed @f. Now in BOOKxx.QM only.
* - Included v1.4a in AMAC40.ZIP.
* August 15, 1991 1.4b - Removed @f once again.
*
*
*
*