Improved performance of filters.do_truncate()