1. using compare

[to anyone who has tried to send me any personal e-mail recently - my e-mail
got mangled, and kept looping on Jesse Kint's message... now I don't seem to
be able to get stuff from the Euphoria server, and so I have to check the
archives for posts. sad ]

Jiri wondered:

> I just want to know why you stubbornly and wastefully use
> the despised compare() function even when both arguments
> are integers?

Ouch. blink

You are certinly right about the "despised" portion - I hate doing work
that's easily done by the compiler. But I've gotten burned so often by
accidentally using '=' that I use 'compare' out of habit.

But is 'compare' that inefficient? I would imagine that Robert could fairly
easily check the args and make it as efficient as '=' if he wanted to (is
this already being done?). That might be a nice feature for people like me
that are "wasteful" in not optimizing their code.

Thanks.

-- David Cuny

new topic     » topic index » view message » categorize

2. Re: using compare

David,

This morning, after I saw your testy response to my impulsive last
night note, I went back and checked it again. It sounds stupid now.
You must know I did not mean to imply anything else than what it says.
Compare tests do take at least twice as long as a simple equality
test, but it is really a very small difference, unless it happens in
an innermost loop of a frequently used routine. I also dislike the
name of the routine, probably even more than you do. Sorry. jiri

-----Original Message-----
From: David Cuny <dcuny at LANSET.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Sunday, November 15, 1998 7:06 AM
Subject: using compare


>[to anyone who has tried to send me any personal e-mail recently - my
e-mail
>got mangled, and kept looping on Jesse Kint's message... now I don't seem
to
>be able to get stuff from the Euphoria server, and so I have to check the
>archives for posts. sad ]
>
>Jiri wondered:
>
>> I just want to know why you stubbornly and wastefully use
>> the despised compare() function even when both arguments
>> are integers?
>
>Ouch. blink
>
>You are certinly right about the "despised" portion - I hate doing work
>that's easily done by the compiler. But I've gotten burned so often by
>accidentally using '=' that I use 'compare' out of habit.
>
>But is 'compare' that inefficient? I would imagine that Robert could fairly
>easily check the args and make it as efficient as '=' if he wanted to (is
>this already being done?). That might be a nice feature for people like me
>that are "wasteful" in not optimizing their code.
>
>Thanks.
>
>-- David Cuny
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: using compare

Jirir wrote:

>This morning, after I saw your testy response to my impulsive last
>night note, I went back and checked it again. It sounds stupid now.

No insult taken. You were right; I was on auto-pilot when I wrote the code.
I saw and_bits() and replaced it with what I thought was an equivalent
function.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu