On 22/01/2014 23:35, John Gilmore wrote:

It is of course possible to write snippets of code using only modal
instructions in such a way that "the exact same instruction sequences
are used in both cases"; but it is almost never appropriate to do so;
and I did not do, or say that I had done, that.

Your original statement was "one characteristic of
routines/instructions executed above the bar [is] they
are measurably faster than their analogues executed below it."

I think most people would assume that you were referring to the same code, and the critical point was whether it was above/below the bar - or at most the AMODE or RMODE.

If you are saying you can write faster code using 64 bit instructions I would expect it is possible. I would also expect it is possible to write slower code. Measured differences are not necessarily inherent characteristics of 64 bit instructions if the code is changed.

With code changes, a few percent change in speed could easily be caused by e.g. a resulting difference in branch prediction rather than inherently faster instructions. You can't draw a conclusion about what made the code faster. As the hardware person said, "All bets are off".

In fact, I suspect (but don't actually know) that real-world code might be slightly slower using 64 bit instructions because larger data and operands make less effective use of processor cache.

I think it may be conceded out of hand that binary search is faster
than linear search

Even that I'm not sure is universally true. I suspect processor branch prediction is difficult for binary search, so a linear search where branches are predictable may be better for small lists. Where the cutoff is I don't know.

I have seen a (non-z/OS) example where randomizing the data to defeat branch prediction made the same code take 6x longer. One hypothesis to test might be that linear search would be faster if the average number of comparisons was less than ~5 times the number required for binary search.

Comparing the speed of actual instructions is not very useful. The sequence of instructions is more important, and specifically their effect on processor cache, pipeline and branch prediction (plus other factors I'm sure).

Regards

Andrew Rowley

--
and...@blackhillsoftware.com
+61 413 302 386

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to