Perf improvement for kudusync

Did some perf improvements.