Improve perf for tdtio