On Tuesday, 5 November 2013 at 19:53:53 UTC, Walter Bright wrote:
On 11/5/2013 2:05 AM, Chris wrote:
He also told me about the rule of diminishing returns*. If with well written C program you can get 90% of assembly's performance, leave it at that. If you wanna get the remaining 10% and use assembly instead, the cost of it may not be
worth the returns.

That wasn't really true for 16 bit DOS programs. There was a much greater return for ASM programs - not just speed, but a large size reduction. The latter was critical because of the tight memory constraints.

I have to admit that I know next to nothing about the old 16 bit DOS programs, and not much about ASM. I'm sure that size reduction was critical in 16 bit times. However, and that's what my old man was talking about, once a programmer left the company, they could bin the program, because only the author knew what was really going on. The new programmer had to start from scratch. It was not just about performance, maintenance was also an issue. And as regards performance, he told me that many ASM programmers would use the same instruction sets over and over again. They didn't want to use new or smarter, more efficient instructions. This was partly down to habit/laziness and partly to fear of messing up the program. So the performance gain wasn't really there, and after a few years a good C compiler could probably create better code than ASM with old and suboptimal instructions.

But I agree, it's good to know what's going on under the hood, how memory works. I remember a talk by a guy from YouTube. He pointed out that young programmers fresh from college are used to 2GB memory and Java, only to find out that youtube has fierce memory restrictions.

Reply via email to