# Slow page

jsantos
57

Hi, I have a page with a huge form (around 300 fields). It takes about 20 seconds on IE8 to lay it out on the browser, after the browser finishes loading it. During that time I get just a white screen, no loading sign or anything. My users will surely think that the browser has crashed.

this is the url of the form:
http://81.25.195.209:8080/Odyssee/detailedsearch.zul

Is it normal that it takes so long or am I doing something wrong?

Best Regards,

Javier Santos

delete retag edit

## 12 Replies

hkn
246 3

Hi,

to give you some feedback
XP / IE7 about 24 seconds
Linux / Chrome via crossover 7 sec

As far as i know the IE java script engine is up to 2 to 5 times slower than FF / Chrome (depends on the functions)
and it looks that your form confirms this measurements.

http://www.zkoss.org/doc/devguide/ch05s03.html#id403752

/regards
Horst

hkn
246 3

Some suggestion to improve speed even for IE

- Load parts of the page on demand (fulfill)
http://www.zkoss.org/doc/devguide-single/index.html#id457301

That is how I bypassed a similar problem.

jsantos
57

Did any one try with the new firefox? aparently its javascript performance is better than the current version.

jsantos
57

Anyway, if I split the operation in two parts (first field group and re rest of the fields), then it would still take 24 seconds on IE (more because we have another round trip to the server) until the user can use the form. There are operating systems that boot faster than that.

Is it possible that i am doing something wrong and this is causing the problem?

robertpic71
1275 1

What kind of GUI-Element do you use for grouping the querypanels (Intérieur...).?

/Robert

hkn
246 3

hi javier,

I tested FF 2.0.0.18 and 3.0.3 which are the current versions. IE is version 7.0.5730.11.
FF2 is just a little bit slower then FF3.

IE, FF2 are running on XP, 2GB, 2GHz Centrino
Chrome & FF3, linux 64 bit, 8GB, quadcore 2.4GHz

I think you should follow Robert's suggestion

good luck

jsantos
57

How would you do the fulfill thing using java, instead of zul?

I looked for something like Group.setFullfill("onOpen")
but there is no such function.

hkn
246 3

Hello Javier !

I derived this from the live demo. When opened the form is shown immediately. Then when
you open "Group 2" i will take 5 seconds because of the sleeps and then opens the group and
displays the messagebox.

Hope that will help.

/Regards
Horst

test.zul:

<?page id="testZul" title=" New ZUL Title" cacheable="false"
language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<window title="My First Window" border="normal" width="400px">
<grid>
<columns sizable="true">
<column label="Type" sortAscending="${asc}" sortDescending="${dsc}" />
<column label="Content" />
</columns>
<rows>
<group>
<label value="Group1: type" />
<label value="Group1: content" />
</group>
<row>
<textbox width="98%" />
</row>
<row>
<hbox>
<listbox rows="1" mold="select">
<listitem label="Java Files,(*.java)" />
<listitem label="All Files,(*.*)" />
</listbox>
<button label="Browse..." />
</hbox>
</row>
<group id="gr" label="Group 2" open="false" />
<row fulfill="gr.onOpen">
<attribute name="onFulfill"><![CDATA[
Messagebox.show("Hello, I do fulfill NOW");
]]>
</attribute>
<vbox>
<textbox rows="3" width="98%" />
<zscript><![CDATA[

String[] data = new String[100];
for(int j=0; j < data.length; ++j) {
data = "option "+j;
}
ListModel strset = new SimpleListModel(data);
]]>
</zscript>
<listbox id="list" width="200px" rows="10" model="\${strset}" >
</listbox>
</vbox>
</row>
<groupfoot spans="2">
<label value="This a summary about Group 2" />
</groupfoot>
</rows>
</grid>
</window>
</zk>



robertpic71
1275 1

>> How would you do the fulfill thing using java, instead of zul?
Do you have zero zul-code - or maybe a skeleton groupboxes?

Is your javacode inside the groupboxes (extend Group)?

You have only to add the Group's and set it to close! You have to register an onOpen Event for each Group.
Inside the onOpen-Event (maybe you could foward to a composer?) you add the content of the groupbox.
Note: you need a flag - to handle a reopen correct (or remove Eventlistener)

Adding the content could be tricky thing. Because the seems not the childs form the group you need to know the row/group for the insertBefore.
If you could not handle this a dummy row after each group could help - i.e. <row id="d_interieur"/> in insertBefore this row and remove after fullfill.

However, you have split your creation code into the group and the groupcontent. The groupcontent should be triggered by the onOpen-Event.

/Robert

jsantos
57

Yes, I have a zero zul code. My .zul file is just a window that uses a class where everything happens.
From what you say I only need to maintain java references to the group objects after I create them, register the onOpen event and add the content when the event arrives. I do similar stuff in other parts of my code.

[hide preview]