Hi Lucio

In my test app I have:

    <context-param>
        <param-name>org.apache.myfaces.GAE_JSF_JAR_FILES</param-name>
        <param-value>none</param-value>
    </context-param>

    <context-param>
        
<param-name>org.apache.myfaces.GAE_JSF_ANNOTATIONS_JAR_FILES</param-name>
        <param-value>none</param-value>
    </context-param>

Disabling annotation scanning and faces-config.xml or .taglib.xml
finding in jar files.

If I use the hack proposed before using GAEFacesConfigurationMerger
(store config into
datastore to retrieve it later) I have around 7 seconds. Without that
hack I can see
9 seconds.

Let's check this in deep. In the log I can see at start:

2012-06-07 09:08:52.618
org.apache.myfaces.webapp.Jsp20FacesInitializer
initContainerIntegration: This application isn't running in a JSP 2.1
container.

>From the moment GAEFacesConfigurationMerger takes the config from the datastore

2012-06-07 09:08:53.917 javax.servlet.ServletContext log:
Configuration found in DataStore, reading it
2012-06-07 09:08:54.121 javax.servlet.ServletContext log: Read
complete, returning

To the last line in the log

2012-06-07 09:08:54.928
org.apache.myfaces.webapp.WebConfigParamsLogger logWebContextParams:
No context init parameter 'org.apache.myfaces.FACES_INIT_PLUGINS'
found.
2012-06-07 09:08:57.446 This request caused a new process to be
started for your application, and thus caused your application code to
be loaded for the first time. This requ

You can see MyFaces takes about 1 second to initialize after read the
config from the datastore and 2.4 seconds overall. So from about 7
seconds it takes in my config, 2.4 or 3 are spent in MyFaces init and
the remaining ones are related to GAE.

To make more simple use GAEFacesConfigurationMerger, I have attached
the .java and the file that should be on META-INF/services/ as
resource file, (so if the file is in your war, it should
be in 
/WEB-INF/classes/META-INF/services/org.apache.myfaces.spi.FacesConfigurationMerger
)

It is still a mystery why it takes one second between the first line
and before read the config from the DataStore. The only code I can see
is the one who tries to lookup the SPI interface.

Please try with the previous tricks and let us know if it worked or not.

regards,

Leonardo Uribe

2012/6/7 lucio piccoli <[email protected]>:
> hi leonardo
>
> i have done some testing with the patch version and parameters.
>
> my results are below.
>
> setting                      JSF statup time(sec)
> --------------------------------------------------------
> unpatched                          11
> meta-data=true only           5
> GAE_JSF_JAR web.xml      10
>
>
> the clear winner was using the meta-data=true setting.
>
> *however* when using the above settings my applications fails to work
> correctly.
>
> it errors on finding a simple actionListener property on a backing bean. I
> have no idea what is going on.
>
> it has become too complicated for me.
>
> My only option at present is to use the existing slow load code.
>
>
> -lp
>
>
>
> On 7 June 2012 02:58, Leonardo Uribe <[email protected]> wrote:
>
>> Hi
>>
>> The patch include these two params:
>>
>>   /**
>>     * When the application runs inside Google Application Engine
>> container (GAE),
>>     * indicate which jar files should be scanned for files
>> (faces-config, facelets taglib
>>     * or annotations). It accept simple wildcard patterns like
>> myfavoritejsflib-*.jar or
>>     * myfavoritejsflib-1.1.?.jar. By default, all the classpath is
>> scanned for files
>>     * annotations (so it adds an small delay on startup).
>>     */
>>    @JSFWebConfigParam(since = "2.1.8, 2.0.14", expectedValues="none,
>> myfavoritejsflib-*.jar",
>>            tags="performance, GAE")
>>    public static final String INIT_PARAM_GAE_JSF_JAR_FILES =
>> "org.apache.myfaces.GAE_JSF_JAR_FILES";
>>    public final static String INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT = null;
>>
>>    /**
>>     * When the application runs inside Google Application Engine
>> container (GAE),
>>     * indicate which jar files should be scanned for annotations.
>> This param overrides
>>     * org.apache.myfaces.GAE_JSF_JAR_FILES behavior that tries to
>> find faces-config.xml or
>>     * files ending with .faces-config.xml in /META-INF folder and if
>> that so, try to
>>     * find JSF annotations in the whole jar file. It accept simple
>> wildcard patterns
>>     * like myfavoritejsflib-*.jar or myfavoritejsflib-1.1.?.jar.
>>     * By default, all the classpath is scanned for annotations (so it
>> adds an small
>>     * delay on startup).
>>     */
>>    @JSFWebConfigParam(since = "2.1.8, 2.0.14", expectedValues="none,
>> myfavoritejsflib-*.jar",
>>            tags="performance, GAE")
>>    public static final String INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES =
>>            "org.apache.myfaces.GAE_JSF_ANNOTATIONS_JAR_FILES";
>>    public final static String
>> INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT = null;
>>
>> with org.apache.myfaces.GAE_JSF_ANNOTATIONS_JAR_FILES, you can control
>> annotation scanning in jar files. Other option is use
>> WEB-INF/faces-config.xml
>> metadata-complete="true" flag (see jsf spec section 11.5.1) to disable
>> annotation scanning
>> on jar files at all.
>>
>> regards,
>>
>> Leonardo Uribe
>>
>> 2012/6/6 lucio piccoli <[email protected]>:
>> > hi leonardo
>> >
>> > i have done the following
>> > 1.replaced myfaces-core/api with the patched bundle.jar
>> > 2. added the following to web.xml
>> >  <context-param>
>> >        <param-name>org.apache.myfaces.GAE_JSF_JAR_FILES</param-name>
>> >        <param-value>none</param-value>
>> >    </context-param>
>> >
>> > the startup time has not changed.
>> > it is still scanning jars.
>> > from 9:33:11 to 9:33:18
>> > See attached log.
>> >
>> > INFO: This application isn't running in a JSP 2.1 container.
>> > 06/06/2012 9:33:10 AM
>> > org.apache.myfaces.config.DefaultFacesConfigurationProvide
>> > r getStandardFacesConfig
>> > INFO: Reading standard config META-INF/standard-faces-config.xml
>> > 06/06/2012 9:33:11 AM
>> > org.apache.myfaces.config.DefaultFacesConfigurationProvide
>> > r getWebAppFacesConfig
>> > INFO: Reading config /WEB-INF/faces-config.xml
>> > 06/06/2012 9:33:15 AM
>> > org.apache.myfaces.config.DefaultFacesConfigurationProvide
>> > r getClassloaderFacesConfig
>> > INFO: Reading config :
>> > jar:file:/C:/src/miiingle/venueportal/trunk/target/venuep
>> >
>> ortal-1.0-SNAPSHOT/WEB-INF/lib/richfaces-components-ui-4.2.1.Final.jar!/META-INF
>> > /faces-config.xml
>> > 06/06/2012 9:33:18 AM
>> > org.apache.myfaces.config.DefaultFacesConfigurationProvide
>> > r getClassloaderFacesConfig
>> > INFO: Reading config :
>> > jar:file:/C:/src/miiingle/venueportal/trunk/target/venuep
>> >
>> ortal-1.0-SNAPSHOT/WEB-INF/lib/richfaces-core-impl-4.2.1.Final.jar!/META-INF/fac
>> > es-config.xml
>> > 06/06/2012 9:33:18 AM
>> > org.apache.myfaces.config.DefaultFacesConfigurationProvide
>> > r getClassloaderFacesConfig
>> > INFO: Reading config :
>> > jar:file:/C:/src/miiingle/venueportal/trunk/target/venuep
>> >
>> ortal-1.0-SNAPSHOT/WEB-INF/lib/tomahawk20-1.1.13.jar!/META-INF/faces-config.xml
>> > 06/06/2012 9:33:18 AM org.apache.myfaces.config.LogMetaInfUtils
>> logArtifact
>> > INFO: Artifact 'myfaces-bundle' was found in version '2.1.8-SNAPSHOT'
>> from
>> > path
>> >
>> 'file:/C:/src/miiingle/venueportal/trunk/target/venueportal-1.0-SNAPSHOT/WEB-INF
>> > /lib/myfaces-bundle-2.1.8-SNAPSHOT.jar'
>> > 06/06/2012 9:33:18 AM org.apache.myfaces.config.LogMetaInfUtils
>> logArtifact
>> > INFO: Artifact 'tomahawk20' was found in version '1.1.13' from path
>> > 'file:/C:/sr
>> >
>> c/miiingle/venueportal/trunk/target/venueportal-1.0-SNAPSHOT/WEB-INF/lib/tomahaw
>> > k20-1.1.13.jar'
>> >
>> > -lp
>>
>
>
>
> --
> regards
>
> -Lucio Piccoli
>
> Director
> ------------------------------
> www.asteriski.com

Reply via email to