summaryrefslogtreecommitdiffstats
path: root/mansearch_const.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-10 02:46:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-10 02:46:21 +0000
commit2f4e06cbd2a887b4a85880dbcb59c36fb93535d2 (patch)
tree0c53eeb19990a0776312f7a538f10d33399f9c24 /mansearch_const.c
parent31583f54660e373832d0fc36eaa2005e7e836229 (diff)
downloadmandoc-2f4e06cbd2a887b4a85880dbcb59c36fb93535d2.tar.gz
Next speed optimization step for the new apropos(1).
Split manual names out of the common "keys" table into their own "names" table. This reduces standard apropos(1) search times (i.e. searching for names and descriptions only) by typically about 70% for the full /usr/share/man database. (Yes, that multiplies with the previous optimization step, so both together have reduced search times by a factor of more than six. I'm not done yet, expect more to come.) Even with the minimal databases built with makewhatis(8) -Q, this step still reduces search times by 15-20%. For both cases, database sizes and build times hardly change (+/-2%).
Diffstat (limited to 'mansearch_const.c')
-rw-r--r--mansearch_const.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mansearch_const.c b/mansearch_const.c
index cfa9b6c3..b6d37fdb 100644
--- a/mansearch_const.c
+++ b/mansearch_const.c
@@ -20,13 +20,12 @@
#include "manpath.h"
#include "mansearch.h"
-const int mansearch_keymax = 41;
+const int mansearch_keymax = 40;
-const char *const mansearch_keynames[41] = {
- "NAME", "Nm", "arch", "sec", "Xr", "Ar", "Fa", "Fl",
- "Dv", "Fn", "Ic", "Pa", "Cm", "Li", "Em", "Cd",
- "Va", "Ft", "Tn", "Er", "Ev", "Sy", "Sh", "In",
- "Ss", "Ox", "An", "Mt", "St", "Bx", "At", "Nx",
- "Fx", "Lk", "Ms", "Bsx", "Dx", "Rs", "Vt", "Lb",
- "Nd"
+const char *const mansearch_keynames[40] = {
+ "arch", "sec", "Xr", "Ar", "Fa", "Fl", "Dv", "Fn",
+ "Ic", "Pa", "Cm", "Li", "Em", "Cd", "Va", "Ft",
+ "Tn", "Er", "Ev", "Sy", "Sh", "In", "Ss", "Ox",
+ "An", "Mt", "St", "Bx", "At", "Nx", "Fx", "Lk",
+ "Ms", "Bsx", "Dx", "Rs", "Vt", "Lb", "Nm", "Nd"
};