0
我剛跑gprof
來剖析我的一些代碼。這是平面輪廓的前幾行。超過75%的時間被第一個函數使用。這個功能是什麼?這是什麼告訴我我如何濫用特徵庫?解釋gprof輸出並識別該特徵函數
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name
75.16 368.61 368.61 void Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::internal::assign_op<double> >(Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::internal::assign_op<double> const&)
這裏有一點點更好的格式化函數名:
void Eigen::internal::call_assignment_no_alias<Eigen::Matrix<double, -1, 1, 0, -1, 1>,
Eigen::Matrix<double, -1, 1, 0, -1, 1>,
Eigen::internal::assign_op<double> >(Eigen::Matrix<double, -1, 1, 0, -1, 1>&,
Eigen::Matrix<double, -1, 1, 0, -1, 1> const&,
Eigen::internal::assign_op<double> const&)
你是什麼意思「要小心,如果你使用std :: vector?我使用了很多'std :: vector's –
Taylor
我不會去考慮它。像這樣的東西,但對於'MatrixXd's(http://eigen.tuxfamily.org/dox-devel/group__TopicStlContainers.html)。這非常有幫助;非常感謝 – Taylor
我並不是指對齊問題,因爲那些不涉及'MatrixXd',而是關於禁止性拷貝。確保使用C++ 11並正確使用std :: vector,以便發生移動語義。 – ggael