This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e75e53ec-8113-4c27-8b2f-546a49fc420b XWIKI-25796 Open

The CSS of the Font Awesome icon theme is evaluated with Velocity for every rendered icon

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-bfccfcae-5a46-4e3c-b375-226138b88a7e Michael Hamann created this issue on 18/Nov/26 17:28
 
Summary: The CSS of the Font Awesome icon theme is evaluated with Velocity for every rendered icon
Issue Type: cid:jira-generated-image-avatar-e75e53ec-8113-4c27-8b2f-546a49fc420b Bug
Affects Versions: 18.0.0-rc-1
Assignee: Unassigned
Components: Icon
Created: 18/Nov/26 17:28
Labels: performance
Priority: cid:jira-generated-image-static-major-18e6d8f9-8743-4d73-988b-9e6c28834778 Major
Reporter: Michael Hamann
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.

 
 

2 updates

 
cid:jira-generated-image-avatar-bfccfcae-5a46-4e3c-b375-226138b88a7e Changes by Michael Hamann on 18/Nov/26 17:34
 
Fix Version: 18.10.0-rc-1
Assignee: Michael Hamann