4 ms·
cool project. However, the callback has an odd interface. why not pass a universal ref T&& vs a const T& most of your code is like this. ``` auto resp =
by agallego 8y ago
cool project.
However, the callback has an odd interface.
why not pass a universal ref T&& vs a const T&
most of your code is like this.
```
auto resp = HttpResponse::newHttpJsonResponse(json);
callback(resp);
```
which means callback can reuse the buffer if it wanted to rather than making a copy because it's const ref.
PS: did you benchmark it against Folly/Proxygen (facebook) and Seastar
- an-tao 8y agoGood question! If the type of the parameter of callback is an r-reference, users must move resp into the callback. Note that the resp is a shared_ptr, which means callback can reuse the buffer or do anything to the resp object and copying smart pointers does not require too much cost.
- an-tao 8y agoFor benchmarking I have submitted it to the famous TFB and I am waiting for the result of testing round 18. https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/C%2B%2B/drogon https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...