You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Aleksei Valikov <va...@gmx.net> on 2006/03/17 20:49:35 UTC

General question to AJAX stuff from the sandbox

Hi.

I have tried inputSuggestAjax from the sandbox. The component works more 
or less fine (sometimes it fails to find target components, but that's 
not a big problem).

However what bothers me is that web pages are becoming really much 
slower. inputSuggestAjax is based on the dojo framework and this results 
in loading more than 100kb of scripts for every page that uses AJAX 
components. Even copying scripts into a static directory and configuring 
JSFAttr.JAVASCRIPT_LOCATION does not help - for instance, Firefox does 
not cache scripts loaded from other scripts (only root script gets 
cached, all other script are re-requested from the server on every page 
reload.

Anyway, even if scripts are cached, the processing is really slow. Does 
MyFaces AJAX really needs the whole dojo framework?

I'd be grateful for any hints on AJAX components working fine (and fast) 
with MyFaces.

Bye.
/lexi

Re: General question to AJAX stuff from the sandbox

Posted by Werner Punz <we...@gmx.at>.
Aleksei Valikov schrieb:
> Hi.
> 
> I have tried inputSuggestAjax from the sandbox. The component works more
> or less fine (sometimes it fails to find target components, but that's
> not a big problem).
> 
> However what bothers me is that web pages are becoming really much
> slower. inputSuggestAjax is based on the dojo framework and this results
> in loading more than 100kb of scripts for every page that uses AJAX
> components. Even copying scripts into a static directory and configuring
> JSFAttr.JAVASCRIPT_LOCATION does not help - for instance, Firefox does
> not cache scripts loaded from other scripts (only root script gets
> cached, all other script are re-requested from the server on every page
> reload.
> 
> Anyway, even if scripts are cached, the processing is really slow. Does
> MyFaces AJAX really needs the whole dojo framework?
> 
> I'd be grateful for any hints on AJAX components working fine (and fast)
> with MyFaces.
> 
I am aware of these problems, they are resolvable by either having a
full myfaces build of dojo, or by static includes, I will tackle this
problem as soon as we have solved our other components problems and
before I move dojo into the tomahawk core.
As for now the dojo integration is rather new so have in mind that
problems like this can arise.

The loading problem was a huge issue I researched into before deciding
to move forward towards dojo, since it was a huge burden for me as well.
I only started the integration due to the fact that this problem is
resolvable by having a full blown build and static includes of the
affected sources in the long run. (So the scripts in the future wont
become smaller but will be cached)

As for now it is possible to reduce the loading time on Mozilla but it
is not done yet.


Re: General question to AJAX stuff from the sandbox

Posted by Aleksei Valikov <va...@gmx.net>.
Werner, Gerald,

Thank you guys for responding.

I do understand that inputSuggestAjax is in the sandbox. Only wanted to 
make sure that you are aware of the issues and are somehow intending to 
resolve them.
Thanks again for your answers.

Bye.
/lexi

Re: General question to AJAX stuff from the sandbox

Posted by Gerald Müllan <bi...@gmail.com>.
Oh..Werner was faster in responding :)

Thx for the explanation Werner!

On 3/23/06, Gerald Müllan <bi...@gmail.com> wrote:
> Hi,
>
> I have talked to werner about this performance issue;
>
> Should be only a matter of configuration after implementing this
> possibility to our dojo comps.
>
> Then it will be no problem to load all needed dojo packages as one
> bigger (also compressed) .js file at the beginning.
>
> So, currently not available, but it will come in the near future! :)
>
> regards,
>
> Gerald
>
> On 3/21/06, Aleksei Valikov <va...@gmx.net> wrote:
> > Hi.
> >
> > > I have tried the dojo inputSuggest in a few applications, never had
> > > problems with slow loading times. Now with server side state saving,
> > > as you have said, every needed dojo class is loaded, and this results
> > > in many js files.
> >
> > I've studied it a bit closer. Here's a small log of what's actually
> > loaded from the server:
> >
> > NO.      Duration(s)  Size   URL
> >     1     1,031 s      64866  record/edit.html
> >
> >     2     0,014 s      773    script/widget/__package__.js
> >
> >     3     0,141 s      6280   script/xml/Parse.js
> >
> >     4     0,249 s      14957  script/widget/Widget.js
> >
> >     5     0,203 s      9668   script/widget/Manager.js
> >
> >     6     0,061 s      10765  script/widget/Parse.js
> >
> >     7     0,094 s      17584  script/widget/DomWidget.js
> >
> >     8     0,000 s      598    script/uri/__package__.js
> >
> >     9     0,078 s      6209   script/widget/HtmlWidget.js
> >
> >     10    0,031 s      5865   script/widget/ComboBox.js
> >
> >     11    0,124 s      12611  script/widget/html/ComboBox.js
> >
> >     12    0,000 s      718    script/io/__package__.js
> >
> >     13    0,000 s      3328   script/io/cookie.js
> >
> >     14    0,046 s      6045   script/widget/html/stabile.js
> >
> >     15    0,094 s      5829   script/widget/Wizard.js
> >
> >     16    0,000 s      712    script/widget/LayoutPane.js
> >
> >     17    0,109 s      11399  script/widget/html/LayoutPane.js
> >
> >     18    0,031 s      574    script/widget/Container.js
> >
> >     19    0,000 s      1393   script/widget/html/Container.js
> >
> >     20    0,015 s      2298   script/collections/ArrayList.js
> >
> >     21    0,000 s      2087   script/collections/Collections.js
> >
> >
> > (Note: this page was already accessed before, so all of the scripts were
> > already loaded once).
> >
> > It's 20 scripts of more than 100K, loaded in ~1 sec. Could this be
> > somehow optimized?
> >
> > Bye.
> > /lexi
> >
>
>
> --
> Gerald Muellan
> Schelleingasse 2/11
> 1040 Vienna, Austria
> 0043 699 11772506
> Bierbrauen@gmail.com
>


--
Gerald Muellan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com

Re: General question to AJAX stuff from the sandbox

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

I have talked to werner about this performance issue;

Should be only a matter of configuration after implementing this
possibility to our dojo comps.

Then it will be no problem to load all needed dojo packages as one
bigger (also compressed) .js file at the beginning.

So, currently not available, but it will come in the near future! :)

regards,

Gerald

On 3/21/06, Aleksei Valikov <va...@gmx.net> wrote:
> Hi.
>
> > I have tried the dojo inputSuggest in a few applications, never had
> > problems with slow loading times. Now with server side state saving,
> > as you have said, every needed dojo class is loaded, and this results
> > in many js files.
>
> I've studied it a bit closer. Here's a small log of what's actually
> loaded from the server:
>
> NO.      Duration(s)  Size   URL
>     1     1,031 s      64866  record/edit.html
>
>     2     0,014 s      773    script/widget/__package__.js
>
>     3     0,141 s      6280   script/xml/Parse.js
>
>     4     0,249 s      14957  script/widget/Widget.js
>
>     5     0,203 s      9668   script/widget/Manager.js
>
>     6     0,061 s      10765  script/widget/Parse.js
>
>     7     0,094 s      17584  script/widget/DomWidget.js
>
>     8     0,000 s      598    script/uri/__package__.js
>
>     9     0,078 s      6209   script/widget/HtmlWidget.js
>
>     10    0,031 s      5865   script/widget/ComboBox.js
>
>     11    0,124 s      12611  script/widget/html/ComboBox.js
>
>     12    0,000 s      718    script/io/__package__.js
>
>     13    0,000 s      3328   script/io/cookie.js
>
>     14    0,046 s      6045   script/widget/html/stabile.js
>
>     15    0,094 s      5829   script/widget/Wizard.js
>
>     16    0,000 s      712    script/widget/LayoutPane.js
>
>     17    0,109 s      11399  script/widget/html/LayoutPane.js
>
>     18    0,031 s      574    script/widget/Container.js
>
>     19    0,000 s      1393   script/widget/html/Container.js
>
>     20    0,015 s      2298   script/collections/ArrayList.js
>
>     21    0,000 s      2087   script/collections/Collections.js
>
>
> (Note: this page was already accessed before, so all of the scripts were
> already loaded once).
>
> It's 20 scripts of more than 100K, loaded in ~1 sec. Could this be
> somehow optimized?
>
> Bye.
> /lexi
>


--
Gerald Muellan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com

Re: General question to AJAX stuff from the sandbox

Posted by Werner Punz <we...@gmx.at>.
Aleksei Valikov schrieb:
> Hi.
> 
>> I have tried the dojo inputSuggest in a few applications, never had
>> problems with slow loading times. Now with server side state saving,
>> as you have said, every needed dojo class is loaded, and this results
>> in many js files.
> 
> I've studied it a bit closer. Here's a small log of what's actually
> loaded from the server:
> 
> NO.      Duration(s)  Size   URL
>    1     1,031 s      64866  record/edit.html
>    2     0,014 s      773    script/widget/__package__.js
>    3     0,141 s      6280   script/xml/Parse.js
>    4     0,249 s      14957  script/widget/Widget.js
>    5     0,203 s      9668   script/widget/Manager.js
>    6     0,061 s      10765  script/widget/Parse.js
>    7     0,094 s      17584  script/widget/DomWidget.js
>    8     0,000 s      598    script/uri/__package__.js
>    9     0,078 s      6209   script/widget/HtmlWidget.js
>    10    0,031 s      5865   script/widget/ComboBox.js
>    11    0,124 s      12611  script/widget/html/ComboBox.js
>    12    0,000 s      718    script/io/__package__.js
>    13    0,000 s      3328   script/io/cookie.js
>    14    0,046 s      6045   script/widget/html/stabile.js
>    15    0,094 s      5829   script/widget/Wizard.js
>    16    0,000 s      712    script/widget/LayoutPane.js
>    17    0,109 s      11399  script/widget/html/LayoutPane.js
>    18    0,031 s      574    script/widget/Container.js
>    19    0,000 s      1393   script/widget/html/Container.js
>    20    0,015 s      2298   script/collections/ArrayList.js
>    21    0,000 s      2087   script/collections/Collections.js
> 
> (Note: this page was already accessed before, so all of the scripts were
> already loaded once).
> 
> It's 20 scripts of more than 100K, loaded in ~1 sec. Could this be
> somehow optimized?
> 
> Bye.
> /lexi
> 
Alex see my other posting regarding this, this is a general issue many
people have with dojo, and it is solvable by having either static
includes of the js files or by making a custom myfaces dojo build with
all the affected dojo classes within one single js file.
This problem will be tackled before I will move the codebase to
tomahawk, as for now I am simply to busy with deadlines on other dojo
based components
(http://wuerg.kicks-ass.net:8080/spellchecker/sp_dojo.html ie only) to
tackle this.

()


Re: General question to AJAX stuff from the sandbox

Posted by Aleksei Valikov <va...@gmx.net>.
Hi.

> I have tried the dojo inputSuggest in a few applications, never had
> problems with slow loading times. Now with server side state saving,
> as you have said, every needed dojo class is loaded, and this results
> in many js files.

I've studied it a bit closer. Here's a small log of what's actually 
loaded from the server:

NO.      Duration(s)  Size   URL
    1     1,031 s      64866  record/edit.html 

    2     0,014 s      773    script/widget/__package__.js 

    3     0,141 s      6280   script/xml/Parse.js 

    4     0,249 s      14957  script/widget/Widget.js 

    5     0,203 s      9668   script/widget/Manager.js 

    6     0,061 s      10765  script/widget/Parse.js 

    7     0,094 s      17584  script/widget/DomWidget.js 

    8     0,000 s      598    script/uri/__package__.js 

    9     0,078 s      6209   script/widget/HtmlWidget.js 

    10    0,031 s      5865   script/widget/ComboBox.js 

    11    0,124 s      12611  script/widget/html/ComboBox.js 

    12    0,000 s      718    script/io/__package__.js 

    13    0,000 s      3328   script/io/cookie.js 

    14    0,046 s      6045   script/widget/html/stabile.js 

    15    0,094 s      5829   script/widget/Wizard.js 

    16    0,000 s      712    script/widget/LayoutPane.js 

    17    0,109 s      11399  script/widget/html/LayoutPane.js 

    18    0,031 s      574    script/widget/Container.js 

    19    0,000 s      1393   script/widget/html/Container.js 

    20    0,015 s      2298   script/collections/ArrayList.js 

    21    0,000 s      2087   script/collections/Collections.js 


(Note: this page was already accessed before, so all of the scripts were 
already loaded once).

It's 20 scripts of more than 100K, loaded in ~1 sec. Could this be 
somehow optimized?

Bye.
/lexi

Re: General question to AJAX stuff from the sandbox

Posted by Werner Punz <we...@gmx.at>.
Aleksei Valikov schrieb:

> I just think that inputSuggestAjax does not really need 100Kb scripts.
> (I would be pretty much surprized if that would be the case). So I
> really hope that scripts will be optimized...
> 
Getting down on the code amount is up to the dojo guys, but as soon as
the scripts are cached, which is possible, I do not see the problem in
there anymore.

Given the fact that you have 100k only once, which is the typical size
of a handful of pictures in a typical webapp anyway.

Users will have a loading impact on that only once and only for 1-2
seconds (as soon as the scripts are not ajaxed anymore) only once at the
first load and then not until they dump their cache.

I have been thinking about all these issues for some time, and I dont
think it is that much of an issue given that most pages serve way more
than 100k of pics normally. So serving 100-200k of scripts once and then
having them loaded from the cache is not that much of an issue.


Re: General question to AJAX stuff from the sandbox

Posted by Aleksei Valikov <va...@gmx.net>.
Hi.

> the problem of not finding the ajax components should only occur in a
> row of a dataTable.

Not only... I use a lot of programmatically created components. 
Sometimes they get automatic ids - probably that's the reason.

> I have tried the dojo inputSuggest in a few applications, never had
> problems with slow loading times. Now with server side state saving,
> as you have said, every needed dojo class is loaded, and this results
> in many js files.
> 
> I know that dojo supports some kind of compressing js code and - what
> is more important -
> there is a way of loading only one js file where all stuff is
> included. Maybe that helps with speeding up the connection.

I just think that inputSuggestAjax does not really need 100Kb scripts. 
(I would be pretty much surprized if that would be the case). So I 
really hope that scripts will be optimized...

Bye.
/lexi

Re: General question to AJAX stuff from the sandbox

Posted by Gerald Müllan <bi...@gmail.com>.
Hi Aleksei,

the problem of not finding the ajax components should only occur in a
row of a dataTable.

For this we have now the possibility of UIComponentPerspective, which
helps to find components also with this issue.

We have to add only a few lines of code to the
AjaxDecodePhaseListener; i will submit a patch the next days for this,
also need this stuff :)

I have tried the dojo inputSuggest in a few applications, never had
problems with slow loading times. Now with server side state saving,
as you have said, every needed dojo class is loaded, and this results
in many js files.

I know that dojo supports some kind of compressing js code and - what
is more important -
there is a way of loading only one js file where all stuff is
included. Maybe that helps with speeding up the connection.

But Werner should know more about this; Werner, can you help out on this topic?

regards,

Gerald

On 3/17/06, Aleksei Valikov <va...@gmx.net> wrote:
> Hi.
>
> I have tried inputSuggestAjax from the sandbox. The component works more
> or less fine (sometimes it fails to find target components, but that's
> not a big problem).
>
> However what bothers me is that web pages are becoming really much
> slower. inputSuggestAjax is based on the dojo framework and this results
> in loading more than 100kb of scripts for every page that uses AJAX
> components. Even copying scripts into a static directory and configuring
> JSFAttr.JAVASCRIPT_LOCATION does not help - for instance, Firefox does
> not cache scripts loaded from other scripts (only root script gets
> cached, all other script are re-requested from the server on every page
> reload.
>
> Anyway, even if scripts are cached, the processing is really slow. Does
> MyFaces AJAX really needs the whole dojo framework?
>
> I'd be grateful for any hints on AJAX components working fine (and fast)
> with MyFaces.
>
> Bye.
> /lexi
>


--
Gerald Muellan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com