improve performance of discarding inactive messages