drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.44k stars 1.1k forks source link

If Drogon is made of C++ how it can be weak in Json-Sterilization #1897

Closed allcpu closed 8 months ago

allcpu commented 8 months ago

When I was comparing Drogon with other in Json-Sterilization I was not understanding how Drogon can rank less in it

image

What might be cause of it and will it be improved in feature since Drogon is so strong in other feature then why can't it be in Json-Sterilization.

johnpark0102 commented 8 months ago

Drogon uses jsoncpp as its JSON handler library by default.

Switching jsoncpp into nlohman or rapidjson may improve its performance, but it could break Drogon's backward compatibility since Drogon provides jsoncpp's JSON object(JSON::Value) from requests or responses.

You can specialize from_request or to_response template classes to switch Drogon's Json handler to another, but I guess benchmarks like above will not run tests that way.

Also, there's a discussion regarding Drogon 2.0 on switching Drogon's JSON library to another.

rbugajewski commented 8 months ago

@johnpark0102 Thanks for your summary.

Please continue the discussion on the already mentioned discussion (#682) where the same topic is discussed. I will close this discussion in order to reduce duplicates.