Details
-
Bug
-
Resolution: Unresolved
-
Major
-
18.0.0-rc-1
-
Unknown
-
Description
Since the upgrade to Font Awesome 7 (XWIKI-15026), the CSS of the Font Awesome icon theme consists of two webjar URLs:
xwiki.iconset.css = $services.webjars.url('org.webjars:font-awesome', 'css/all.min.css'),$services.webjars.url('org.webjars:font-awesome', 'css/v4-shims.min.css')
The icon renderer evaluates this CSS template for every rendered icon (to register the CSS as a skin extension). The shortcut added in XWIKI-11112 that computes webjar URLs without Velocity only supports a template consisting of a single $services.webjars.url() call, so this template is evaluated with Velocity for each icon: a new Velocity context, a macro namespace, loading the icon theme document, an execution context clone to execute it in the context of that document, and the evaluation with its author's rights.
On a local profile of Sandbox.WebHome (standard flavor, master, ~60 icons per page), icon rendering takes 21% of the request CPU, almost all of it in this Velocity evaluation. Making the existing shortcut apply (by reducing the template to a single URL) reduced the page load time from 110 to 92 ms (-16%).
Change
Support a template consisting of several $services.webjars.url() calls separated by commas in the existing shortcut.
Attachments
Issue Links
- relates to
-
XWIKI-11112 Adding a rendering cache to the Icon Theme Application
-
- Closed
-
-
XWIKI-15026 Upgrade Font Awesome to 7.x
-
- Closed
-