I have read many posts (e.g., this one) saying unique_ptr has no overhead when accessing the content they point to. However, when I run perf record and perf report on my application, I notice the following results:
- 15.81% lqf::MaskedRowIterator::next ▒
- 4.92% lqf::SimpleBitmapIterator::next ▒
_mm_popcnt_u64 (inlined) ▒
- 4.88% std::unique_ptr<lqf::BitmapIterator, std::default_delete<lqf::BitmapIterator> >::operator-> ▒
- 3.38% std::unique_ptr<lqf::BitmapIterator, std::default_delete<lqf::BitmapIterator> >::get ▒
- 2.71% std::__uniq_ptr_impl<lqf::BitmapIterator, std::default_delete<lqf::BitmapIterator> >::_M_ptr ▒
- 1.91% std::get<0ul, lqf::BitmapIterator*, std::default_delete<lqf::BitmapIterator> > ▒
- 1.13% std::__get_helper<0ul, lqf::BitmapIterator*, std::default_delete<lqf::BitmapIterator> > ▒
std::_Tuple_impl<0ul, lqf::BitmapIterator*, std::default_delete<lqf::BitmapIterator> >::_M_head ▒
- 4.55% std::unique_ptr<lqf::DataRowIterator, std::default_delete<lqf::DataRowIterator> >::operator* ▒
- 3.23% std::unique_ptr<lqf::DataRowIterator, std::default_delete<lqf::DataRowIterator> >::get ▒
- 2.27% std::__uniq_ptr_impl<lqf::DataRowIterator, std::default_delete<lqf::DataRowIterator> >::_M_ptr ▒
- 1.78% std::get<0ul, lqf::DataRowIterator*, std::default_delete<lqf::DataRowIterator> > ▒
- 1.10% std::__get_helper<0ul, lqf::DataRowIterator*, std::default_delete<lqf::DataRowIterator> > ▒
- std::_Tuple_impl<0ul, lqf::DataRowIterator*, std::default_delete<lqf::DataRowIterator> >::_M_head ▒
std::_Head_base<0ul, lqf::DataRowIterator*, false>::_M_head ▒
0.58% lqf::ParquetRowIterator::operator[] ▒
0.55% std::unique_ptr<lqf::DataRowIterator, std::default_delete<lqf::DataRowIterator> >::get
In this report, the "*" and "->" operator on a unique_ptr are listed to have non-negligible cost. How should we understand this?