-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
help wantedExtra attention is neededExtra attention is neededhigh priorityhigh priority problemshigh priority problemsperformance issuePerformance of project is being affectedPerformance of project is being affected
Description
At the C++ level, isValid and parse do exactly the same work. This is obvious from the code in this wrapper:
bool simdjson::isValid(std::string_view p) {
ParsedJson pj = build_parsed_json(p);
return pj.isValid();
}Versus
Napi::Object simdjson::parse(Napi::Env env, std::string_view p) {
ParsedJson pj = build_parsed_json(p);
if (!pj.isValid()) {
Napi::Error::New(env, "Invalid JSON Exception").ThrowAsJavaScriptException();
}
ParsedJson::iterator pjh(pj);
return simdjson::makeJSONObject(env, pjh).As<Napi::Object>();
}However, in simdjson_nodejs, parse is at least 20x slower than isValid. This indicates that the running time is entirely dependent on makeJSONObject.
This function is written in a sensible manner but it is nevertheless quite slow. Evidently, this defeats the purpose of the fast parsing.
I would say it is a priority to fix this performance issue. It seems that there would be different valid ways to go about it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededhigh priorityhigh priority problemshigh priority problemsperformance issuePerformance of project is being affectedPerformance of project is being affected