Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #906

Parallelhashlist was updated to version 1.41 ...

From "aminer" <aminer@videotron.ca>
Newsgroups comp.programming.threads, comp.programming
Subject Parallelhashlist was updated to version 1.41 ...
Date 2012-05-30 18:34 -0500
Organization A noiseless patient Spider
Message-ID <jq67al$4i9$1@dont-email.me> (permalink)

Cross-posted to 2 groups.

Show all headers | View raw


Hello all,


I have updated parallelhashlist to version 1.41..


I have modified parallelhashlist to use 128 locks, but you
have to use a hashsize in power of 2 and greater to 1000,
how do you pass a hashsize in power of 2  to the constructor?
by using shl operation like this


trait:=TCaseinsensitiveTraits.create;;
hash1:=TParallelHashList.create(trait,1 shl 25);


Why do you have to use a power of 2 ?


Please read this:


Power-of-Two Hash Table Size


"Any data structures 101 book will say choose a prime for the
number of buckets, so that the bucket's index can easily be computed
by h(k) = k mod m, where k is the key value and m is the bucket size.
While this approach is straight-forward, there are a number of issues
with it, including slow modulo performance. ConcurrentHashMap instead
uses a power-of-two rule"

http://work.tinou.com/2008/09/performance-optimization-in-concurrenthashmap.html



I am using modulo functions inside parallelhashlist, and using a number of 
locks
in power of 2, so you have to use hashsize in power of 2 ,  this will make 
the
modulo function of the delphi and freepascal compilers 10X faster.


You can download parallelhashlist version 1.41 from:

http://pages.videotron.com/aminer/




Thank you.

Amine Moulay Ramdane.



Back to comp.programming.threads | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-05-30 18:34 -0500
  Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-05-30 18:38 -0500
  Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-05-30 18:46 -0500
  Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-06-02 18:38 -0500
    Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-06-02 18:52 -0500
      Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-06-02 18:56 -0500
  Re: Parallelhashlist was updated to version 1.41 ... "aminer" <aminer@videotron.ca> - 2012-06-02 18:40 -0500

csiph-web