From b34f728a9c14f2926df5b057e0421472afcabbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90?= Date: Fri, 27 Jun 2025 08:55:06 +0000 Subject: [PATCH 1/4] cpu boost accelerate for arkui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 可乐 --- frameworks/core/pipeline_ng/BUILD.gn | 2 +- frameworks/core/pipeline_ng/pipeline_context.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frameworks/core/pipeline_ng/BUILD.gn b/frameworks/core/pipeline_ng/BUILD.gn index c6acc591e5f..915579fa948 100644 --- a/frameworks/core/pipeline_ng/BUILD.gn +++ b/frameworks/core/pipeline_ng/BUILD.gn @@ -44,7 +44,7 @@ template("ace_core_pipeline_ng_source_set") { configs = [ "$ace_root:ace_config" ] deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ] - external_deps = [] + external_deps = [ "ffrt:libffrt" ] if (use_hilog) { external_deps += [ "hilog:libhilog" ] } diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index 98fb5f77882..de39c271818 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -68,6 +68,7 @@ #include "component_test/pipeline_status.h" #endif // COMPONENT_TEST_ENABLED #include "interfaces/inner_api/ace_kit/src/view/ui_context_impl.h" +#include "c/ffrt_cpu_boost.h" namespace { constexpr uint64_t ONE_MS_IN_NS = 1 * 1000 * 1000; @@ -499,6 +500,8 @@ void PipelineContext::FlushDirtyNodeUpdate() ACE_SCOPED_TRACE("Error update, node stack non-empty"); LOGW("stack is not empty when call FlushDirtyNodeUpdate, node may be mounted to incorrect pos!"); } + // cpu boost feature start: accelerate FlushDirtyNode. + ffrt_cpu_boost_start(CPUBOOST_START_POINT); // SomeTimes, customNode->Update may add some dirty custom nodes to dirtyNodes_, // use maxFlushTimes to avoid dead cycle. int maxFlushTimes = 3; @@ -515,6 +518,8 @@ void PipelineContext::FlushDirtyNodeUpdate() } --maxFlushTimes; } + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT); if (FrameReport::GetInstance().GetEnable()) { FrameReport::GetInstance().EndFlushBuild(); @@ -895,6 +900,8 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) return; } + // cpu boost feature start: accelerate Displaysync. + ffrt_cpu_boost_start(CPUBOOST_START_POINT + 1); displaySyncManager->SetRefreshRateMode(window_->GetCurrentRefreshRateMode()); displaySyncManager->SetVsyncPeriod(window_->GetVSyncPeriod()); @@ -914,6 +921,8 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) auto monitorVsyncRate = displaySyncManager->GetMonitorVsyncRate(); auto id = GetInstanceId(); ArkUIPerfMonitor::GetPerfMonitor(id)->RecordDisplaySyncRate(monitorVsyncRate); + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT + 1); } void PipelineContext::FlushAnimation(uint64_t nanoTimestamp) -- Gitee From 49d55d0e1f1d909ada17f819cc51b44841a1659d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90?= Date: Mon, 30 Jun 2025 03:20:53 +0000 Subject: [PATCH 2/4] rever change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 可乐 --- frameworks/core/pipeline_ng/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/core/pipeline_ng/BUILD.gn b/frameworks/core/pipeline_ng/BUILD.gn index 915579fa948..c6acc591e5f 100644 --- a/frameworks/core/pipeline_ng/BUILD.gn +++ b/frameworks/core/pipeline_ng/BUILD.gn @@ -44,7 +44,7 @@ template("ace_core_pipeline_ng_source_set") { configs = [ "$ace_root:ace_config" ] deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ] - external_deps = [ "ffrt:libffrt" ] + external_deps = [] if (use_hilog) { external_deps += [ "hilog:libhilog" ] } -- Gitee From 24a7564f05c3dcd1c2f363726709dd9620e67562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90?= Date: Mon, 30 Jun 2025 03:22:03 +0000 Subject: [PATCH 3/4] rever change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 可乐 --- frameworks/core/pipeline_ng/pipeline_context.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index de39c271818..98fb5f77882 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -68,7 +68,6 @@ #include "component_test/pipeline_status.h" #endif // COMPONENT_TEST_ENABLED #include "interfaces/inner_api/ace_kit/src/view/ui_context_impl.h" -#include "c/ffrt_cpu_boost.h" namespace { constexpr uint64_t ONE_MS_IN_NS = 1 * 1000 * 1000; @@ -500,8 +499,6 @@ void PipelineContext::FlushDirtyNodeUpdate() ACE_SCOPED_TRACE("Error update, node stack non-empty"); LOGW("stack is not empty when call FlushDirtyNodeUpdate, node may be mounted to incorrect pos!"); } - // cpu boost feature start: accelerate FlushDirtyNode. - ffrt_cpu_boost_start(CPUBOOST_START_POINT); // SomeTimes, customNode->Update may add some dirty custom nodes to dirtyNodes_, // use maxFlushTimes to avoid dead cycle. int maxFlushTimes = 3; @@ -518,8 +515,6 @@ void PipelineContext::FlushDirtyNodeUpdate() } --maxFlushTimes; } - // cpu boost feature end. - ffrt_cpu_boost_end(CPUBOOST_START_POINT); if (FrameReport::GetInstance().GetEnable()) { FrameReport::GetInstance().EndFlushBuild(); @@ -900,8 +895,6 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) return; } - // cpu boost feature start: accelerate Displaysync. - ffrt_cpu_boost_start(CPUBOOST_START_POINT + 1); displaySyncManager->SetRefreshRateMode(window_->GetCurrentRefreshRateMode()); displaySyncManager->SetVsyncPeriod(window_->GetVSyncPeriod()); @@ -921,8 +914,6 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) auto monitorVsyncRate = displaySyncManager->GetMonitorVsyncRate(); auto id = GetInstanceId(); ArkUIPerfMonitor::GetPerfMonitor(id)->RecordDisplaySyncRate(monitorVsyncRate); - // cpu boost feature end. - ffrt_cpu_boost_end(CPUBOOST_START_POINT + 1); } void PipelineContext::FlushAnimation(uint64_t nanoTimestamp) -- Gitee From 9b5e84727e5cbc35d144969addc2ee4e5d713ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90?= Date: Mon, 30 Jun 2025 03:35:23 +0000 Subject: [PATCH 4/4] cpuboost config for arkui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 可乐 --- frameworks/core/pipeline_ng/BUILD.gn | 4 ++++ .../core/pipeline_ng/pipeline_context.cpp | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/frameworks/core/pipeline_ng/BUILD.gn b/frameworks/core/pipeline_ng/BUILD.gn index c6acc591e5f..97352d26ebe 100644 --- a/frameworks/core/pipeline_ng/BUILD.gn +++ b/frameworks/core/pipeline_ng/BUILD.gn @@ -48,6 +48,10 @@ template("ace_core_pipeline_ng_source_set") { if (use_hilog) { external_deps += [ "hilog:libhilog" ] } + if (cpuboost_enable) { + external_deps += [ "ffrt:libffrt" ] + defines += [ "CPUBOOST_EN" ] + } if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { if (is_arkui_x) { deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] diff --git a/frameworks/core/pipeline_ng/pipeline_context.cpp b/frameworks/core/pipeline_ng/pipeline_context.cpp index 98fb5f77882..35a829cc465 100755 --- a/frameworks/core/pipeline_ng/pipeline_context.cpp +++ b/frameworks/core/pipeline_ng/pipeline_context.cpp @@ -68,6 +68,9 @@ #include "component_test/pipeline_status.h" #endif // COMPONENT_TEST_ENABLED #include "interfaces/inner_api/ace_kit/src/view/ui_context_impl.h" +#ifdef CPUBOOST_EN +#include "c/ffrt_cpu_boost.h" +#endif // CPUBOOST_EN namespace { constexpr uint64_t ONE_MS_IN_NS = 1 * 1000 * 1000; @@ -499,6 +502,10 @@ void PipelineContext::FlushDirtyNodeUpdate() ACE_SCOPED_TRACE("Error update, node stack non-empty"); LOGW("stack is not empty when call FlushDirtyNodeUpdate, node may be mounted to incorrect pos!"); } +#ifdef CPUBOOST_EN + // cpu boost feature start: accelerate FlushDirtyNode. + ffrt_cpu_boost_start(CPUBOOST_START_POINT); +#endif // CPUBOOST_EN // SomeTimes, customNode->Update may add some dirty custom nodes to dirtyNodes_, // use maxFlushTimes to avoid dead cycle. int maxFlushTimes = 3; @@ -515,6 +522,10 @@ void PipelineContext::FlushDirtyNodeUpdate() } --maxFlushTimes; } +#ifdef CPUBOOST_EN + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT); +#endif // CPUBOOST_EN if (FrameReport::GetInstance().GetEnable()) { FrameReport::GetInstance().EndFlushBuild(); @@ -895,6 +906,10 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) return; } +#ifdef CPUBOOST_EN + // cpu boost feature start: accelerate Displaysync. + ffrt_cpu_boost_start(CPUBOOST_START_POINT + 1); +#endif // CPUBOOST_EN displaySyncManager->SetRefreshRateMode(window_->GetCurrentRefreshRateMode()); displaySyncManager->SetVsyncPeriod(window_->GetVSyncPeriod()); @@ -914,6 +929,10 @@ void PipelineContext::DispatchDisplaySync(uint64_t nanoTimestamp) auto monitorVsyncRate = displaySyncManager->GetMonitorVsyncRate(); auto id = GetInstanceId(); ArkUIPerfMonitor::GetPerfMonitor(id)->RecordDisplaySyncRate(monitorVsyncRate); +#ifdef CPUBOOST_EN + // cpu boost feature end. + ffrt_cpu_boost_end(CPUBOOST_START_POINT + 1); +#endif // CPUBOOST_EN } void PipelineContext::FlushAnimation(uint64_t nanoTimestamp) -- Gitee