caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] int hash
@ 2004-07-14  9:33 skaller
  2004-07-14 12:16 ` [Caml-list] " Julian Brown
  0 siblings, 1 reply; 6+ messages in thread
From: skaller @ 2004-07-14  9:33 UTC (permalink / raw)
  To: caml-list

I'm currently using a lot of hashtables with
sequentially allocated integers as keys.

It occurs to me a custom hash function just
masking in the low n bits would be a good hash
function, and very fast, assuming n is chosen
suitably and related somehow to the table
size. (size=2^n?) .. any comments on the performance
of a hashtable with such a hash function?

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Caml-list] Re: int hash
  2004-07-14  9:33 [Caml-list] int hash skaller
@ 2004-07-14 12:16 ` Julian Brown
  2004-07-14 14:27   ` skaller
  2004-07-14 15:32   ` henri dubois-ferriere
  0 siblings, 2 replies; 6+ messages in thread
From: Julian Brown @ 2004-07-14 12:16 UTC (permalink / raw)
  To: caml-list

On 2004-07-14, skaller <skaller@users.sourceforge.net> wrote:
> I'm currently using a lot of hashtables with
> sequentially allocated integers as keys.

Could you not use DynArray from ExtLib instead?

Julian

-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Re: int hash
  2004-07-14 12:16 ` [Caml-list] " Julian Brown
@ 2004-07-14 14:27   ` skaller
  2004-07-14 14:46     ` Richard Jones
  2004-07-14 15:32   ` henri dubois-ferriere
  1 sibling, 1 reply; 6+ messages in thread
From: skaller @ 2004-07-14 14:27 UTC (permalink / raw)
  To: brown; +Cc: caml-list

On Wed, 2004-07-14 at 22:16, Julian Brown wrote:
> On 2004-07-14, skaller <skaller@users.sourceforge.net> wrote:
> > I'm currently using a lot of hashtables with
> > sequentially allocated integers as keys.
> 
> Could you not use DynArray from ExtLib instead?

For some things .. not necessarily this one .. DynArray
would be great .. but it creates a dependence on an
unstable third party LGPL'd library. I can neither
lift the relevant code (due to the licence),
nor lightly require my clients install that library
just to build my product. [I have seriously considered
requiring ExtLib]

BTW: I should explain the hashtables map
"arbitrary" subsets of the first n integers,
where n grows as time goes on 
(fresh variable' generator),
and there are a quite a few of these tables
built (its a compiler, there is a table for
every symbol representing its children).

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Re: int hash
  2004-07-14 14:27   ` skaller
@ 2004-07-14 14:46     ` Richard Jones
  2004-07-14 21:29       ` skaller
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Jones @ 2004-07-14 14:46 UTC (permalink / raw)
  Cc: caml-list

On Thu, Jul 15, 2004 at 12:27:50AM +1000, skaller wrote:
> For some things .. not necessarily this one .. DynArray
> would be great .. but it creates a dependence on an
> unstable third party LGPL'd library. I can neither
> lift the relevant code (due to the licence),
> nor lightly require my clients install that library
> just to build my product. [I have seriously considered
> requiring ExtLib]

I almost consider ExtLib to be part of "standard OCaml", along with
PCRE.  It's easier just to have both installed whenever I set up a new
machine with OCaml, than to have to worry about writing the extra code
to simulate functionality already in ExtLib.

(I also have my own mini-library which is installed everywhere by
default, but I'm trying to push most of that code into ExtLib :-)

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
http://www.winwinsales.co.uk/ - CRM improvement consultancy

-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Re: int hash
  2004-07-14 12:16 ` [Caml-list] " Julian Brown
  2004-07-14 14:27   ` skaller
@ 2004-07-14 15:32   ` henri dubois-ferriere
  1 sibling, 0 replies; 6+ messages in thread
From: henri dubois-ferriere @ 2004-07-14 15:32 UTC (permalink / raw)
  To: brown; +Cc: caml-list

Dynarray looks great but is possibly not rock solid at this point.
(last i used it was in a long running simulation which ended up
segfaulting while in the dynarray code - unfortunately i was unable to
get an easily reproducible case).

henri

On Wed, 14 Jul 2004 12:16:39 +0000 (UTC), Julian Brown
<brown@cs.bris.ac.uk> wrote:
> On 2004-07-14, skaller <skaller@users.sourceforge.net> wrote:
> > I'm currently using a lot of hashtables with
> > sequentially allocated integers as keys.
> 
> Could you not use DynArray from ExtLib instead?
> 
> Julian
> 
> 
> 
> -------------------
> 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
>

-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Re: int hash
  2004-07-14 14:46     ` Richard Jones
@ 2004-07-14 21:29       ` skaller
  0 siblings, 0 replies; 6+ messages in thread
From: skaller @ 2004-07-14 21:29 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

On Thu, 2004-07-15 at 00:46, Richard Jones wrote:
> On Thu, Jul 15, 2004 at 12:27:50AM +1000, skaller wrote:
> > For some things .. not necessarily this one .. DynArray
> > would be great .. but it creates a dependence on an
> > unstable third party LGPL'd library. I can neither
> > lift the relevant code (due to the licence),
> > nor lightly require my clients install that library
> > just to build my product. [I have seriously considered
> > requiring ExtLib]
> 
> I almost consider ExtLib to be part of "standard OCaml", along with
> PCRE.  It's easier just to have both installed whenever I set up a new
> machine with OCaml, than to have to worry about writing the extra code
> to simulate functionality already in ExtLib.
> 

That is reasonable for an Ocaml developer (which I am),
but not as clearly reasonable for a *client* of my
code who is probably not. I feel the need to supply
a system consisting of the smallest number of
separately installable components for obvious
reasons: every dependence on a third party component
makes my package fragile. For example, I'd like it
to install on Win32 native.. I don't have control
of third party packages so how do i respond when
a client has a problem?

Note the problem *isn't* the quality of the third
party code! Its sure to be better than mine :)
I have a client that installs my package on 5 different
platforms (his product is a multi-platform game, it runs
on OSX, Linux[both PC and XBox], OS9, Cygwin and Mingw 
at present).

This problem may be substantially corrected by GODI
because it provides a *unified* installation system.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-14 21:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-14  9:33 [Caml-list] int hash skaller
2004-07-14 12:16 ` [Caml-list] " Julian Brown
2004-07-14 14:27   ` skaller
2004-07-14 14:46     ` Richard Jones
2004-07-14 21:29       ` skaller
2004-07-14 15:32   ` henri dubois-ferriere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).