Re: Different string format options, benefits?

bliss@sp64.csrd.uiuc.edu (Brian Bliss)
Tue, 5 Nov 91 19:25:54 GMT

          From comp.compilers

Related articles
[3 earlier articles]
Re: Different string format options, benefits? agulbra@Siri.Unit.NO (1991-10-18)
Re: Different string format options, benefits? db@dcs.ed.ac.uk (Dave Berry) (1991-10-20)
Re: Different string format options, benefits? tm@well.sf.ca.us (1991-10-22)
Re: Different string format options, benefits? buzzard@eng.umd.edu (1991-10-25)
Re: Different string format options, benefits? henry@zoo.toronto.edu (1991-10-25)
Re: Different string format options, benefits? sdm7g@aemsun.med.virginia.edu (1991-11-01)
Re: Different string format options, benefits? bliss@sp64.csrd.uiuc.edu (1991-11-05)
Re: Different data structure (was: string) format options, benefits? kevin@simd.stanford.edu (1991-11-05)
String formats macrakis@osf.org (1991-11-06)
| List of all articles for this month |
Newsgroups: comp.compilers
From: bliss@sp64.csrd.uiuc.edu (Brian Bliss)
Keywords: code, optimize
Organization: UIUC Center for Supercomputing Research and Development
References: 91-10-061 91-10-077
Date: Tue, 5 Nov 91 19:25:54 GMT

In article 91-10-061 coxs2@rpi.edu (Sean C. Cox) writes:
>I am curious about the benefits/costs related to the two general character
>string formats [null terminated vs. counted]


Certainly using the length string format is better on any computer
with any type of concurrency. A test for zero termination creates
a loop dependency, whereas most string operations can be vectorized/
concurrentized if the length is known beforehand. Even if the machine
only has a data prefetch mechanism, one must know that fetching the value
of the next byte will not cause a core dump. Even if the machine is
purely sequential, knowing the length beforehand allows one to
perform word-size data fetches, instead of byte-by-byte (you can do
this and check for zero-termination, too, but the code is a lot
uglier).


bb
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.