views:

204

answers:

5

I'm using Google Web Toolkit (GWT) to implement a complex application on the web. I was wondering, however, how many components can be included into a single page (a.k.a. entry point) before the browser becomes unusably slow? Would I be better to break my application down into multiple smaller web pages?

+1  A: 

I would be more worried about usability than resources.

The page will stop being usable way before it starts to get laggy. If you put too many things on one page it will overload your users.

Try to divide the site up into different sections. Many sites, SO for example, has tabs at the top to choose from different functionality or views. Some sites also use a side-bar with a hierarchy of links to get to pages deeper in the site quickly.

Ben S
A: 

Using Tabs to separate functionality can still result in a huge DOM within a single page - since tabs work by hiding divs. However, these divs are still consuming some browser resources. If I were in you, I would therefore split the entry point, with tabs pointing to different web pages loaded on demand. I would apply this to every individual item, wherever possible. But this is only my opinion.

Tonio
+1  A: 

I read many times, that one should not worry to much about performance beforehand, because ...

  1. ... as computers will become faster during development, your improvement won't be recognized that much.
  2. ... the bottleneck won't be what you think but something else. Measure your application regulary.

And switching from a widget to a seperate site isn't very complicated with GWT, as their documentation states. But consider changing between your two solutions when you are designing it.

Christian Strempfer
Performance should be monitored early during the development process. Otherwise it is possible to invest a lot of effort into a particular design, only to find out it won't scale.
Robert Harvey
I fully agree with Robert, no matter how good computers will turn, that's no excuse for poor design.
Thrawn
@Robert: Maybe I was unclear. I didn't want to say he should measure his application when it's finished, but as soon as he has runable code.
Christian Strempfer
@Thrawn: I thought the last hours about your comment, but I don't see how it is related to the statements about. Maybe a good design will make later improvements easier. I'll include that into my answer.
Christian Strempfer
+2  A: 

I would take a look at how your users actually use the site.
If you find a nice separation of GWT apps (each user sticks to their own little GWT app), then I don't see why you can't separate them.
If, however, you find your users are constantly switching from one app to another, and incurring the overhead of starting up the other app, then you may want to consider one monolithic app. I would lean towards this approach, unless of course you are making very intense apps. I doubt the browsers will have much trouble with the highly optimized JavaScript GWT puts out.

Jack M.
+1  A: 

You need to remember that you don't have to have multiple entry points to build discrete widgets. A single entry point can inject as many widgets as you want onto a given page. So all you need to worry about is how to split up your application based on how a user would use it.

rustyshelf