summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwl <wl>2010-12-26 10:43:35 +0000
committerwl <wl>2010-12-26 10:43:35 +0000
commit25a3956d72974ecdf857bd6130ac4b1fc48f4421 (patch)
treeb35dfdc433c347112bb3ab65af857dee31ee0107
parent5b4d44cedd5d3fa3d6149ad75e30d0ea0e987559 (diff)
downloadgroff-25a3956d72974ecdf857bd6130ac4b1fc48f4421.tar.gz
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.
-rw-r--r--ChangeLog12
-rw-r--r--src/include/ptable.h4
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 213ecf0e..afc42771 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-26 Werner LEMBERG <wl@gnu.org>
+
+ 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.
+
2010-12-20 Werner LEMBERG <wl@gnu.org>
Replace patch from 2010-12-18 with a much faster implementation.
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: \