[
https://issues.apache.org/jira/browse/TOMAHAWK-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631141#action_12631141
]
Paul Rivera commented on TOMAHAWK-1327:
---------------------------------------
I took leonardo's solution, did some modifications, and profiled it. I've
attached it here as simple_impl2.rar. Profile result and patch are inside the
zip file.
Just a recap of the performance results, if we baseline our performance results
on a project that uses ResponseWriter methods _only:
- freemarker implementation is approximately 8 times slower
- simple_impl2 implementation is approximately 2 times slower
- simple_impl1 implementation can potentially be faster than our baseline.
If you check the results, the numbers succeeding the first invocation are
pretty close.
simple_impl2 seems like the best compromise between feature and performance.
simple_impl1 does not make use of reflection and does it similar to jdbc
preparedstatements. Each parameter has to be set/declared. It does not handle
passing of components as parameter which might be an added burden to the
developer.
> A proposed solution to separate javascript code from java code in Renderers
> ---------------------------------------------------------------------------
>
> Key: TOMAHAWK-1327
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1327
> Project: MyFaces Tomahawk
> Issue Type: New Feature
> Reporter: Paul Rivera
> Priority: Minor
> Attachments: freemarker_impl.rar, simple_impl1.rar, simple_impl2.rar,
> template-core.zip
>
>
> In our current implementation of component renderers, javascript code is
> generated using ResponseWriter methods inside the renderer. Although, when
> the embedded javascript code gets too lengthy, the renderer code can become
> hard to read and debug.
> The proposition is to provide developers with a tool that separates
> javascript code from the renderer code and move it into template files. This
> solution is similar to how TemplateRenderer handles HTML content.
> Attached above is the JavascriptTemplateEncoder implementation that uses
> FreeMarker. More information about JavascriptTemplateEncoder and its
> performance in the PDF files inside the zip.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.