[comp.lang.c] A comment on string instructions in the hardware

BRIAN%UOFT02.BITNET@wiscvm.wisc.edu (03/28/87)

 I'm sure this will come as no surprise to  VAX  C  users,  but  I  have
realized  substantial  savings  in  execution  time by replacing pattern
matching and string copying routines with Macro-32  routines  that  take
advantage  of  the  Vaxen's character instructions. In the global sense,
the speed improvement is minimal, however, the improvements realized  in
the  specific  case  of  pattern  matching appears to the user to make a
search pattern execute in a fraction of the time that a vanilla C coding
would use. This approach is also used in DEC's TPU,  which  uses  inline
Macro-32  escapes  from the Bliss code. When one really gets down to it,
the next level of  improvement  would  come  from  replacing  the  CALLS
overhead with the much faster JSB,  which is not possible in VAX C.  The
overhead from CALLS is substantial.

 Note that in the case of the  VAX,  the  low  end  processors  may  not
realize  this since those machines tend to emulate some of the string op
codes.

Brian Nelson

meissner@dg_rtp.UUCP (03/31/87)

In article <6156@brl-adm.ARPA> BRIAN%UOFT02.BITNET@wiscvm.wisc.edu writes:
> 
>  I'm sure this will come as no surprise to  VAX  C  users,  but  I  have
> realized  substantial  savings  in  execution  time by replacing pattern
> matching and string copying routines with Macro-32  routines  that  take
> advantage  of  the  Vaxen's character instructions. In the global sense,
> the speed improvement is minimal, however, the improvements realized  in
> the  specific  case  of  pattern  matching appears to the user to make a
> search pattern execute in a fraction of the time that a vanilla C coding
> would use.

I don't doubt that you got a speed up, but check out the James Woods
version of egrep (volume 4 in mod.sources, and a newer faster version
promised real soon).  His version (in C, no asm) manages to beat versions
that use the VAX instructions in the general case.  The new version is
supposed to beat the assembly versions in all cases I think.  It runs
ten times faster than the standard System V egrep on my machine (no that
is not a typo!).
-- 
	Michael Meissner, Data General	Uucp: ...mcnc!rti-sel!dg_rtp!meissner

It is 11pm, do you know what your sendmail and uucico are doing?