do not call queue.size directly, too expensive