Use process.nextTick to avoid max callStack issues.
Memoize the approxdocs count.