English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 28 December 2014, 17:22   #1
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
Lightbulb CopyMem Quick & Small released!

CopyMem Quick & Small v1.6
Parts of patch install code by Dirk Busse 1999
Enhanced patch code by SpeedGeek 2015

INTRODUCTION:
CMQ&S is a much smaller Copymem + Copymemquick patch. It's
main goal is to give a good speed increase without all the bloated
code found in the other CMQ patches. It does not attempt to be the
fastest CMQ patch, but at 92 bytes for the current version, it's
almost certainly one of the fastest in it's class.

FEATURES:
- Installs one of the smallest CMQ patches for 68020+ Amigas
- Safely exits if the patch is already installed (e.g. a good patch
program should really avoid patching itself)

REQUIREMENTS:
- Amiga with 68020+

NOTES:
Most other CMQ patches got bloated because their authors
wanted their patch to be faster than any previously released
patch. This means even bigger "unrolled" loops, redundant
testing for small & medium size copies and extra code to
handle misaligned transfers. Unfortunately, Testit from
COPMQR28 makes a disproportional number of these
"Worst Case" tests and other coders have fallen into the trap.
Motorola optimized it's 68K CPUs to improve average case
performance at the expense of worst case performance.
Need I say any more?
Attached Files
File Type: lha CMQ&S.LHA (1.3 KB, 288 views)

Last edited by SpeedGeek; 04 July 2020 at 14:36.
SpeedGeek is offline  
Old 29 December 2014, 14:26   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Some TestIt results for the fun. Attached results for various copymem paches if you care. If matthey read this you might have a look at "copymem_test_CopyMem040.txt". You might can explain the last result because it differs much compared to CopyMem060:

Code:
Copying 1 bytes 2190000 times (long -> long offset)
Old CopyMem     :  0.88 secs
New CopyMem     :  0.82 secs (- 5.7%)

SpeedGeek stuff:

Code:
10. System:C> CMQ&S040 
10. System:C> CopyMemQuicker 
CopyMemQuicker 2.8 (12.6.94)
Copyright © 1992 Arthur Hagen.
10. System:C> TestIt 
This test will compare the old CopyMem/CopyMemQuick routines with
the new ones you have installed.  A great variety of tests will be
run, and this might take some time, especially if your system has a
slow processor.

Initiating test (please be patient...)

Copying 65536 bytes 565 times (long -> long offset)
Old CopyMem     :  2.03 secs
New CopyMem     :  2.07 secs (+ 2.0%)
Old CopyMemQuick:  2.03 secs
New CopyMemQuick:  2.04 secs (+ 0.5%)

Copying 65536 bytes 147 times (long -> long+1 offset)
Old CopyMem     :  0.60 secs
New CopyMem     :  0.79 secs (+31.7%)

Copying 65536 bytes 413 times (long -> even offset)
Old CopyMem     :  1.68 secs
New CopyMem     :  1.47 secs (-12.5%)

Copying 65536 bytes 147 times (long -> even+1 offset)
Old CopyMem     :  0.60 secs
New CopyMem     :  0.81 secs (+35.0%)

Copying 65536 bytes 147 times (long+1 -> long offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.81 secs (+50.0%)

Copying 65536 bytes 382 times (long+1 -> long+1 offset)
Old CopyMem     :  1.42 secs
New CopyMem     :  1.42 secs (+ 0.0%)

Copying 65536 bytes 147 times (long+1 -> even offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.79 secs (+46.3%)

Copying 65536 bytes 501 times (long+1 -> even+1 offset)
Old CopyMem     :  1.87 secs
New CopyMem     :  1.94 secs (+ 3.7%)

Copying 65536 bytes 501 times (even -> long offset)
Old CopyMem     :  1.84 secs
New CopyMem     :  2.03 secs (+ 9.8%)

Copying 65536 bytes 147 times (even -> long+1 offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.81 secs (+48.1%)

Copying 65536 bytes 382 times (even -> even offset)
Old CopyMem     :  1.42 secs
New CopyMem     :  1.42 secs (+ 0.0%)

Copying 65536 bytes 147 times (even -> even+1 offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.79 secs (+44.4%)

Copying 65536 bytes 147 times (even+1 -> long offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.81 secs (+50.0%)

Copying 65536 bytes 413 times (even+1 -> long+1 offset)
Old CopyMem     :  1.54 secs
New CopyMem     :  1.62 secs (+ 4.5%)

Copying 65536 bytes 147 times (even+1 -> even offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.81 secs (+48.1%)

Copying 65536 bytes 564 times (even+1 -> even+1 offset)
Old CopyMem     :  2.10 secs
New CopyMem     :  2.10 secs (+ 0.0%)

Copying 1024 bytes 33900 times (long -> long offset)
Old CopyMem     :  0.54 secs
New CopyMem     :  0.70 secs (+29.6%)
Old CopyMemQuick:  0.53 secs
New CopyMemQuick:  0.69 secs (+30.2%)

Copying 1024 bytes 9400 times (long -> long+1 offset)
Old CopyMem     :  0.21 secs
New CopyMem     :  0.52 secs (+142.8%)

Copying 1024 bytes 24000 times (even -> even offset)
Old CopyMem     :  0.62 secs
New CopyMem     :  0.50 secs (-17.7%)

Copying 128 bytes 196000 times (long -> long offset)
Old CopyMem     :  0.50 secs
New CopyMem     :  0.98 secs (+94.0%)
Old CopyMemQuick:  0.45 secs
New CopyMemQuick:  0.86 secs (+91.1%)

Copying 128 bytes 155000 times (even -> even offset)
Old CopyMem     :  0.59 secs
New CopyMem     :  0.82 secs (+37.3%)

Copying 19 bytes 588000 times (long -> long offset)
Old CopyMem     :  0.87 secs
New CopyMem     :  0.93 secs (+ 5.7%)

Copying 18 bytes 622000 times (long -> long offset)
Old CopyMem     :  0.79 secs
New CopyMem     :  0.95 secs (+19.0%)

Copying 17 bytes 663000 times (long -> long offset)
Old CopyMem     :  0.94 secs
New CopyMem     :  0.99 secs (+ 5.3%)

Copying 16 bytes 956000 times (long -> long offset)
Old CopyMem     :  1.12 secs
New CopyMem     :  1.44 secs (+27.7%)
Old CopyMemQuick:  0.86 secs
New CopyMemQuick:  0.86 secs (- 0.0%)

Copying 8 bytes 1060000 times (long -> long offset)
Old CopyMem     :  0.98 secs
New CopyMem     :  1.33 secs (+34.7%)
Old CopyMemQuick:  0.69 secs
New CopyMemQuick:  0.69 secs (+ 0.0%)

Copying 4 bytes 1430000 times (long -> long offset)
Old CopyMem     :  1.11 secs
New CopyMem     :  1.07 secs (- 2.7%)
Old CopyMemQuick:  0.71 secs
New CopyMemQuick:  0.75 secs (+ 4.2%)

Copying 1 bytes 2190000 times (long -> long offset)
Old CopyMem     :  0.77 secs
New CopyMem     :  0.82 secs (+ 6.5%)

Total timing:
-------------
Old routines    :  32.81 secs
New routines    :  37.60 secs
Total slowdown  :  14.60 %
Attached Files
File Type: lha copymem_tests.lha (4.6 KB, 253 views)
daxb is offline  
Old 29 December 2014, 17:06   #3
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
Code:
See CMQ&B040 thread for MOVE16 Testit results.

Last edited by SpeedGeek; 04 July 2020 at 14:40.
SpeedGeek is offline  
Old 31 December 2014, 03:23   #4
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
** NEWS UPDATE **

CMQ&S040 v1.6 released

v1.6 minor change
- source address compare code misqualified Move16 on 8 byte offset
(This is fixed now but the 4 byte offset still doesn't work for some reason)
SpeedGeek is offline  
Old 31 December 2014, 18:24   #5
HanSolo
Registered User
 
Join Date: Aug 2014
Location: Gdynia/Poland
Posts: 162
Your patch needs to be run before setpatch or no matter ? (I am using 68060.library and mmu.library by Tomas Richter)
HanSolo is offline  
Old 31 December 2014, 19:49   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
From txt file:
Quote:
- Add it to your startup-sequence (after Setpatch)
OR
- Execute it from the shell
daxb is offline  
Old 02 January 2015, 17:06   #7
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
Quote:
Originally Posted by HanSolo View Post
Your patch needs to be run before setpatch or no matter ? (I am using 68060.library and mmu.library by Tomas Richter)
I run the patch before Setpatch as one of the tests I perform before releasing it but that's not the recommended use. Commodore really intended Setpatch to be the first patch that's run in your s-s and there are some good reasons for this.

Sometimes, it's necessary to run another patch before Setpatch (e.g. you have non-autoconfig Fast RAM to be added, or you use vbak2091 which needs to be run before any NSD config stuff). But none of the above apply to CMQ&S so the recommended use is the preferred use.
SpeedGeek is offline  
Old 05 January 2015, 18:09   #8
Retrofan
Ruler of the Universe
 
Retrofan's Avatar
 
Join Date: Mar 2010
Location: Lanzarote/Spain
Posts: 6,185
Hi SpeedGeek.I've just seen this. I am actually using CopyMem by Matt Hey. Does it substitute it?
Retrofan is offline  
Old 06 January 2015, 16:14   #9
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
Hi Retrofan,

CMQ&S is an alternative CMQ patch. Whether or not it would be a good substitute for any other patch is a matter of opinion and really depends on what your looking for.
SpeedGeek is offline  
Old 06 January 2015, 21:42   #10
Retrofan
Ruler of the Universe
 
Retrofan's Avatar
 
Join Date: Mar 2010
Location: Lanzarote/Spain
Posts: 6,185
Thanks a lot SpeedGeek. Yes, I've been reading and it seems there isn't a complete unanimity about it's convenience yet and also the benefits can depend on the hardware.

Thanks anyway for working on it.
Retrofan is offline  
Old 12 January 2015, 00:26   #11
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
** 2ND NEWS UPDATE **

CMQ&S v1.6 released
v1.6 minor change
- fixed install code which could (but seldom ever did) trash a few bytes
of memory past the end of the patch

Last edited by SpeedGeek; 05 July 2020 at 13:42.
SpeedGeek is offline  
Old 22 January 2015, 16:33   #12
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
** 3RD NEWS UPDATE **

Deleted post.

Last edited by SpeedGeek; 05 July 2020 at 13:42.
SpeedGeek is offline  
Old 04 July 2020, 14:49   #13
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
** 4TH NEWS UPDATE **

CMQ&S040 has been removed and all related posts deleted. CMQ&S was originally developed as "Proof of Concept" code for low memory systems. Since 040+ systems typically have much more memory than 020-030 systems it's really not practical for such systems. CMQ&B040 should be more practical in this case.

Here is the link:

http://eab.abime.net/showthread.php?t=76777

Last edited by SpeedGeek; 04 July 2020 at 14:59.
SpeedGeek 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
Copymem Quick & Big Released! SpeedGeek Coders. System 23 08 January 2024 00:06
Quick help with keyboard VresiBerba support.Hardware 12 02 October 2019 11:17
A nice quick small random numbers routine? Photon Coders. General 2 20 December 2004 21:56
A Quick Question Reps Amiga scene 5 27 October 2003 10:42
Just a quick Question ! RetroMan project.SPS (was CAPS) 4 08 April 2003 11:00

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 10:26.

Top

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