increase doc size limit to 1MB, improve doc iterater performance