Unnecessary copy of request body in multipart message #838
Labels
discussion
The viability / implementation of the issue is up for debate
feature
Code based project improvement
When troubleshooting memory usage of our application using this library, I found that
crow::multipart::message
stores a copy of the uploaded multipart data that is already present in thecrow::request
.This seems unnecessary, as (according to my understanding of the spec (https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html) multipart data is not encoded, so it could simply reference the data in the
crow::request
.This would significantly lower memory consumption of the request handlers when dealing with huge multipart file uploads.
Would you accept a
string_view
-based multipart message/parser to replace or complement the current one?I have a working prototype that uses
std::string_view
from C++17 STL that I could contribute.But as I understand, this library promises C++11 compatibility, so it is necessary to use a different implementation. Would you prefer using some existing string_view implementation or directly re-implementing one inside Crow itself?
The text was updated successfully, but these errors were encountered: