這個問題實際上是我發佈的a previous question的更新。從用戶的意見,我意識到我需要剖析我的代碼,所以我通過Vtune Amp來分析我的代碼的第一部分。和我相比於其它方法用更快的方法代替這些方法
Source Line Source CPU Time by Utilization Overhead Time Spin Time
double high_val = atof(temp[2].c_str());
std::string s((std::istreambuf_iterator<char>(&buffer)), std::istreambuf_iterator<char>());
boost::split(temp, lines[i], boost::is_any_of(","));
在上述代碼緩衝器消耗顯著時間以下語句是: boost::asio::streambuf buffer
;
關於上述替換函數的任何建議?
什麼是'buffer'類型? –
更新了問題 – Rajeshwar
好的,我明白了。你打算用's'做什麼?要真的需要創建這個對象,或者你可以直接使用'buffer.data()'? –