kjs math_object micro optimization?

David Faure dfaure at trolltech.com
Mon May 19 13:05:34 BST 2003


On Monday 19 May 2003 12:34, Luciano Montanaro wrote:
> Hi, I have been playing with the create_hash_table '-s' switch for the
> kjs classes, and I have found what I think is probably a typo in the math
> object lookup table definition.
> This is part of the output of the create_hash_table script for
> math_object.cpp:
> 
> The math_object.cpp file defines an hash size of 21, and this is odd,
> since it appears to be a quite bad choice, since it generates 12 collisions.
> A better choice could be an hash size of 23, which could reduce memory usage
> and number of collisions, or 31, which, at the cost of one additional entry in
> the table, reduces the collisions to only 3.

I checked those results initially, but not every time we add a new property :)
Feel free to commit, but I don't think the Math object is accessed _that_ often,
that it will really make any speed difference?

-- 
David FAURE, faure at kde.org, sponsored by TrollTech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list