简体   繁体   English

使用boost :: asio :: basic_stream_socket :: async_read_some而不是boost :: asio :: async_read更有效吗?

[英]Is it more efficient to use boost::asio::basic_stream_socket::async_read_some instead of boost::asio::async_read?

在高性能数据吞吐量方面,使用boost :: asio :: basic_stream_socket :: async_read_some而不是boost :: asio :: async_read更好吗?

boost::asio::async_read is a composed operation, which is well described in the documentation boost::asio::async_read是一个组合操作,在文档中有详细描述

This operation is implemented in terms of zero or more calls to the stream's async_read_some function, and is known as a composed operation. 此操作是根据对流的async_read_some函数的零次或多次调用实现的,并且称为组合操作。 The program must ensure that the stream performs no other read operations (such as async_read, the stream's async_read_some function, or any other composed operations that perform reads) until this operation completes. 程序必须确保流不执行任何其他读取操作(例如async_read,流的async_read_some函数或执行读取的任何其他组合操作),直到此操作完成。

any performance conclusions should be based on empirical data depending on your application. 任何绩效结论都应该基于经验数据,具体取决于您的应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM