Performance tuning: avoid frequent frequency computing by maintenance of counts.