summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-06 21:34:31 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-06 21:34:31 +0000
commit8ef6371c96cde9fbf1a78af3c9c275c188466bf4 (patch)
treec4559f7b265623bcf3aba5b01108423b7d7960f5 /read.c
parent9c540f5100e97dab38afdf4a27540ed63060348b (diff)
downloadmandoc-8ef6371c96cde9fbf1a78af3c9c275c188466bf4.tar.gz
Another 25% speedup for mandocdb(8) -Q mode, found with gprof(1).
For /usr/share/man, we only need 56% of the time of makewhatis(8) now. In groff, user-defined macros clashing with mdoc(7) or man(7) standard macros are cleared when parsing the .Dd or .TH macro, respectively. Of course, we continue doing that in standard mode to assure full groff bug compatibility. However, in -Q mode, full groff bug compatibility makes no sense when it's unreasonably expensive, so skip this step in -Q mode. Real-world manuals hardly ever redefine standard macros, that's terrible style, and if they do, it's pointless to do so before .Dd or .TH because it has no effect. Even if someone does, it's extremely unlikely to break mandocdb(8) -Q parsing because we abort the parse sequence after the NAME section, anyway. So if you manually redefine .Sh, .Nm, .Nd, or .SH in a way that doesn't work at all and rely on .Dd or .TH to fix it up for you, your broken manual will no longer get a perfect apropos(1) entry until you re-run mandocdb(8) without -Q. It think that consequence is acceptable in order to get a 25% speedup for everyone else.
Diffstat (limited to 'read.c')
-rw-r--r--read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read.c b/read.c
index 0d4f265f..3ada7840 100644
--- a/read.c
+++ b/read.c
@@ -780,7 +780,7 @@ mparse_alloc(enum mparset inttype, enum mandoclevel wlevel,
curp->defos = defos;
curp->quick = quick;
- curp->roff = roff_alloc(inttype, curp);
+ curp->roff = roff_alloc(inttype, curp, curp->quick);
return(curp);
}