some performance improvements

Signed-off-by: zwliew <zhaoweiliew@gmail.com>