Internet Explorer run-time issues

12 views
Skip to first unread message

joster

unread,
Oct 11, 2007, 10:01:48 PM10/11/07
to Google Web Toolkit
Hello All-

I have a GWT applications, I would say it is moderate size. The
application runs great on FireFox, however when I use IE to browse my
application, it is dog-slow.

Here are few characteristics of my application:
- few ImageBundles
- no large tables
- i do have tree widgets, but each tree-widget only has a < 15
elements
- i do have flash chart components
- i do make RPC calls to populate contents of widgets on the web-
site

My question: how do I go about debugging speed issues with IE for my
application?

TIA,
Joster

Peter Blazejewicz

unread,
Oct 11, 2007, 10:06:12 PM10/11/07
to Google Web Toolkit
hi Joster,
start with settings flash charts quality to "LOW" in init parameters,
Flash eats down cpu (especially if your charts are dynamic and has
alpha tweens),
regards,
Peter

joster

unread,
Oct 11, 2007, 11:32:55 PM10/11/07
to Google Web Toolkit
Hi Peter-

Thanks. I have made the change, I don't notice much change, although I
don't have a way to quantify/measure the delta-change. Any other BKMs
(best-known methods)?

I do notice that IE downloads all the images every time I click within
my application even though I am using Image Bundles. Any ideas what
the issue might be?

Joster

On Oct 11, 7:06 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:

meng

unread,
Oct 12, 2007, 4:05:23 AM10/12/07
to Google Web Toolkit
same here, IE does seem to take longer time and more memory....

i am rendering a long table of contents returned by RPC calls, in FF
the delay is negligible, but in IE you can see the rows are rendered
row by row(yes, i do use incrementalcommand to render row by row,
otherwise, it will just take too much time and be not responsive to
the user )......

I think the problem must rely in the IE dom impl, so we can't do much
about it..

Ibmurai

unread,
Oct 12, 2007, 4:40:13 AM10/12/07
to Google Web Toolkit
I'm developing a medium to large gwt application. Everything is about
10 times faster in FF, and the memory footprint is considerably
smaller...
I don't use flash at all.
I use VERY few imagebundles.

Also, since upgrading to 1.4.60 some images will randomly choose not
to load. Imagebundling images seems to fix this, but the oldschool
Images created with = new Image("images/image.png"), often don't work.

> > > > Joster- Hide quoted text -
>
> - Show quoted text -

arozsypal

unread,
Oct 12, 2007, 9:29:06 AM10/12/07
to Google Web Toolkit
Hi Joster,

I had a similar issue with IE. I had a dynamically loaded tree and it
took forever in IE6. I realized that an image bundle with the tree-
open.gif, tree_closed.gif images got repeatedly loaded. The thing is
that Tomcat and some other servers change the response headers so that
the web browser doesn't cache the images. In my case (Tomcat 5.5.20)
the solution was to add a filter that would add header "Cache-Control:
max-age=3600, public" to all GWT image responses.

You can read more in the GWT documentation:
http://code.google.com/webtoolkit/documentation/com.google.gwt.user.client.ui.ImageBundle.html.

Regards,
Tony

Axel Kittenberger

unread,
Oct 12, 2007, 10:59:41 AM10/12/07
to Google Web Toolkit
I do performance messurement with System.currentTimeMilles()

I will attach the code I use. Then you start putting a lot of
Profiler.entry("functionname");
Profiler.leave();
stuff in you code, where you want to know profile info, and then well
you go and test it.

Drawbacks: requires code changes, you have to think to precede every
possible way a function can exit with Profiler.leave(); and you can
only profile down to 1ms a step, if the process is faster you have a
hard time. :(

-----------------------
package org.ace.acearea.client;

import java.lang.System;
import java.util.Vector;
import java.util.Stack;

public class Profiler {
public static Vector times = new Vector();
static Stack stack = new Stack();
static long begin = 0;

public static void enter(String routine) {
ProfileEntry e = new ProfileEntry(routine,
stack.size(), System.currentTimeMillis(), 0);
times.add(e);
stack.push(e);
}

public static void leave() {
long end = System.currentTimeMillis();
ProfileEntry e = (ProfileEntry) stack.pop();
e.end = end;
}
}
-----------------------------
package org.ace.acearea.client;

public class ProfileEntry {
public String name;
public int level;
public long begin;
public long end;

public ProfileEntry(String name, int level, long begin, long
end) {
this.name = name;
this.level = level;
this.begin = begin;
this.end = end;
}
}
------------------------
package org.ace.acedemo.client;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;

import org.ace.acearea.client.Profiler;
import org.ace.acearea.client.ProfileEntry;

import java.util.Stack;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class ProfilerDialog extends DialogBox {
Button okButton = new Button("OK");
VerticalPanel vz = new VerticalPanel();
Tree tree = new Tree();

public ProfilerDialog() {
super(false, false);
DOM.setStyleAttribute(getElement(), "zIndex", "100");
setWidget(vz);
vz.add(tree);
vz.add(okButton);

TreeItem ti = new TreeItem("Profile Linear"); // tree
item
for (int i = 0; i < Profiler.times.size(); i++) {
ProfileEntry e = (ProfileEntry)
Profiler.times.get(i);
TreeItem ni = new TreeItem(e.name + ": " +
(e.end - e.begin) + " (" + e.level + ")");
ti.addItem(ni);
}
tree.addItem(ti);

ti = new TreeItem("Profile Tree"); // tree item
TreeItem li = ti; // last item
// ni = new item
tree.addItem(ti);
Stack stack = new Stack();

for (int i = 0; i < Profiler.times.size(); i++) {
ProfileEntry e = (ProfileEntry)
Profiler.times.get(i);
if (e.level == stack.size()) {
TreeItem ni = new TreeItem(e.name + ":
" + (e.end - e.begin));
ti.addItem(ni);
li = ni;
} else if (e.level > stack.size()) {
TreeItem ni = new TreeItem(e.name + ":
" + (e.end - e.begin));
li.addItem(ni);
stack.push(ti);
ti = li;
li = ni;
} else {
while (e.level < stack.size()) {
ti = (TreeItem) stack.pop();
}
TreeItem ni = new TreeItem(e.name + ":
" + (e.end - e.begin));
ti.addItem(ni);
li = ni;
}
}


setText("Profiler");
setStyleName("bluebg");

okButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
hide();
}
});
}
}
---------------------------


On Oct 12, 3:29 pm, arozsypal <arozsy...@gmail.com> wrote:
> Hi Joster,
>
> I had a similar issue with IE. I had a dynamically loaded tree and it
> took forever in IE6. I realized that an image bundle with the tree-
> open.gif, tree_closed.gif images got repeatedly loaded. The thing is
> that Tomcat and some other servers change the response headers so that
> the web browser doesn't cache the images. In my case (Tomcat 5.5.20)
> the solution was to add a filter that would add header "Cache-Control:
> max-age=3600, public" to all GWT image responses.
>

> You can read more in the GWT documentation:http://code.google.com/webtoolkit/documentation/com.google.gwt.user.c....

gwt.team.rdayal

unread,
Oct 12, 2007, 11:56:35 AM10/12/07
to Google Web Toolkit, joste...@gmail.com
@joster: Did arozyspal's solution help to fix your problem?

On Oct 12, 9:29 am, arozsypal <arozsy...@gmail.com> wrote:
> Hi Joster,
>
> I had a similar issue with IE. I had a dynamically loaded tree and it
> took forever in IE6. I realized that an image bundle with the tree-
> open.gif, tree_closed.gif images got repeatedly loaded. The thing is
> that Tomcat and some other servers change the response headers so that
> the web browser doesn't cache the images. In my case (Tomcat 5.5.20)
> the solution was to add a filter that would add header "Cache-Control:
> max-age=3600, public" to all GWT image responses.
>

> You can read more in the GWT documentation:http://code.google.com/webtoolkit/documentation/com.google.gwt.user.c....

gwt.team.rdayal

unread,
Oct 12, 2007, 12:09:30 PM10/12/07
to Google Web Toolkit
@meng: Are you using ImageBundles in your application?

@lbmurai: Can you tell me what the dimensions and size of the
generated image bundle image are?

With regard to displaying PNG files using the Image widget, take a
look at this bug report: http://code.google.com/p/google-web-toolkit/issues/detail?id=1284
You mentioned that this problem only started happening for you when
you upgraded to GWT 1.4.60. Was there a previous version of GWT that
you were using in which you did not see this problem? If so, what
version?


Thanks,
Rajeev

joster

unread,
Oct 12, 2007, 1:17:38 PM10/12/07
to Google Web Toolkit
Hi All-

Thanks for your help. I have been reading the documents and trying to
understand how to implement the cache-control filter.

As I understand, I need to do the following:

========= from a different thread in this forum ===================
) Make sure that clients don't cache the *.nocache.html file, since
when you recompile, you don't want a cached *.nocache.html file
referring to a no-longer-extant *.cache.html file. Use either "Pragma:
no-cache" or "Cache-Control" in your HTTP response header (the
to-be-written doc should give you some examples you can copy/paste).

3) Make sure that clients do cache the *.cache.html. In fact, GWT is
designed so that clients can safely cache these files forever. You can
do this with a far-in-the-future "Expires" or a "Cache-Control" age
header in the HTTP response. You'll really be glad if you configure
your server this way, because not only does the client not need to
download the compiled script again, it doesn't even need to ask
whether
it is fresh or not, which completely avoids an extra HTTP round-trip.
============================================================

My question:
- How do I do this?
- I need to add something to the WEB-INF/web.xml file, right?
- Could someone send some example snippets, please?

Joster

On Oct 12, 9:09 am, "gwt.team.rdayal" <gwt.team.rda...@gmail.com>
wrote:

rb

unread,
Oct 12, 2007, 1:59:33 PM10/12/07
to Google Web Toolkit
Add the following to your web.xml ( Change the package name ) :

<filter>
<filter-name>RequestFilter</filter-name>
<display-name>RequestFilter</display-name>
<filter-class>com.yourcompany.RequestFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>RequestFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Create the following servlet filter:

package com.yourcompany; // change this

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestFilter implements Filter
{
private static final String CACHE = ".cache.";
private static final String IMAGE_JPG = ".jpg";
private static final String IMAGE_PNG = ".png";
private static final String IMAGE_GIF = ".gif";

public void init(FilterConfig filterConfig) throws
ServletException {}

public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws java.io.IOException, ServletException
{
HttpServletRequest hreq = (HttpServletRequest)request;
HttpServletResponse hres =
(HttpServletResponse)response;
String uri = hreq.getRequestURI();

// Set cache headers for GWT cache and images
if ( uri.indexOf(CACHE) != -1 || uri.endsWith(IMAGE_GIF) ||
uri.endsWith(IMAGE_JPG) || uri.endsWith(IMAGE_PNG) )
{
// cache for one year
hres.addHeader("Cache-Control","max-age=31556926");
}

chain.doFilter(request, response);
}

public void destroy()
{
}
}

> > > > - Show quoted text -- Hide quoted text -

meng

unread,
Oct 14, 2007, 11:49:35 AM10/14/07
to Google Web Toolkit
Hi Rajeev,

I have only one imagebundle and that is very small, just the logo, a
few small-size icons. And no images are used in rendering the long
table....

The widgets in each row are somehow a bit complicated, having some
keylisteners, focuslisteners...


On Oct 13, 12:09 am, "gwt.team.rdayal" <gwt.team.rda...@gmail.com>
wrote:

Ibmurai

unread,
Oct 16, 2007, 5:05:27 AM10/16/07
to Google Web Toolkit
Best. Post. Ever :)
Thanks a lot!

On 12 Okt., 15:29, arozsypal <arozsy...@gmail.com> wrote:
> Hi Joster,
>
> I had a similar issue with IE. I had a dynamically loaded tree and it
> took forever in IE6. I realized that an image bundle with the tree-
> open.gif, tree_closed.gif images got repeatedly loaded. The thing is
> that Tomcat and some other servers change the response headers so that
> the web browser doesn't cache the images. In my case (Tomcat 5.5.20)
> the solution was to add a filter that would add header "Cache-Control:
> max-age=3600, public" to all GWT image responses.
>

> You can read more in the GWT documentation:http://code.google.com/webtoolkit/documentation/com.google.gwt.user.c....

> > - Show quoted text -- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

@rdayal: Not really, but it's not much... I think the cache thing will
do it for me... On it... :)

Ibmurai

unread,
Oct 24, 2007, 6:42:49 AM10/24/07
to Google Web Toolkit
It turns out, that our professional Cisco router was annoyed by the
insane amount of requests, due to IE constantly asking the server:
"Has this image changed?", 300 to 400 times per login, since I use the
same image a lot...
That caused the router to simply eat some of the requests, and GWT
sees this as an empty reply, somehow...
Therefore the cache thing relieved ALL of my problems... To everyone
else: "DO IT!" - "Do the cache control thing!" :)

> do it for me... On it... :)- Hide quoted text -

Reply all
Reply to author
Forward
0 new messages