Speed optimization while tokenizing