Potential jank caused by MediaEngagementService::RecordStoredScoresToHistogram() at startup |
||
Issue descriptionWe collected slow reports from users facing janks and found that the function mentioned above is taking too much time on the main thread, potentially causing janks. The issue can be found in reports: Go to crash/ReportID to view the traces. https://crash.corp.google.com/browse?q=reportid=%271559f17e478c0eaf%27#6 - 2sec https://crash.corp.google.com/browse?q=reportid=%27aab97be18380508c%27#6 - 1.5s https://crash.corp.google.com/browse?q=reportid=%27200d8119f253c87c%27#6 - 1.2s There is a very long event just in startup with this args: src_file "../../chrome/browser/media/media_engagement_service.cc" src_func "MediaEngagementService" Some probable suspects from stack samples: base::Value::Clone() const base::Value::Value(base::flat_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> >, std::__ndk1::less<void> > const&) base::Value::Clone() const MediaEngagementService::GetAllStoredScores() const MediaEngagementService::RecordStoredScoresToHistogram() base::(anonymous namespace)::RunIfNotCanceled(base::CancellationFlag const*, base::OnceCallback<void ()>) base::internal::Invoker<base::internal::BindState<void (*)(base::CancellationFlag const*, base::OnceCallback<void ()>), base::CancellationFlag*, base::OnceCallback<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay) void base::internal::FunctorTraits<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), void>::Invoke<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay>(void (*&&)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay&&) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base::MessageLoop::RunTask(base::PendingTask*) base::MessageLoop::DoWork() base::MessagePumpForUI::OnNonDelayedLooperCallback() base::(anonymous namespace)::NonDelayedLooperCallback(int, int, void*) ContentSettingPatternSource::ContentSettingPatternSource(ContentSettingPatternSource const&) std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::__swap_out_circular_buffer(std::__ndk1::__split_buffer<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource>&>&) void std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::emplace_back<ContentSettingsPattern const&, ContentSettingsPattern const&, base::Value, char const* const&, bool&>(ContentSettingsPattern const&, ContentSettingsPattern const&, base::Value&&, char const* const&, bool&) HostContentSettingsMap::AddSettingsForOneType(content_settings::ProviderInterface const*, HostContentSettingsMap::ProviderType, ContentSettingsType, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >*, bool) const HostContentSettingsMap::GetSettingsForOneType(ContentSettingsType, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >*) const MediaEngagementService::GetAllStoredScores() const MediaEngagementService::RecordStoredScoresToHistogram() base::(anonymous namespace)::RunIfNotCanceled(base::CancellationFlag const*, base::OnceCallback<void ()>) base::internal::Invoker<base::internal::BindState<void (*)(base::CancellationFlag const*, base::OnceCallback<void ()>), base::CancellationFlag*, base::OnceCallback<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay) void base::internal::FunctorTraits<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), void>::Invoke<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay>(void (*&&)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay&&) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base::MessageLoop::RunTask(base::PendingTask*) base::MessageLoop::DoWork() base::MessagePumpForUI::OnNonDelayedLooperCallback() base::(anonymous namespace)::NonDelayedLooperCallback(int, int, void*) operator delete(void*) std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::~basic_string() std::__ndk1::__vector_base<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> > > > >::__destruct_at_end(std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> > >*) std::__ndk1::__vector_base<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> > > > >::~__vector_base() base::Value::~Value() ContentSettingPatternSource::~ContentSettingPatternSource() std::__ndk1::__vector_base<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::__destruct_at_end(ContentSettingPatternSource*) std::__ndk1::__vector_base<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::~__vector_base() MediaEngagementService::GetAllStoredScores() const MediaEngagementService::RecordStoredScoresToHistogram() base::(anonymous namespace)::RunIfNotCanceled(base::CancellationFlag const*, base::OnceCallback<void ()>) base::internal::Invoker<base::internal::BindState<void (*)(base::CancellationFlag const*, base::OnceCallback<void ()>), base::CancellationFlag*, base::OnceCallback<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay) void base::internal::FunctorTraits<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), void>::Invoke<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay>(void (*&&)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay&&) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base::MessageLoop::RunTask(base::PendingTask*) base::MessageLoop::DoWork() base::MessagePumpForUI::OnNonDelayedLooperCallback() base::(anonymous namespace)::NonDelayedLooperCallback(int, int, void*) base::Value::Value(base::flat_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::unique_ptr<base::Value, std::__ndk1::default_delete<base::Value> >, std::__ndk1::less<void> > const&) base::Value::Clone() const ContentSettingPatternSource::operator=(ContentSettingPatternSource const&) ContentSettingPatternSource::ContentSettingPatternSource(ContentSettingPatternSource const&) std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::__swap_out_circular_buffer(std::__ndk1::__split_buffer<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource>&>&) void std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >::emplace_back<ContentSettingsPattern const&, ContentSettingsPattern const&, base::Value, char const* const&, bool&>(ContentSettingsPattern const&&&, ContentSettingsPattern const&&&, base::Value&&, char const* const&&&, bool&&&) HostContentSettingsMap::AddSettingsForOneType(content_settings::ProviderInterface const*, HostContentSettingsMap::ProviderType, ContentSettingsType, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >*, bool) const HostContentSettingsMap::GetSettingsForOneType(ContentSettingsType, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::vector<ContentSettingPatternSource, std::__ndk1::allocator<ContentSettingPatternSource> >*) const MediaEngagementService::GetAllStoredScores() const MediaEngagementService::RecordStoredScoresToHistogram() base::(anonymous namespace)::RunIfNotCanceled(base::CancellationFlag const*, base::OnceCallback<void ()>) base::internal::Invoker<base::internal::BindState<void (*)(base::CancellationFlag const*, base::OnceCallback<void ()>), base::CancellationFlag*, base::OnceCallback<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay) void base::internal::FunctorTraits<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), void>::Invoke<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay>(void (*&&)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay&&) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base::MessageLoop::RunTask(base::PendingTask*) base::MessageLoop::DoWork() base::MessagePumpForUI::OnNonDelayedLooperCallback() base::(anonymous namespace)::NonDelayedLooperCallback(int, int, void*) memcmp std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >::compare(std::__ndk1::basic_string_view<char, std::__ndk1::char_traits<char> >) const base::FilePath::operator<(base::FilePath const&) const MediaEngagementService::GetAllStoredScores() const MediaEngagementService::RecordStoredScoresToHistogram() base::internal::Invoker<base::internal::BindState<void (android_webview::AwBrowserContext::*)(), base::internal::UnretainedWrapper<android_webview::AwBrowserContext> >, void ()>::Run(base::internal::BindStateBase*) base::(anonymous namespace)::RunIfNotCanceled(base::CancellationFlag const*, base::OnceCallback<void ()>) base::internal::Invoker<base::internal::BindState<void (*)(base::CancellationFlag const*, base::OnceCallback<void ()>), base::CancellationFlag*, base::OnceCallback<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base::(anonymous namespace)::PostTaskAndReplyRelay::RunTaskAndPostReply(base::(anonymous namespace)::PostTaskAndReplyRelay) void base::internal::FunctorTraits<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), void>::Invoke<void (*)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay>(void (*&&)(base::(anonymous namespace)::PostTaskAndReplyRelay), base::(anonymous namespace)::PostTaskAndReplyRelay&&) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base::MessageLoop::RunTask(base::PendingTask*) base::MessageLoop::DoWork() base::MessagePumpForUI::OnNonDelayedLooperCallback() base::(anonymous namespace)::NonDelayedLooperCallback(int, int, void*)
,
Nov 13
,
Nov 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a78d20743acc9e2777aa375d4dee2d8e970317bc commit a78d20743acc9e2777aa375d4dee2d8e970317bc Author: Becca Hughes <beccahughes@chromium.org> Date: Tue Nov 13 21:47:44 2018 [Media Engagement] Remove histogram Remove the ScoreAtStartup histogram as it was causing jank and we were not using it. BUG= 900679 Change-Id: I004743c48425c9bb3fbbed67004c7616ef290cf9 Reviewed-on: https://chromium-review.googlesource.com/c/1330211 Commit-Queue: Becca Hughes <beccahughes@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Brian White <bcwhite@chromium.org> Cr-Commit-Position: refs/heads/master@{#607751} [modify] https://crrev.com/a78d20743acc9e2777aa375d4dee2d8e970317bc/chrome/browser/media/media_engagement_service.cc [modify] https://crrev.com/a78d20743acc9e2777aa375d4dee2d8e970317bc/chrome/browser/media/media_engagement_service.h [modify] https://crrev.com/a78d20743acc9e2777aa375d4dee2d8e970317bc/chrome/browser/media/media_engagement_service_unittest.cc [modify] https://crrev.com/a78d20743acc9e2777aa375d4dee2d8e970317bc/tools/metrics/histograms/histograms.xml |
||
►
Sign in to add a comment |
||
Comment 1 by ssid@chromium.org
, Oct 31Components: Blink>Media
Owner: beccahughes@chromium.org