Use fmt and std::from_chars to make convert integer to string and convert string to integer more efficient (#6361)
* [Optimize] optimize the speed of converting integer to string * Use fmt and std::from_chars to make convert integer to string and convert string to integer more efficient Co-authored-by: caiconghui <caiconghui@xiaomi.com>
This commit is contained in:
@ -284,11 +284,8 @@ Status ODBCConnector::append(const std::string& table_name, RowBatch* batch,
|
||||
break;
|
||||
}
|
||||
case TYPE_LARGEINT: {
|
||||
char buf[48];
|
||||
int len = 48;
|
||||
char* v = LargeIntValue::to_string(
|
||||
reinterpret_cast<const PackedInt128*>(item)->value, buf, &len);
|
||||
fmt::format_to(_insert_stmt_buffer, "{}", std::string(v, len));
|
||||
fmt::format_to(_insert_stmt_buffer, "{}",
|
||||
reinterpret_cast<const PackedInt128*>(item)->value);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user