Page 2 of 3

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 00:36
by cagatay.civici
Note: Charts ans Schedule are not aggregated in primefaces.js and primefaces.css.

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 01:55
by javaone9
optimus.prime wrote:Note: Charts ans Schedule are not aggregated in primefaces.js and primefaces.css.
Right. But if they are included in JSF tree, but not rendered, these .js will still be included in generated HTML. I think non-core component resouces(not in primefaces.js/.css) should be included only when their encode() methods are called. Especially for home page that requires fast loading. Charts/schedule components will be shown in ajax way when user click some buttons, and the same JSF page is used. At this point, chart.js/schedule.js need to be included.

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 10:12
by cagatay.civici
JSF handles resource management not PrimeFaces and it is quite tricky to implement what you ask for. If you add these components on the fly like in a conditional ui include PF will load them on the fly though using dynamic resource loading feature of ours.

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 11:44
by Oleg
Yes, conditional "src" in ui:include is a good approach. In general, dynamic resource inclusion is possible in JSF. We did this e.g. for CKEditor in PF Extensions. But in a common case it is also fine with standard JSF res. management. Static resource loading doesn't hirt for small resources. Dynamic approach makes sense for more or less big resources. CKEditor has e.g. MBs of resources and it makes sense don't load all them at once. Only on demand, if you change theme or similar.

How big are Chart and Schedule resources? I think the size is ok. Is it not?

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 11:57
by cagatay.civici
How big are Chart and Schedule resources? I think the size is ok. Is it not?
charts.js is 76kb, schedule.js is 20kb in showcase. Both are not in primefaces.js (40kb with 35+ most used components).

Re: How can I improve performance on the initial page load?

Posted: 18 Dec 2012, 12:55
by Oleg
The size of these resources is quite ok for me. I can not see any reason to come up with some workarounds or implement tricky dynamic loading based on "rendered" attr. or whatever. It is not worth in my opinion.

Re: How can I improve performance on the initial page load?

Posted: 19 Dec 2012, 03:39
by javaone9
I am not sure how difficult it is to implement dynamic loading of resources. Some thoughts:

Take chart for instance,
1. use @vewScope variable to remember whether chart.js is included in the tree.
2. when a chart component is encoded, check the variable, add chart.js if not added yet.
So chart.js will be added before it is used by any chart component.
not necessary to add it in the head, just add it where the component is rendered.
This works for both ajax and non-ajax requests.
After chart.js is added, make sure it will not be removed by any subsequent ajax update.
3. if this simple approach works, it worths the effort to implement it.

Thanks,
Dave

Re: How can I improve performance on the initial page load?

Posted: 20 Dec 2012, 23:26
by sebargarcia
Here is a good aproach how to Speed up Primefaces page load with p:remoteCommand partial update see
http://kahimyang.info/kauswagan/howto_b ... ial_update

Re: How can I improve performance on the initial page load?

Posted: 30 Jan 2013, 02:15
by MagmaRules
optimus.prime wrote:JSF handles resource management not PrimeFaces and it is quite tricky to implement what you ask for. If you add these components on the fly like in a conditional ui include PF will load them on the fly though using dynamic resource loading feature of ours.
I understand it might be hard but is there any plan to split javascript loading by component?

Re: How can I improve performance on the initial page load?

Posted: 31 Jan 2013, 00:07
by PrimeFaces PRO
With PrimeFaces PRO, it's easy to support, tune and add features to PrimeFaces as if it were an in-house framework.

PrimeFaces PRO is a term based commercial support service. With the exclusive services of Pro account, you no longer need to post your questions in PrimeFaces community forum and your issues to community issue tracker.

Standard PRO Services

Access to pro.primefaces.org
Response at most in 1 business day.
Defect patches.
Private branch management in case you need.
Customized builds.
Unlimited number of cases.
Remote desktop connection.
Conference calls for discussions.
High priority to your issues.
Non PrimeFaces related general JSF assistance.

New Features

New feature and enhancement requests are not available in core services and provided via an hour based model instead. When you have a feature request we provide an estimate, if you confirm we deliver your request within an estimated timeframe and deduct the amount of work from your hours. These requests can be;

- New components.
- New functionality to existing components.
- Changing the way a certain functionality is implemented.
- Proof of Concept implementations of a use case.
- Code reviews to offer best practices.

Hourly rate is 200 usd and discounts apply on bulk purchases that are more than 50. You can purchase additional hours along with the subscription and also anytime during your subscription period. If your subscription term ends with unused hours, they will be added to your new subscription term in case you extend.

To get a quote, please contact us and mention the total number of developers who will be working in your PrimeFaces projects.