[Bug 847894] improve typing performance [r=crdlc]