Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread slow?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-06-19 (14:45)
From: David Monniaux <David.Monniaux@e...>
Subject: slow?
I used as a comparison function between hash values
(16-byte strings). is a polymorphic hack that works by
induction on the type information left for the garbage collector; even if
you specify : string -> string -> int, it still invokes
the polymorphic function.

There is apparently a 20-25% performance penalty using this form instead
of a simple comparison procedure for 16-byte strings. I suspect the
performance hit is even higher for more complex data structures.

Would it be possible to have ad hoc generated comparison functions? That
sounds like it needs including polytypic features into the language, which
is some very big stuff.

Perhaps including a function would be easier.


David Monniaux  
Laboratoire d'informatique de l'École Normale Supérieure,
Paris, France