improve performance for "endless" documents