• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

GWT slowness problem

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am displaying 843 rows x 8 columns (one date string and 7 ints) from my database using a Table from Google Visualization. I get the data through RPC (List)
The problem with it that it takes about 10 seconds to refresh. If i reorder it clicking on the columns it even freezes the browser for 10 seconds.
What can i do to make it faster?
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm, first of all, 843x8=6744 is a very large number, however, having so many cells in a table in html would usually
not hinder performance to that extent...

however data processing on the other hand can hinder the performance. how exactly are you retrieving data ?[formatted / raw ]
are you doing any processing on the data being retrieved or are you directly displaying the data on screen ?

a browser freeze usually occurs when thre is too much processing going on in the javascript code.
 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. What is your site made in (http://www.salvin.in), seems gadgets except they have no placeholders?

The large number of cells does not hinder HTML at all, as i was displaying it using JSP at first with under a second delay (unnoticeable).
Also the data itself is not an issue, the response is: 31.8 KB (32,626 bytes)

The process through which i display is through RPC, populating a list of beans through a simple ORM code, which i iterate and set the GWT Visualization Table Widget DataTable object.
Basicly i replicated this article method: http://www.ibm.com/developerworks/opensource/library/os-ad-gwt3/
Reflection might be the issue here.

This Table Widget has the functionality of sorting data as is, with javascript, and this is the reason for freezing; javascript is not suited for large operations (or so i read).
What i aim to eliminate though is the slowness of loading (although asynchronous it's annoying).

I already been given an answer on a mailing list in the form of:
http://www.ibm.com/developerworks/web/library/wa-aj-patterns/index.html
which seems a very good article, which i'll try later on, i believe it will fix my problem of loading the page. Don't know about the freezing part yet, the usual solution for processing problems is eliminate the processing (send more data as is after processing server side - but in the world of web development, sending more data over the internet is not a good solution). An optimization of the ideea i just described would be giving an array of the 'id' column coresponding to every other column, reordered in the order that a certain filtering would give (ascending or descending) - eg the filter would be if the string column needs be the factor of reordering, an underlying array of id values that would reorder the table after itself (not doing a sort comparing strings but reordering the table after the preordering of IDs coresponding to the strings).
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe you could do the sort operation at the server.

you are right in saying that its unwise to use javascript to do large complex operations.
Its advisible to make a dumb client that does not do operations such as sorting, filtering, etc.
those can be done at the server.

@ my site, i sent you a pm...
 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First time i see javascript's slowness in action though. The whole browser thing needs burning down and starting from scratch. I'm considering WPF(XBAP) and Silverlight after this again.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
silverlight requires your client to have a plugin installed,
GWT just requires javascript to be enabled,
consider this portability when thinking of changing your entire technology altogether.

 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not changing it, in the words of duke nukem: "i'm an equal oportunity ass kicker".
I'm doing all this for a portofolio, so my goal is to intermingle all the newest technologies.
I'm already doing struts 2 + GWT. Silverlight would be nice instead of flash for a banner for instance, or doing some animation since that's its strong point, beeing a light version of WPF. Speaking of which, WPF through XBAP can port desktop applications to the browser (enabling you to truly build real games if you wished to).

The real issue is the intrinsic problems it arises from each technology, XBAP has a loading issue, since it can be big, but only relative to the content in can do, so it's best for intranet high quality media on windows. Silverlight is a nice all rounder alternative to Flash. These guys are best for banners, flash enabled sites really kill my PC, i hate that. GWT is a good framework for building sites with medium quality graphics and its portability boosts it a long way. The fact that you can write Java instead of AJAX enabled javascript makes it a winner from the get go, not fogetting about the optimizations it does and building for different browsers automatically (which would really annoy me if i was doing plain javascript). Pointing out that there is a best tool for every situation, only bosses don't seem to figure that out always
 
author
Posts: 4354
45
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you testing using a stand alone instance, such as GWT running on Jetty, or are you using the Eclipse-based plugin server? I find the stand alone server runs a lot better than the compatibility mode test app the plugin uses.
 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand. I do debugging in hosted mode and i deploy on tomcat (using eclipse to publish), then i see the result in FF and IE7 (or in Eclipse's embedded browser).
I notice it being slow in the production phase.

I don't have time to do the optimizations, i set aside a bunch of techniques for later, to wich i linked above. One other issue as i pointed out is the lack of proper ORM.
I used this (which uses reflection), to populate a list of beans representing the rows:



When i looked at the code generated, the result is bloated out from the table's functionality, which i will trim down since i probably don't need it all.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tudor Andrei Raneti wrote:don't seem to figure that out always



Here is what one of my clients said:

I dont care whether you use java/pava technology or bullet technology, I just want it to show the output I am expecting.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you want to consider using speedtracer to figure out the bottlenecks?
 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the client doesn't pay for a technologies primer, it's his prerogative to ask and receive what he's paying for.

As for speedtracer, isn't that just for chrome? Kind of annoying that i have to get yet another browser.

I've been looking into Vaadin in the meantime, looks good, and hopefully the controls already "stream" the data in, hopefully.
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Maybe you want to consider using speedtracer to figure out the bottlenecks?



I agree with maneesh godbole, we too used speed tracer to figure out bottlenecks with code output style as "DETAILED" in GWT.
The best solution is Firebug, it profile result returns "own time" - Time spent by a function Excluding nested calls.
That is the best statistic you can look at !

I wish speed tracer did the same
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried the Bulk table renderer from the gwt-incubator project?

http://code.google.com/p/google-web-toolkit-incubator/
 
Tudor Raneti
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I switched to Vaadin, it comes with ready made lazy loading in its table controls.
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic