keep message count in memory until needed

writing to the filesystem is too slow