Merge pull request #7187 from minggo/performance-improve

use reference instead
use reference instead
Merge pull request #7190 from minggo/perf-improve

use reference instead