You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2013/11/02 02:38:17 UTC

[jira] [Created] (MYFACES-3815) Lazy instantiation of Renderer classes

Leonardo Uribe created MYFACES-3815:
---------------------------------------

             Summary: Lazy instantiation of Renderer classes
                 Key: MYFACES-3815
                 URL: https://issues.apache.org/jira/browse/MYFACES-3815
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-344
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


The initialization algorithm create all Renderer instances at startup time. The side effect is a lot of classes are loaded into permgen memory without need.

With a clever trick we can avoid that, providing a custom interfaces LazyRenderKit and making html basic renderkit implements it. Then, in the init code we check for that interface and if is present, we use it to register the Renderer in a lazy way, otherwise we use the standard form. Add the required method to RenderKit looks like a good idea for include it in the spec.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Re: [jira] [Created] (MYFACES-3815) Lazy instantiation of Renderer classes

Posted by Mike Kienenberger <mk...@gmail.com>.
Wow.  I hadn't realized that 20 renderers would require 400 classes.


On Sat, Nov 2, 2013 at 1:00 PM, Leonardo Uribe <lu...@gmail.com> wrote:
> Hi Mike
>
> I have been doing some profiling with YourKit profiler, and I have seen
> that with the patch already applied in trunk we avoid load around 400
> classes at startup in the hello world application, which is about 20
> renderers.
>
> The solution will not have any side effects, because it is automatically
> disabled if the environment requires to do so.
>
> I'm doing some tests with Google Application Engine, to see how
> far can we reduce the cold start time. It is hard, because JSF is quite
> big and complex, but the idea is find ways to reduce the startup
> time, and the patch seems to help a bit.
>
> regards,
>
> Leonardo Uribe
>
>
> 2013/11/2 Mike Kienenberger <mk...@gmail.com>
>>
>> I'm guessing this isn't that big a deal if you're only using the
>> standard JSF libraries.   How many renderers are we talking about?
>>
>> I suppose it might be an issue if you have a project that include
>> bunch of JSF libraries.
>>
>> On Fri, Nov 1, 2013 at 9:38 PM, Leonardo Uribe (JIRA)
>> <de...@myfaces.apache.org> wrote:
>> > Leonardo Uribe created MYFACES-3815:
>> > ---------------------------------------
>> >
>> >              Summary: Lazy instantiation of Renderer classes
>> >                  Key: MYFACES-3815
>> >                  URL: https://issues.apache.org/jira/browse/MYFACES-3815
>> >              Project: MyFaces Core
>> >           Issue Type: Improvement
>> >           Components: JSR-344
>> >             Reporter: Leonardo Uribe
>> >             Assignee: Leonardo Uribe
>> >
>> >
>> > The initialization algorithm create all Renderer instances at startup
>> > time. The side effect is a lot of classes are loaded into permgen memory
>> > without need.
>> >
>> > With a clever trick we can avoid that, providing a custom interfaces
>> > LazyRenderKit and making html basic renderkit implements it. Then, in the
>> > init code we check for that interface and if is present, we use it to
>> > register the Renderer in a lazy way, otherwise we use the standard form. Add
>> > the required method to RenderKit looks like a good idea for include it in
>> > the spec.
>> >
>> >
>> >
>> > --
>> > This message was sent by Atlassian JIRA
>> > (v6.1#6144)
>
>

Re: [jira] [Created] (MYFACES-3815) Lazy instantiation of Renderer classes

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi Mike

I have been doing some profiling with YourKit profiler, and I have seen
that with the patch already applied in trunk we avoid load around 400
classes at startup in the hello world application, which is about 20
renderers.

The solution will not have any side effects, because it is automatically
disabled if the environment requires to do so.

I'm doing some tests with Google Application Engine, to see how
far can we reduce the cold start time. It is hard, because JSF is quite
big and complex, but the idea is find ways to reduce the startup
time, and the patch seems to help a bit.

regards,

Leonardo Uribe


2013/11/2 Mike Kienenberger <mk...@gmail.com>

> I'm guessing this isn't that big a deal if you're only using the
> standard JSF libraries.   How many renderers are we talking about?
>
> I suppose it might be an issue if you have a project that include
> bunch of JSF libraries.
>
> On Fri, Nov 1, 2013 at 9:38 PM, Leonardo Uribe (JIRA)
> <de...@myfaces.apache.org> wrote:
> > Leonardo Uribe created MYFACES-3815:
> > ---------------------------------------
> >
> >              Summary: Lazy instantiation of Renderer classes
> >                  Key: MYFACES-3815
> >                  URL: https://issues.apache.org/jira/browse/MYFACES-3815
> >              Project: MyFaces Core
> >           Issue Type: Improvement
> >           Components: JSR-344
> >             Reporter: Leonardo Uribe
> >             Assignee: Leonardo Uribe
> >
> >
> > The initialization algorithm create all Renderer instances at startup
> time. The side effect is a lot of classes are loaded into permgen memory
> without need.
> >
> > With a clever trick we can avoid that, providing a custom interfaces
> LazyRenderKit and making html basic renderkit implements it. Then, in the
> init code we check for that interface and if is present, we use it to
> register the Renderer in a lazy way, otherwise we use the standard form.
> Add the required method to RenderKit looks like a good idea for include it
> in the spec.
> >
> >
> >
> > --
> > This message was sent by Atlassian JIRA
> > (v6.1#6144)
>

Re: [jira] [Created] (MYFACES-3815) Lazy instantiation of Renderer classes

Posted by Mike Kienenberger <mk...@gmail.com>.
I'm guessing this isn't that big a deal if you're only using the
standard JSF libraries.   How many renderers are we talking about?

I suppose it might be an issue if you have a project that include
bunch of JSF libraries.

On Fri, Nov 1, 2013 at 9:38 PM, Leonardo Uribe (JIRA)
<de...@myfaces.apache.org> wrote:
> Leonardo Uribe created MYFACES-3815:
> ---------------------------------------
>
>              Summary: Lazy instantiation of Renderer classes
>                  Key: MYFACES-3815
>                  URL: https://issues.apache.org/jira/browse/MYFACES-3815
>              Project: MyFaces Core
>           Issue Type: Improvement
>           Components: JSR-344
>             Reporter: Leonardo Uribe
>             Assignee: Leonardo Uribe
>
>
> The initialization algorithm create all Renderer instances at startup time. The side effect is a lot of classes are loaded into permgen memory without need.
>
> With a clever trick we can avoid that, providing a custom interfaces LazyRenderKit and making html basic renderkit implements it. Then, in the init code we check for that interface and if is present, we use it to register the Renderer in a lazy way, otherwise we use the standard form. Add the required method to RenderKit looks like a good idea for include it in the spec.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.1#6144)