performance optimization for TsdGrid