From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Sat Oct 14 2000 - 10:33:24 EDT
On Sat, Oct 14, 2000 at 12:28:03PM +0000, Bjorn Reese wrote:
> I have attached three files:
>
> hash.c
> hash.h (should be put in include/libxml/)
> hash.diff
>
> The latter contains the patches to Makefile.am and xpath.[hc]
>
> The size of the hash table has been arbitrarily set to 256 (it
> should probably be a prime number instead.)
>
> I have put the hash.[hc] files under the MIT license, but I have
> added Daniel as a copyright holder, which gives him permission
> to change the license if he disagrees. Btw, talking about licenses
> the COPYRIGHT file that all boilerplates are referring to is
> missing from the distribution.
First thanks a lot !
However there are several issues I would like to raise:
- this introduce a binary incompatible change, some data
structures are changed and that a first thing I will have
to correct
- an hash table only makes sense if the pool of object is
clearly larger than the number of entries, and whatever how I
turn the problem, I don't see how i would need to register
250 functions, if you have such an use case please enlighten me
- the function used to compute the hash looks rather costly
you have a multiply and an add per char in the string, I
usually simply compute the sum of all chars in the string
which for a 256 hash size should be good enough.
- the overall memory used for storing the hash table seems a
bit inappropriate in that specific case of the few XPath
functions (but tiny compare to a DOM tree size and other use
of hash tables in libxml).
- adding a new header and C file would only really make sense if
those were reused in multiple places.
I think integrating the patch as is is a bit problematic right now.
But I think it does make sense to try to reuse it to make it the
hash table interfaces used in other parts as well (entities, element/
attributes/notations declarations, and the XPath registry).
I hope that you won't take offense if I don't integrate it for
2.2.5, I think I will reuse it but as explained in a larger context :-)
thanks,
Daniel
-- Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | Today's Bookmarks : Tel : +33 476 615 257 | 655, avenue de l'Europe | Linux XML libxml WWW Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind http://www.w3.org/People/all#veillard%40w3.org | RPM badminton Kaffe ---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
This archive was generated by hypermail 2b29 : Sat Oct 14 2000 - 10:43:28 EDT