Details
- 
    New Feature 
- 
    Resolution: Fixed
- 
    Major 
- 
    2.1 M1
Description
Attached you'll find a patch that makes use of Velocity cache.
I ran a simple test:
- Start XWiki
- Retrieve view/Main [invoked in order to initialize XWiki]
- Reset timers
- Retrieve view/Blog - do it 100 times in a sequence (i.e. one at a time)
- Get request durations from view/XWiki/RequestsStatus
"Retrieve" means I invoke GET URL and then read reponse but I don't parse it and don't make any dependent requests (e.g. for images or Ajax)
HSQLDB
Blog - request #1
| Request duration [ms] | Original | Patched | Gain | 
|---|---|---|---|
| Min request time [ms] | 6770 | 5598 | 17% | 
Blog - requests #2 - #100
| Parameter | Original | Patched | Gain | 
|---|---|---|---|
| Min request duration [ms] | 2483 | 1752 | 29% | 
| Max request duration [ms] | 3905 | 2543 | 35% | 
| Mean request duration [ms] | 2819 | 1861 | 34% | 
SQLite
Blog - request #1
| Request duration [ms] | Original | Patched | Gain | 
|---|---|---|---|
| Min request time [ms] | 6570 | 5568 | 15% | 
Blog - requests #2 - #100
| Parameter | Original | Patched | Gain | 
|---|---|---|---|
| Min request duration [ms] | 2464 | 1753 | 29% | 
| Max request duration [ms] | 3275 | 2493 | 24% | 
| Mean request duration [ms] | 2808 | 1876 | 33% | 
Two things to consider:
- I changed velocimacro.permissions.allow.inline.local.scope to false in order to properly run the blog app (the original one, I didn't upgraded it to 2.0 syntax yet).
 It might be necessary to somehow use the hack with rsvc.parse(source, templateName, false); but actually I'm not sure about it... At the moment I don't understand the difference between setting velocimacro.permissions.allow.inline.local.scope=false and using Da Hack... 
- It might be also good idea to set resource.manager.defaultcache.size=<some number>
Attachments
Issue Links
- blocks
- 
                    XWIKI-21302 Compile Velocity templates -         
- Closed
 
-         
- depends on
- 
                    XCOMMONS-2795 Add a name to the namespaced classloaders -         
- Closed
 
-         
- is related to
- 
                    XWIKI-21219 Add a preparation/compilation pass to the document content and title -         
- Closed
 
-         
- relates to
- 
                    XCOMMONS-800 Find a way to cache Velocity "AST" -         
- Closed
 
-