improve concat performace by using memcpy instead of string::append