From c7315617eb6186912d03232e1968f32b88f153f2 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Mon, 28 Oct 2024 19:02:52 +0100 Subject: internal: few more marginal optimisations from profiling (#8271) * deco: reduce local temporars and function calls profiling shows this is a high used function, reduce the amount of function calls and local temporar copies and also check if we even need to add extents at all in the loop. * popup: optimize bfhelper in popups pass nodes as const reference and reserve the size of the children node vector help reduce the reallocations. * procotol: make compositor bfhelper use const ref use const ref for nodes and reserve second nodes vector size to reduce amount of reallocation needed. --- src/protocols/core/Compositor.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/protocols/core/Compositor.hpp') diff --git a/src/protocols/core/Compositor.hpp b/src/protocols/core/Compositor.hpp index fbffd966..e5bdf082 100644 --- a/src/protocols/core/Compositor.hpp +++ b/src/protocols/core/Compositor.hpp @@ -147,7 +147,7 @@ class CWLSurfaceResource { void dropPendingBuffer(); void dropCurrentBuffer(); void commitPendingState(); - void bfHelper(std::vector> nodes, std::function, const Vector2D&, void*)> fn, void* data); + void bfHelper(std::vector> const& nodes, std::function, const Vector2D&, void*)> fn, void* data); void updateCursorShm(); friend class CWLPointerResource; -- cgit v1.2.3