Improve StatusDataWriter performance.

Fixes #5328