Use treemap
Improve the pipelining buffer performance