Skip to content

Commit

Permalink
add timer for move_to_container
Browse files Browse the repository at this point in the history
Reviewed By: agampe

Differential Revision: D49626863

fbshipit-source-id: 586fed9c18288985517dda9ca54b055555609697
  • Loading branch information
Nikolai Tillmann authored and facebook-github-bot committed Oct 13, 2023
1 parent 15dd754 commit f71c967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libredex/ConcurrentContainers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ template <typename Container, size_t n_slots>
class ConcurrentContainerIterator;

inline AccumulatingTimer s_destructor{};
inline AccumulatingTimer s_move{};

inline double get_destructor_seconds() { return s_destructor.get_seconds(); }
inline double get_move_seconds() { return s_move.get_seconds(); }

inline size_t s_concurrent_destruction_threshold{
std::numeric_limits<size_t>::max()};
Expand Down Expand Up @@ -211,6 +213,7 @@ class ConcurrentContainer {
* This operation is not thread-safe.
*/
Container move_to_container() {
auto timer_scope = cc_impl::s_move.scope();
Container res;
res.reserve(size());
for (size_t slot = 0; slot < n_slots; ++slot) {
Expand Down
1 change: 1 addition & 0 deletions libredex/PassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,7 @@ void PassManager::run_passes(DexStoresVector& stores, ConfigFiles& conf) {
get_compute_locations_closure_wto_seconds());
Timer::add_timer("cc_impl::destructor_second",
cc_impl::get_destructor_seconds());
Timer::add_timer("cc_impl::move_second", cc_impl::get_move_seconds());
}

PassManager::ActivatedPasses PassManager::compute_activated_passes(
Expand Down

0 comments on commit f71c967

Please sign in to comment.