I wonder, have machines changed at all since 1989? Any new instructions on the 
Z? <g>

The "problem" is fixed in C++ -- Google std:string. 


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Clem Clarke
Sent: Friday, February 2, 2018 4:13 AM
Subject: Re: Fair comparison C vs HLASM

Tests I did in 1989 and earlier showed that the null terminated strings 
are up to 26 times slower that using PL/I and Pascal strings. And they 
are dangerous.

I have put some tests and documentation here: 
http://start.oscar-jol.com/fast-c-strings and an early message about the 
problem here: 

Bill Gates had someone reply to me too, and his company's response is at 
the bottom of this page: http://start.oscar-jol.com/fast-c-strings

Here's a table showing the relative speeds of various copies.  The ASM 
copy refers to the 8086 equivalent of the 370 MVC.

I did do some tests on Z/OS when I worked at IBM - however I am unable 
to find the results now.  They were similar, though!

Essentially, having to search for the binary zero at the end of a string 
to find it's length is costing approximately 20 times more CPU power 
that doing strings the way PL/I, Pascal and other languages utilise 
strings.  In addition, C String methods can (and do) overwrite storage 
accidentally when a long string is copied to a short string.

Let's fix the problem, once and for all!

Reply via email to