Re: Nat_sort problems

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Mon, 11 Aug 2003 15:47:57 +0000, Andy Serpa <ac at onehorseshy.com>
wrote:

>Aha... is is actually the string designation (use of quotes) that makes=20
>the difference, or just any "byte-sized" sequence of integers?  When you=
=20
>first mentioned it, it was to do with peek(), using {addr,len} where=20
>you've got a 32-bit address and an integer together...
>
I was just trying it Andy, strings are about the same, the following
shows about 75% more iterations per second using the constant:

constant x=3D{'\t','\n','\r'}
integer a,b
atom t
	t=3Dtime()+1
	a=3D0
	while t>time() do
		if find(1,{'\t','\n','\r'}) then
		end if
		a+=3D1
	end while
	t=3Dtime()+1
	b=3D0
	while t>time() do
		if find(1,x) then
		end if
		b+=3D1
	end while
	printf(1,"inline:%d constant:%d ration %g",{a,b,b/a})
if getc(0) then end if

Thanks, it's always handy to know that kind of stuff

Pete
PS I suspect if Rob tried to optimise such cases it would make the
average program slower.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu