🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #543

Re: Speed of Delete - improvement

#543
From: Dr John Stockton
Date: Wed, 19 Nov 1997 00:00
39 lines
2501 bytes
In article <3472819C.218E@short.net> of Tue, 18 Nov 1997 22:05:16 in
borland.public.turbopascal, Mike <internal@short.net> wrote:
>Dr John Stockton wrote:
>> 
>> In article <34717177.6538@short.net> of Tue, 18 Nov 1997 02:44:07 in
>> comp.lang.pascal.borland, Mike <internal@short.net> wrote:
>> >
>> >Here's mine!
>> >
>> >procedure DelSt
>> > ...
>> 
>> A hasty test shows that yours works on reasonable cases, but differs
>> from sys.Delete and mine on pathological ones such as negative inputs.
>> As of course we all expected, the speeds of ours are rather similar.  I
>> guess that which is, on the average, best *might* depend on the nature
>> of the string deletes one wants, e.g. snips or chops.
>
>I purposely excluded pathological cases such as negative inputs. In my 
>case, all calls to the routine are known to be positive.
>
>I'm surprised the speeds turn out to be the same. Yours has a lot more 
>checking for pathological conditions.

I only said "rather similar"; my timing method is inexact but adequate.

Although I have a line of tests, they will code easily and are only done
once; and our Deletes include looping over all the characters shifted.
The Borland one should be faster for removing all but the very ends of a
long string, for which I've just added   DelTest(St, 255,   2, 253) ;  !

Regards,
 
-- 
John Stockton, Surrey, UK.    jrs@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web URL: http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms and links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)
Technical Details
Message-ID: <pA3Y0HAxQzc0Ew8p@merlyn.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <s2qpaAAJUIc0EwPB@merlyn.demon.co.uk> <34717177.6538@short.net> <X9UL4DAzfic0EwJI@merlyn.demon.co.uk> <3472819C.218E@short.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10261c,9e270db731f7d69c
X-Google-Attributes: gid10261c,public
X-Google-Thread: 108ebd,9e270db731f7d69c
X-Google-Attributes: gid108ebd,public
X-Google-Thread: 111659,9e270db731f7d69c
X-Google-Attributes: gid111659,public
From: Dr John Stockton <jrs@merlyn.demon.co.uk>
Subject: Re: Speed of Delete - improvement
Date: 1997/11/19
Message-ID: <pA3Y0HAxQzc0Ew8p@merlyn.demon.co.uk>
X-Deja-AN: 290847102
Distribution: world
X-NNTP-Posting-Host: merlyn.demon.co.uk [158.152.233.145]
References: <s2qpaAAJUIc0EwPB@merlyn.demon.co.uk> <34717177.6538@short.net> <X9UL4DAzfic0EwJI@merlyn.demon.co.uk> <3472819C.218E@short.net>
Organization: Home, Surrey, UK
Newsgroups: comp.lang.pascal.borland,comp.lang.pascal.misc,borland.public.turbopascal