From 25a3956d72974ecdf857bd6130ac4b1fc48f4421 Mon Sep 17 00:00:00 2001 From: wl Date: Sun, 26 Dec 2010 10:43:35 +0000 Subject: Speed up troff. * src/include/ptable.h (PTABLE): Make hash tables much more sparse by changing `FULL_NUM' from 3 to 1. This increases the allocated memory by about 200kByte (which is nothing today) but assures that there aren't extremely long searches for a free hash slot in case that the hash function doesn't return a free one. Due to the nature of the entries in uniuni.cpp, the used hash function in ptable.cpp is not optimal, but using a sparse array compensates this. --- src/include/ptable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/ptable.h b/src/include/ptable.h index 829fe5b2..d1a322cf 100644 --- a/src/include/ptable.h +++ b/src/include/ptable.h @@ -86,8 +86,8 @@ class PTABLE(T) { \ unsigned size; \ unsigned used; \ enum { \ - FULL_NUM = 2, \ - FULL_DEN = 3, \ + FULL_NUM = 1, \ + FULL_DEN = 4, \ INITIAL_SIZE = 17 \ }; \ public: \ -- cgit v1.2.1