Welcome, Guest. Please login or register.

Author Topic: CopyMem Quick & Small released!  (Read 14383 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« on: December 30, 2014, 07:31:28 PM »
Quote from: psxphill;780726

I'm not convinced that you ever see a real world improvement with these patches. I don't remember my Amiga copying memory constantly, the entire OS design is based around never copying. A lot of software has it's own memcpy() and doesn't use exec anyway because the overhead of calling into exec when you're copying small amounts of data is not worth it.


Many RTG-based games use CopyMem() because they manage directly with ARGB/LUT buffers and copy data around. Those could be good candinate for benchmarking CopyMem() patches in real life.

But of course... if CPU is too slow it is too slow and no patch can help it.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #1 on: January 03, 2015, 09:25:01 PM »
Quote from: Thorham;780991
However, I would write my own text blitting routine if I were to write a text editor, for example. The OS simply uses the blitter, hence the reason for FBlit and FText making a real difference (also, double scan modes).


That would suck badly if antialiasing text was introduced to AmigaOS.

But of course, there wont be new AmigaOS. Hence patches are "future safe". (Not taking "NG" to discussion here.)
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #2 on: January 06, 2015, 11:59:46 PM »
Quote from: psxphill;781156
I've heard that argument before and I don't buy it. If it's easily possible to write code that can render text faster then you should do that, because there are easily situations where an average editor is too slow. Like if you're running something reasonably intensive in the background.


If you are running something CPU intensive in the background, like compiling large project with GCC, all you need is a good scheduler.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #3 on: January 07, 2015, 08:31:52 AM »
Quote from: matthey;781162
The Amiga philosophy has always been about efficiency and not just replacing the CPU with a faster one.


Wrong... When Amiga/Commodore was at its height everyone needing better performance replaced the CPU with a faster one. Now 68k CPU family has ceased and the best CPU available is 20 years old.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #4 on: January 07, 2015, 01:17:37 PM »
Quote from: psxphill;781171
A good scheduler would be nice, however it doesn't solve the problem. If your text editor was written by someone who thinks it doesn't matter if it needs 100% cpu as long as it's fast enough to keep up with you typing, the scheduler will allow the text editor to be responsive but now your GCC builds get no CPU time at all.


So what? GCC gains CPU time again when you stop typing.

Quote
There is a point where optimising further makes no sense, but giving up when something is just barely fast enough to keep up with a slow typist is not that point.


I probably would optimize it as much as possible but rationally it makes no sense. Most developers optimize code only for fun. To see how fast it can run but it rarely gives anything back. In commercial software development they are often money pits...

...unless you are going to add intellisense kind of features to 68k class systems. Then you might want to skip OS routines to cram more features to your software package.

Quote

As for a good scheduler, it would be nice if this was open sourced.
http://aminet.net/package/util/misc/Executive

At least it's now free http://aminet.net/package/util/misc/Executive_key
 
 The problem of course is it's another patch....


It is very good but it works against documented behaviour so some software may just lock up. But multitasking was so much smoother on my A1200 that I didnt care. I recall utilities were written in C but scheduler is pure 68k asm.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #5 on: January 07, 2015, 02:59:50 PM »
Quote from: psxphill;781179
Why should you have to stop typing?


Dont stop if there is still more text coming. However, you must be pretty good coder to type so quickly that GCC never got any CPU time.

Quote
Also the text editor could use 100% cpu all the time and still fit the requirement of being "fast enough because it keeps up with your typing".


That is just multitasking unfriendly editor. It is different requirement.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #6 on: January 11, 2015, 10:36:43 AM »
Quote from: psxphill;781473
No it is exactly the same requirement as the text editor being able to use as much of your cpu as it wants as long as it can keep up with your typing. If you have other secret requirements that are obvious to you then you should specify them.


I thought it was obvious to you that Amiga software should not use busy loops when doing nothing.
 
Quote
There may be software running in the background that needs to run at a high priority so that only 50% of cpu is left. The text editor needing 100% of cpu to keep up with typing is now unable to keep up with your typing.


It is matter of evaluating ROI (return of investment). If it is slow for everyone then it might be necessary to optimize. But if it is slow only for one or few users, maybe I would spend my time elsewhere.

Quote
I'm using quite extreme examples because it makes the maths easier,


Sure, I got that.

Quote

I understand that you can't practically optimise everything completely and there is an upper limit on the cpu resources available.


It is also how much resources you allocate to optimizations versus new features. You can have ultimately optimized fast text editor but poor in features. Or you can have feature rich text editor that is too slow to use. Or you can try to find balnace with optimizations and features.

Quote

There are other vague issues like not saying how big the document is when you measure if it's able to keep up. A text editor that is designed for editing large documents will be able to insert and delete text in the middle without CopyMem()'ing the rest of the document around every time you type a character. On windows I regularly edit text files 100's of megabytes in size.


If you choose your algorithm wisely text editor scales up to GB documents easily.

Interestingly, the original Ed found from Workbench 1.3 does not. On Amiga 500 it could not handle even 50 kB text files very well. There was always noticeable lag when inserting new line.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #7 on: January 11, 2015, 06:20:58 PM »
Quote from: Thorham;781482
What an absolutely horrible editor that Ed thing :(

It is not. If there were not such limits (slowness and max text length) it does its job. I cant remember any of its commands anymore (perhaps esc+x, was it save and quit?) but I used it for a while for coding until I found DME.

@olsen
Quote
We can only judge the design from today's point of view. Nobody sets out to write a slow, restricted text editor. What drove the design must have made great sense at the time "Ed" was written, but it did not hold up. I suppose even by 1985 the limitations may have become hard to bear.

For coding its limitations are hard to bear but it was still good to edit startup-sequence or create small text files. After all it was not easy to find replacement text editor... such thing had to be ordered by snail mail from shaddy PD distributors.
« Last Edit: January 11, 2015, 06:24:47 PM by itix »
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #8 on: January 12, 2015, 07:20:34 AM »
Quote from: Thorham;781498
Ed is a crappy editor, period. Why defend the damned thing? If it's so good, then how come no one really uses it for anything? The answer is because it sucks.

Just because some software is old doesn't mean that higher standards don't apply to it, and the platform it had to run on back then can do much better than that. Especially if you have an A500 with one megabyte of memory there's absolutely no reason whatsoever to use Ed.

Really, defending Ed? Why?


Why not? I could download DME and use it on my Amiga 500 but why bother? For quick text editing Ed does its job. It works, it is reliable, it is small and it is easy to use if you know the commands. Very simple: open text file, edit, save, quit.

Heck, I am even using Pico occasionally to edit some source code files or configs on Linux.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: CopyMem Quick & Small released!
« Reply #9 on: January 13, 2015, 08:10:59 AM »
Quote from: paul1981;781571
Don't you just love it (not) when Ed gets its knickers in a twist and trashes the top line after saving? Whenever I edit anything with Ed, I always make sure to leave the top line blank or use a ';' just in case it decides to trash it.
I like BED (Blacks Editor).


Me too. I have used BED about 20 years now. I have used it so long that using any other editor on Amiga has become difficult to me.

I tried to contact author long time ago to get source code but unfortunately he was not willing to share.
My Amigas: A500, Mac Mini and PowerBook