mirror of https://gitee.com/bigwinds/arangodb
attempt to speed up dumper
This commit is contained in:
parent
e3b7be5c7a
commit
5be32e9fe5
|
@ -152,11 +152,11 @@ void RestBaseHandler::writeResult(arangodb::velocypack::Slice const& slice,
|
|||
|
||||
_response->setContentType(HttpResponse::CONTENT_TYPE_JSON);
|
||||
try {
|
||||
//arangodb::basics::VelocyPackDumper dumper(&(_response->body()), &options);
|
||||
//dumper.dumpValue(slice);
|
||||
VPackStringBufferAdapter buffer(_response->body().stringBuffer());
|
||||
VPackDumper dumper(&buffer, &options);
|
||||
dumper.dump(slice);
|
||||
arangodb::basics::VelocyPackDumper dumper(&(_response->body()), &options);
|
||||
dumper.dumpValue(slice);
|
||||
//VPackStringBufferAdapter buffer(_response->body().stringBuffer());
|
||||
//VPackDumper dumper(&buffer, &options);
|
||||
//dumper.dump(slice);
|
||||
} catch (std::exception const& ex) {
|
||||
generateError(GeneralResponse::ResponseCode::SERVER_ERROR, TRI_ERROR_INTERNAL, ex.what());
|
||||
} catch (...) {
|
||||
|
|
|
@ -425,14 +425,7 @@ void VelocyPackDumper::dumpValue(VPackSlice const* slice, VPackSlice const* base
|
|||
case VPackValueType::String: {
|
||||
VPackValueLength len;
|
||||
char const* p = slice->getString(len);
|
||||
if (len == 0) {
|
||||
int res = TRI_AppendString2StringBuffer(buffer, "\"\"", 2);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
} else {
|
||||
appendString(p, len);
|
||||
}
|
||||
appendString(p, len);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue