Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!wsmith From: wsmith@m.cs.uiuc.edu Newsgroups: comp.arch Subject: Re: String lengths Message-ID: <3300052@m.cs.uiuc.edu> Date: 7 Feb 89 04:23:00 GMT References: <762@atanasoff.cs.iastate.edu> Lines: 16 Nf-ID: #R:atanasoff.cs.iastate.edu:762:m.cs.uiuc.edu:3300052:000:686 Nf-From: m.cs.uiuc.edu!wsmith Feb 6 22:23:00 1989 On using machine string instructions for performing things such as index() that need the length of the string ahead of time... On the 80x86 family of chips, I believe it is possible for a routine to beat the fancy string instructions with clever coding that does not need the length of the string so that the index() subroutine does not average O(length), but instead much less than that when the pattern is near the beginning. Certainly on some of the low end VAXes this was true also because the special string instructions were executed by software. Just because they give a special instruction, doesn't mean you have to use it. Bill Smith wsmith@cs.uiuc.edu uiucdcs!wsmith