From: Christophe TROESTLER <debian00@tiscali.be>
To: matth@cs.berkeley.edu
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] equality testing in 3.08
Date: Mon, 02 Aug 2004 11:50:40 +0200 (CEST) [thread overview]
Message-ID: <20040802.115040.130527572.debian00@tiscali.be> (raw)
In-Reply-To: <200408020151.i721pCLL012876@relay0.EECS.Berkeley.EDU>
On Sun, 1 Aug 2004, "Matt Harren" <matth@cs.berkeley.edu> wrote:
>
> 1) Our application runs 9% slower because comparison isn't as
> efficient. When x == y, checking "x = y" takes time proportional to
> the size of the structure, instead of constant time.
I do not know what you are comparing but maybe a custom comparison
function would make things even faster? As an example,
min : 'a -> 'a -> 'a
and
let min' x y = if (x:int) < y then x else y
have (very) different speed characteristics!
> 2) We've been cheating and using (=) on structures that may be cyclic.
Same: why don't you define the meaningful equality? Sure, you do not
have the convenience of the name "=" but you can use "===", "=^=",
"=~=",... This probably would also make your software easier to
understand (the "strange" comparison on cyclic structures would be
made explicit).
Regards,
ChriS
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
prev parent reply other threads:[~2004-08-02 11:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-02 1:54 Matt Harren
2004-08-02 9:50 ` Christophe TROESTLER [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040802.115040.130527572.debian00@tiscali.be \
--to=debian00@tiscali.be \
--cc=caml-list@inria.fr \
--cc=matth@cs.berkeley.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox