While profiling my site, I noticed that quite a lot of time is spent inside filter_xss(). Within the Mini Panels module I noticed a few unnecessary calls. 3 calls can be reduced to 1. This increases performance slightly, especially if you have a lot of mini panels.
This patch saves the result of filter_xss_admin($mini->title) in a temporary variable to avoid calling the function with the same argument twice. It removes the filer_xss_admin() call around $mini->category, because that variable is only allowed to contain 7-bit characters, digits and space.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | panels_mini_content_type-1.patch | 3.4 KB | c960657 |
| panels-mini-filter-xss-1.patch | 1.74 KB | c960657 |
Comments
Comment #1
c960657 commentedThis is a much better approach. This makes the mini panel content type implement
content typehook in addition to the defaultcontent typeshook. This prevents all mini panels from being loaded on every page that contains just a single mini panel.Comment #2
sdboyer commentedGood call. Committed.