0

Slow page

asked 2008-11-19 14:50:44 +0800

jsantos gravatar image 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 flag offensive retag edit

12 Replies

Sort by » oldest newest

answered 2008-11-19 17:42:13 +0800

hkn gravatar image hkn
246 3

Hi,

to give you some feedback
Linux/ FF3 about 7 seconds
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.

You should display a "please wait, still loading" wait screen, see

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

/regards
Horst

link publish delete flag offensive edit

answered 2008-11-19 17:48:02 +0800

hkn gravatar image 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.

link publish delete flag offensive edit

answered 2008-11-19 19:56:25 +0800

jsantos gravatar image jsantos
57

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

link publish delete flag offensive edit

answered 2008-11-19 20:08:06 +0800

jsantos gravatar image 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?

link publish delete flag offensive edit

answered 2008-11-19 22:44:47 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2008-11-20 09:10:36 +0800

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

Maybe you could start with "all closed" and fullfill="onOpen" and an addtional button/link "All" to open all at once.

/Robert

link publish delete flag offensive edit

answered 2008-11-20 09:00:38 +0800

hkn gravatar image 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

link publish delete flag offensive edit

answered 2008-11-20 17:46:47 +0800

jsantos gravatar image 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.

link publish delete flag offensive edit

answered 2008-11-20 20:01:45 +0800

hkn gravatar image 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>
					<label style="padding-left:15px" value="File:" />
					<textbox width="98%" />
				</row>
				<row>
					<label style="padding-left:15px" value="Type:" />
					<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>
					<label style="padding-left:15px" value="Options:" />
					<vbox>
						<textbox rows="3" width="98%" />
						<zscript><![CDATA[
						    
							String[] data = new String[100];
							for(int j=0; j < data.length; ++j) {
								data = "option "+j;
								Thread.sleep(50);
							}
						ListModel strset = new SimpleListModel(data);
						]]>
						</zscript>
						<listbox id="list" width="200px" rows="10" model="${strset}" >
							<listhead>
								<listheader label="Load on Demend" sort="auto" />
							</listhead>
						</listbox>
					</vbox>
				</row>
				<groupfoot spans="2">
					<label value="This a summary about Group 2" />
				</groupfoot>
			</rows>
		</grid>
	</window>
</zk>

link publish delete flag offensive edit

answered 2008-11-20 21:15:14 +0800

robertpic71 gravatar image 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

link publish delete flag offensive edit

answered 2008-11-20 22:35:50 +0800

jsantos gravatar image jsantos
57

updated 2008-11-20 22:51:20 +0800

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.
Thanks a lot for your answers.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-11-19 14:50:44 +0800

Seen: 600 times

Last updated: Nov 21 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More