IResourceSettings.setUseTimestampOnResources(true) and performance

classic Classic list List threaded Threaded
10 messages Options
hok
Reply | Threaded
Open this post in threaded view
|

IResourceSettings.setUseTimestampOnResources(true) and performance

hok
Hello,
I had a problem with slow loading of pages and response to ajax requests. After some debugging I traced the problem to be that wicket constantly tries:

DEBUG - UrlResourceStream          - cannot convert url: jar:file:/C:/Users/hok/.m2/repository/org/apache/wicket/wicket/1.5-M3/wicket-1.5-M3.jar!/org/apache/wicket/markup/html/wicket-event.js to file (URI is not hierarchical), falling back to the inputstream for polling
DEBUG - ResourceStreamLocator      - Attempting to locate resource 'org/apache/wicket/markup/html/wicket-event_en_US.js' on path [folders = [], webapppaths: []]
DEBUG - ResourceStreamLocator      - Attempting to locate resource 'org/apache/wicket/markup/html/wicket-event_en_US.js' using classloader sun.misc.Launcher$AppClassLoader@cac268

and this happens because that by default (or at least I think so) wicket adds timestamp on the resources - ResourceSettings.setUseTimestampOnResources(true) and every resource is read from the jar files on every request. When a resource is in a jar file a java.lang.IllegalArgumentException: URI is not hierarchical is thrown in the UrlResourceStream constructor and a lot of attempts are made to load the jar file through different loaders. In my case this led to a slow response times.
After disabling timestamp on resources (ResourceSettings.setUseTimestampOnResources(false)) the problem disappears and the performance is fine. However in the javadoc of setUseTimestampOnResources:

Enabling timestamps on resources will inject the last modification time of the resource into the filename (the name will look something like 'style-ts1282915831000.css' where the large number is the last modified date in milliseconds and '-ts' is a prefix to avoid conflicts with filenames that already contain a number before their extension. *

Since browsers and proxies use the filename of the resource as a cache key the changed filename will not hit the cache and the page gets rendered with the changed file.


In this case this useful functionality is lost. Is it possible to have "the best of both worlds"? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

Peter Ertl-3
Can you file an JIRA issue and attach a quickstart to reproduce this case?

That would help analyzing your mentioned issue tremendously...

Am 24.11.2010 um 20:27 schrieb hok:

>
> Hello,
> I had a problem with slow loading of pages and response to ajax requests.
> After some debugging I traced the problem to be that wicket constantly
> tries:
>
> DEBUG - UrlResourceStream          - cannot convert url:
> jar:file:/C:/Users/hok/.m2/repository/org/apache/wicket/wicket/1.5-M3/wicket-1.5-M3.jar!/org/apache/wicket/markup/html/wicket-event.js
> to file (URI is not hierarchical), falling back to the inputstream for
> polling
> DEBUG - ResourceStreamLocator      - Attempting to locate resource
> 'org/apache/wicket/markup/html/wicket-event_en_US.js' on path [folders = [],
> webapppaths: []]
> DEBUG - ResourceStreamLocator      - Attempting to locate resource
> 'org/apache/wicket/markup/html/wicket-event_en_US.js' using classloader
> sun.misc.Launcher$AppClassLoader@cac268
>
> and this happens because that by default (or at least I think so) wicket
> adds timestamp on the resources -
> ResourceSettings.setUseTimestampOnResources(true) and every resource is read
> from the jar files on every request. When a resource is in a jar file a
> java.lang.IllegalArgumentException: URI is not hierarchical is thrown in the
> UrlResourceStream constructor and a lot of attempts are made to load the jar
> file through different loaders. In my case this led to a slow response
> times.
> After disabling timestamp on resources
> (ResourceSettings.setUseTimestampOnResources(false)) the problem disappears
> and the performance is fine. However in the javadoc of
> setUseTimestampOnResources:
>
> Enabling timestamps on resources will inject the last modification time of
> the resource into the filename (the name will look something like
> 'style-ts1282915831000.css' where the large number is the last modified date
> in milliseconds and '-ts' is a prefix to avoid conflicts with filenames that
> already contain a number before their extension. *
>
> Since browsers and proxies use the filename of the resource as a cache key
> the changed filename will not hit the cache and the page gets rendered with
> the changed file.
>
> In this case this useful functionality is lost. Is it possible to have "the
> best of both worlds"? Thanks.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3057946.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

hok
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

hok
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

Peter Ertl-3
Thanks!

Am 24.11.2010 um 22:10 schrieb hok:

>
> https://issues.apache.org/jira/browse/WICKET-3194
> https://issues.apache.org/jira/browse/WICKET-3194 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3058085.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

Peter Ertl-3
fixed in trunk for 1.5

Am 24.11.2010 um 22:39 schrieb Peter Ertl:

> Thanks!
>
> Am 24.11.2010 um 22:10 schrieb hok:
>
>>
>> https://issues.apache.org/jira/browse/WICKET-3194
>> https://issues.apache.org/jira/browse/WICKET-3194 
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3058085.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mf
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

mf
What about Version 1.4.15?  I got this message for each request. I think i slows down, too?


DEBUG | 29.12. 13:31:55 | cannot convert url: jar:file:/D:/eclipse_jee_helios/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mytest/WEB-INF/lib/wicket-1.4.15.jar!/org/apache/wicket/markup/html/wicket-event.js to file (URI is not hierarchical), falling back to the inputstream for polling | UrlResourceStream.<init>() | org.apache.wicket.util.resource.UrlResourceStream
class org.apache.wicket.ajax.WicketAjaxReference, org/apache/wicket/ajax/wicket-ajax.js
DEBUG | 29.12. 13:31:55 | Attempting to locate resource 'org/apache/wicket/ajax/wicket-ajax.js' on path [folders = [], webapppaths: []] | ResourceStreamLocator.locateByResourceFinder() | org.apache.wicket.util.resource.locator.ResourceStreamLocator
DEBUG | 29.12. 13:31:55 | Attempting to locate resource 'org/apache/wicket/ajax/wicket-ajax.js' using classloader WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

Peter Ertl-3
1.4 is not affected - timestamps on resources are currently only available in wicket 1.5

Am 29.12.2010 um 15:49 schrieb mf:

>
> What about Version 1.4.15?  I got this message for each request. I think i
> slows down, too?
>
>
> DEBUG | 29.12. 13:31:55 | cannot convert url:
> jar:file:/D:/eclipse_jee_helios/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mytest/WEB-INF/lib/wicket-1.4.15.jar!/org/apache/wicket/markup/html/wicket-event.js
> to file (URI is not hierarchical), falling back to the inputstream for
> polling | UrlResourceStream.<init>() |
> org.apache.wicket.util.resource.UrlResourceStream
> class org.apache.wicket.ajax.WicketAjaxReference,
> org/apache/wicket/ajax/wicket-ajax.js
> DEBUG | 29.12. 13:31:55 | Attempting to locate resource
> 'org/apache/wicket/ajax/wicket-ajax.js' on path [folders = [], webapppaths:
> []] | ResourceStreamLocator.locateByResourceFinder() |
> org.apache.wicket.util.resource.locator.ResourceStreamLocator
> DEBUG | 29.12. 13:31:55 | Attempting to locate resource
> 'org/apache/wicket/ajax/wicket-ajax.js' using classloader WebappClassLoader
>  delegate: false
>  repositories:
>    /WEB-INF/classes/
> ----------> Parent Classloader:
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3167187.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

rajeev_yadav
Any updates on this issue? I am seeing this slowness  in 1.4.15 version also. Most of the time is spent in loading wicket js and css resources.
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

rajeev_yadav
In reply to this post by Peter Ertl-3
Any updates on this issue? I am seeing this slowness  in 1.4.15 version also. Most of the time is spent in loading wicket js and css resources.
Reply | Threaded
Open this post in threaded view
|

Re: IResourceSettings.setUseTimestampOnResources(true) and performance

Martin Grigorov-4
This is improved in 1.5 for sure.
I don't remember whether it is improved in 1.4.x or not.
Try with 1.4.17 (latest 1.4 release) and come back with the points
where you think it is slow.

On Thu, Jun 30, 2011 at 5:18 PM, rajeev_yadav <[hidden email]> wrote:

> Any updates on this issue? I am seeing this slowness  in 1.4.15 version also.
> Most of the time is spent in loading wicket js and css resources.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3635788.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]