microsoft/cpprestsdk

Inefficiency of http_request::extract_vector() method

开放

#103 创建于 2016年3月24日

 (2 条评论) (0 个反应) (0 位负责人)C++ (1,670 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (7,596 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

I'm looking at using the C++ REST SDK to implement a relatively simple but performance-critical REST server in our project. I've put together a PoC and it all looks good. But I've just hit upon what I think is a major performance issue.

When using the http_request::extract_vector() method, the Task completion routine is passed the retrieved vector by value. Our server will sometimes be posted a large content body (1MB or more). The pass-by-value means that this vector will be copied. This completely removes one of the major advantage of using C/C++ for this kind of work, i.e. the fact that if you know what you're doing, you can avoid the huge amount of copying that can be a bottleneck on platforms like NodeJS.

Am I missing something obvious here or will I have to implement a custom extract_vector_ptr() method myself?

贡献者指南