Wiki source code of Page Load Time

Last modified by Vincent Massol on 2024/11/19 16:12

Show last authors
1 {{include document="XWiki.DesignClassSheet"/}}
2
3 == Table of Content ==
4
5 {{toc start="2"/}}
6
7 == Objective ==
8
9 The objective of this work is to improve XWiki's performance both perceived and real. XWiki is very powerfull and provides many possibilities thanks to it's modularity, many APIs and also to velocity. However this is quite costly as many JS/CSS are loaded, velocity processing is quite expensive.
10
11 Ambitious Goals:
12
13 * Divide by 2 the perceived (time to display) page loading time of the home page
14 * Divide by 2 the average CPU load on the server of a standard XWiki install
15 * Improve ranking (goal to define) of the tests by online tools
16 * Provide recommandations and tools to application developers to check their developments for good performance
17
18 == Discussions ==
19
20 * [xwiki-devs] Investigation: Page Load Time http://markmail.org/thread/3vlyuhbaacgg6xom
21 * [xwiki-users] Page Loading Optimization http://xwiki.markmail.org/thread/hpu6dm7y3b3uelt2
22 * [xwiki-devs] WYSIWYG editor loading time http://xwiki.markmail.org/thread/m2h42zj3ysrtbrcv
23
24 == Action Plan ==
25
26 The following action plan is proposed for the Page Load Time work. It is of course not complete since we need the result of the evaluations to complete the Action Plan:
27
28 |=Priority|=Description|=Who|=Workload|=Delay|=Details
29 |High|Improve/Validate Page Load Time investigation and Action Plan | Community | Low | T+7 days |
30 |High|Validate performance measures | Community | Low | T+7 days |
31 |High|Provide sample Syntax 2.0 and Velocity content | Community | 1 day | T+7 days |
32 |Medium|Run Initial Manual load test report | QA/Developer | 1 day | T+14 days
33 |Medium|Evaluate possibility of running automated performance measures | Core team | 3 day | T+20 days
34 |Medium|Implement automated performance measures | Core team | 5-20 days (?) | T+? days
35 |=Implement performance improvements |\\
36 |Medium|Implement obvious performance improvements | Marius | 5-10 days | T+? days
37 |Low|Implement other performance improvements based on reports | ? | ? | ? days
38
39 == Performance measures ==
40
41 It should focus on:
42
43 - time to display the home page of XWiki on fresh loading
44 - total load time including content post display
45 - time to display an additional page
46 - total load on the server and kilobytes transfered to load the home page
47 - total load on the server and kilobytes transfered to load an additional page
48 - time to open the edit mode (wysiwyg in particular)
49 - time to render an empty page with no dynamic panels and the standard skin + time spent in each template
50 - time to render a Syntax 2.0 complex document with many macros
51 - time to render a velocity template with many variables and calls to XWiki apis
52
53
54 These measurements should be done with a decently populated XWiki version. About 1000 pages created.
55
56 == Solutions ==
57
58 There are multiples approaches to make progress in this area.
59
60 1/ Solution 1: Manual checking of performance and implementation of obvious fixes
61 2/ Solution 2: [[Setup of a performance measurement mecanism>>Load Testing Plan]] which allows to track performance indicators accross versions
62 3/ Solution 3: Use online testing tools that report performance issues
63 4/ Solution 4: Profiling sample requests using YourKit
64
65 We could also use all solutions in parallel. Now in order to define which aspects should be improved first we would need to understand where most of the time is spent. This will require a manual analysis of the different reports and proposals for changes.
66
67 == How to propose changes ==
68
69 The changes proposed should all include an evaluated improvements and an evaluated workload to implement
70
71 (This following is an example. It's not real data)
72
73 |=Change Proposed |= Estimated workload |= What page would gain |= Estimated gain
74 |Remove unused JS/CSS from Home page | 1 day | Perceived loading time | Win 10%
75
76 == Manual checking of performance and implementation of obvious fixes ==
77
78 A review of the latest XWiki version needs to be done and technical recommendations need to be made that would improve performance.
79
80 The manual review should provide numbers for each of the 6 items listed.
81
82 Here is a [[sample performance report>>PageLoadTimeSampleReport]].
83
84 Here is a [[first performance report>>PageLoadTimeReport30SnapShot1]].
85
86 == Setup of a performance measurement mecanism which allows to track performance indicators accross versions ==
87
88 We should study if we can include in our selenium tests, a measurement of the different performance indicators. An alternate solution is to have the QA team measure this indicators during the QA Test plan. In any case this measurement needs to be done with the same performing client browser and machine between versions.
89
90 TODO for Marius: which indicators can be measured. What is the workload to implement and report.
91
92 The performance measurement would allow to track evolution of performance and also show priorities on which we should focus.
93
94 == Use online testing tools that report performance issues ==
95
96 We can run reports using YSlow or tools like http://zoompf.com/ to report performance issues.
97
98 Here is a report on xwiki.org (running 2.7) using zoompf:
99
100 http://173-203-64-171.static.cloud-ips.com/ZoompfFree/scans/240d8d995b53f131ef8b5c1fd675bb0e/report.html
101
102 Recommandations should be made by a person analyzing the report.
103
104 == Profiling of Sample Request ==
105
106 Specific scenarios should be made and profiled using YourKit. This will particularly help finding improvements in the core.
107
108 Here is a report for a simple page with no content and no dynamic panels loaded using the Admin user:
109
110 http://dev.xwiki.org/xwiki/bin/download/Design/PageLoadTimeReport30SnapShot1/SimplePageLoad.html
111
112 Recommandations should be made by a person analyzing the report.
113
114 == Proposed Changes ==
115
116 |=Change Proposed |= Estimated workload |= What page would gain |= Estimated gain |=Comments
117 |Cache getXWikiPreferences| 5 day | Minimal page loading time | Win 15% on the minimal page loading time (currently 200ms)
118 + Unknown win on general performance and CPU load
119 |Cache getSkinFile in production mode| 5 day | Minimal page loading time | Win 15% on the minimal page loading time (currently 200ms)
120 + Unknown win on general performance and CPU load
121 |Optimize XWikiRightsServiceImpl| LOT | ALL | Win minimum 15% on the minimal page loading time (currently 200ms)
122 + Unknown win on general performance and CPU load + particular win when having complex rights/groups/users
123 |Optimize Home Page Activity Stream | ? | ? | Currently costs around 2 seconds which is a lot compared to the minimal time
124 |Remove "Recent Modifications Panel" | 1 days | Minimal page loading time | Win 50ms on the minimal page loading time
125 |Remove unused JS/CSS on home page | ? | Home page perceived loading time | Reduce initial loading time of home page. Currently 300KB JS/CSS (cost depends on the network)
126 |Reduce JS/CSS sizes (use compression) | ? | All pages perceived loading time | Reduce initial loading time of all pages including admin and edit

Get Connected