Pregunta

I must do a RPC call when my Presenter is revealled. That call result in a String[] with large amount of data. But this call is very very slow. It takes about 1min to finish.

After some tests, i discovered that ListBox.addItem() takes over 30% of this call. It's a huge time for just add String on that Widget.

What can I do to minimize this time?

Assuming that i need to load everything when my Presenter reveal.

Things that I've already done:

  • Put my Query inside a View(Doesn't affect too much)
  • Server read a Txt file instead of call DB(worst then View).
  • Use Collections classes ArrayList,Vector...(Vector reduced time by 5%)

I've noticed that GWT designed a LightweightCollections to improve use of Collections on Client side(It's my next step).

But what can I do about ListBox?

¿Fue útil?

Solución

Too much choice is no choice.

You will not be able to tune up GWT Listbox/ValueListBox for purpose of displaying such huge amount data ( i am guessing entries in 1000's considering 20 seconds i.e 30% of 1 min). GWT Listbox is meant for selection. You cannot expect user to see 1000's of values , scroll and then select. Its a User Interaction nightmare.

  1. The right approach is use to Async loaded SuggestBox for such huge data. With SuggestBox you can filters and display lesser data as choice based on users input keys.

  2. If using SuggestBox is not feasible you must give a try for CellList in Cell Widgets ( they might show better performance ) - https://developers.google.com/web-toolkit/doc/latest/DevGuideUiCellWidgets

  3. I am not sure but give GWTChosen a try - http://jdramaix.github.com/gwtchosen/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top