https://bugs.documentfoundation.org/show_bug.cgi?id=91368

Michael Meeks <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
             Blocks|91310                       |

--- Comment #7 from Michael Meeks <[email protected]> ---
This is nothing to do with VclPtr; or with the RenderContext work (AFAICS) -
it's down to the new style preview work in master.

The profile shows that we do some horrendous N^2 cost here; we do:

2440 - calls to CreateStylePreviewRenderer - which takes 13bn pcycles with just
default styles; (though this is in an unhelpful dbgutil build).

I've a small patch that shaves some of them off; but it's a pointless
micro-optimization.

If we do something like this:

--- a/svx/source/styles/CommonStyleManager.cxx
+++ b/svx/source/styles/CommonStyleManager.cxx
@@ -22,17 +22,33 @@ sfx2::StylePreviewRenderer*
CommonStyleManager::CreateStylePreviewRenderer(
     if (!pPool)
         return nullptr;

+    SfxStyleSheetBase *pFindStyle = pPool->Find( rName, eFamily );
+    if (pFindStyle && getenv ("FOO")) {
+        SAL_DEBUG("hit");
+        return new CommonStylePreviewRenderer(mrShell, rOutputDev, pFindStyle,
nMaxHeight);
+    }
+
     pPool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL);
     SfxStyleSheetBase* pStyle = nullptr;

Life gets faster, but goes wrong too. It seems that looks up by UI names and
not programmating style names; ie. we see an rName of 

'"Default Style" -> UI Name

and not 'standard' - which is annoying.

The Find() appears to (nearly) work and is a lot faster but gets the font
weights wrong (interestingly) - so we need to iterate and pStyle->GetName()
comparison.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to