Orkut Gmail Agenda Docs Web mais »
Grupos visitados recentemente | Ajuda | Acessar
Página inicial dos Grupos do Google
Is there any problem with having many "connect"s on a page?
Há um número excessivo de tópicos que aparecem em primeiro plano neste grupo. Para fazer com que este tópico apareça primeiro, elimine essa opção de um outro tópico.
Erro ao processar a solicitação. Tente novamente.
sinalizar
  17 mensagens - Recolher todas  -  Traduzir tudo para Traduzido (ver todos os originais)
O grupo no qual você está postando é um grupo da Usenet. As mensagens postadas neste grupo farão com que o seu e-mail fique visível para qualquer pessoa na internet.
Sua resposta não foi enviada.
Postagem publicada
 
De:
Para:
Cc:
Encaminhar para
Adicionar Cc | Adicionar Encaminhar para | Editar Assunto
Assunto:
Validação:
Com o objetivo de verificação, digite os caracteres que você vê na figura abaixo ou os números que ouvir ao clicar no ícone de acessibilidade. Ouça e digite os números que ouvir
 
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 19 jul 2006, 11:02
De: Jorge Godoy <jgo...@gmail.com>
Data: Wed, 19 Jul 2006 11:02:42 -0300
Local: Qua 19 jul 2006 11:02
Assunto: Is there any problem with having many "connect"s on a page?

Hi!

I'm generating some tables for data input and I'd like to perform one
calculation automatically, so I'd connect all inputs from one column to an
onchange event (using MochiKit.Signal, of course).

If I have something like 1000 rows on this table, would having 1000 "connect"s
be too much?  Is there a better way to make this automatic?  (I'd like to
avoid having to press a button to perform the calculation, but if there's no
way this is what I'll implement...)

This will be running mainly on Firefox (Linux and Windows) and Internet
Explorer (Windows).  Machines are reasonably fine and running Windows XP
(there's one with an updated version of IE running Windows 98, but only
because of other software, I believe it would run XP just fine.).

Thanks for any comments on that.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Beau Hartshorne  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 19 jul 2006, 14:35
De: Beau Hartshorne <hartsho...@gmail.com>
Data: Wed, 19 Jul 2006 10:35:00 -0700
Assunto: Re: [mochikit] Is there any problem with having many "connect"s on a page?
On 19-Jul-06, at 7:02 AM, Jorge Godoy wrote:

You should probably be fine. That said, test it with say 5,000 rows  
and see what happens, especially in IE. Firefox is not immune though,  
you should test it thoroughly too. If this breaks somehow, please  
open a new Trac ticket and attach your test case.

    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 19 jul 2006, 15:45
De: Jorge Godoy <jgo...@gmail.com>
Data: Wed, 19 Jul 2006 15:45:37 -0300
Local: Qua 19 jul 2006 15:45
Assunto: Re: [mochikit] Is there any problem with having many "connect"s on a page?

Beau Hartshorne <hartsho...@gmail.com> writes:
> You should probably be fine. That said, test it with say 5,000 rows and see
> what happens, especially in IE. Firefox is not immune though,  you should test
> it thoroughly too. If this breaks somehow, please  open a new Trac ticket and
> attach your test case.

I've just spoken to the client and we have found our "worst case scenario"
here, on an old machine running Win98 + IE 6 (the slower we have here).  I'll
write a test table and see how it performs there.

Thanks for your answer.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Peter Mularien  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 20 jul 2006, 08:48
De: "Peter Mularien" <pmular...@gmail.com>
Data: Thu, 20 Jul 2006 04:48:31 -0700
Local: Qui 20 jul 2006 08:48
Assunto: Re: Is there any problem with having many "connect"s on a page?
It will probably be too slow. I've found that once the number of
"connect"s on a page exceeds about 500, you get the dreaded "a script
on this page is running slowly" error before the browser finishes
evaluating all the connect's. Just my experience, I'd be interested in
yours. Another option would be to set a function on a timer that would
automatically recalculate by pulling the values of the fields you're
interested in on a periodic basis. This wouldn't have _quite_ the same
behavior, but would be pretty close, and would likely be a lot faster
to render the page.

    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 20 jul 2006, 10:44
De: Jorge Godoy <jgo...@gmail.com>
Data: Thu, 20 Jul 2006 10:44:24 -0300
Local: Qui 20 jul 2006 10:44
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

"Peter Mularien" <pmular...@gmail.com> writes:
> It will probably be too slow. I've found that once the number of
> "connect"s on a page exceeds about 500, you get the dreaded "a script
> on this page is running slowly" error before the browser finishes
> evaluating all the connect's. Just my experience, I'd be interested in
> yours. Another option would be to set a function on a timer that would
> automatically recalculate by pulling the values of the fields you're
> interested in on a periodic basis. This wouldn't have _quite_ the same
> behavior, but would be pretty close, and would likely be a lot faster
> to render the page.

Hmmm...  But it might cause some unexpected surprises such as values appearing
when the user is doing something else or putting too much load on the
browser.  On the other hand, it would make one thing easier to implement in
the future (but I'm not worried with that now and I don't even know if I'll
implement this new feature).

Since I'm also generating the table dinamically, I'm doing the process in two
steps:

    - creating the tables & using swapDOM to put them on screen (loops through
      the data)

    - looping again and connecting signals to the calculation function (I
      can't use the same loop because there's no element to connect to...)

This was my first approach, just to see if it would work for the client -- and
it does -- but I'm willing to make it robust and "correct".

I'll be doing the tests next Wednesday (I might be asking for the client to
test it before, but you know that his description is never like our "feeling"
of it...) and I'll post here the results.

For too many fields where filling them is a slow process it would be great to
be able to detect what has changed and do the operation just on it instead of
recalculating everything all the time (imagine how many useless calculations
would be done until the user fills 100 -- very very trivial to have that here,
common case would be something like 300... -- cells with values like "0,53",
"0,542", etc.).  

I would really prefer having something that is dinamically connected to each
cell that needs to be recalculated.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 20:11
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 20:11:14 -0300
Local: Ter 25 jul 2006 20:11
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

"Peter Mularien" <pmular...@gmail.com> writes:
> It will probably be too slow. I've found that once the number of
> "connect"s on a page exceeds about 500, you get the dreaded "a script
> on this page is running slowly" error before the browser finishes
> evaluating all the connect's. Just my experience, I'd be interested in
> yours. Another option would be to set a function on a timer that would
> automatically recalculate by pulling the values of the fields you're
> interested in on a periodic basis. This wouldn't have _quite_ the same
> behavior, but would be pretty close, and would likely be a lot faster
> to render the page.

Hi!

I finally got back to this project and you're correct.  I get a window asking
if I want to continue or to interrupt the script that is running.  I'll think
more about this...  Maybe if I mount the table piece by piece, putting blocks
of 100 rows each time this gets more manageable.

Thanks,
--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 20:20
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 20:20:10 -0300
Local: Ter 25 jul 2006 20:20
Assunto: Re: [mochikit] Is there any problem with having many "connect"s on a page?

Beau Hartshorne <hartsho...@gmail.com> writes:
> You should probably be fine. That said, test it with say 5,000 rows and see
> what happens, especially in IE. Firefox is not immune though,  you should test
> it thoroughly too. If this breaks somehow, please  open a new Trac ticket and
> attach your test case.

There was no bug, but it wasn't fast enough to be completed without Firefox
complaining about how long the script was taking to finish.

The main code for my test is:

  for (var index; index < 400; index++) {
    var sample = index;
    log ('Sample:', sample);
    var elements = [sample,
      INPUT({'name':sample+':sample',
             'id':sample+':sample'}, null),
      LABEL({'name':sample+':result',
             'id':sample+':result'}),
      [INPUT({'name':sample+':ignore_sample',
              'id':sample+':ignore_sample',
              'value': true,
              'type': 'checkbox'}, null),
       LABEL(null, 'Ignore Reading'),],
       ];
    extend(lines, new Array(elements));
    }

and later, in another function (after swapDOM...):

      for (var index; index < 400; index++) {
          var sample = index+':sample';
          connect(sample, 'onchange', calculate_results);
      }

Any hints on how to make it better would be appreciated.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Bob Ippolito  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 20:28
De: Bob Ippolito <b...@redivi.com>
Data: Tue, 25 Jul 2006 16:28:25 -0700
Local: Ter 25 jul 2006 20:28
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

On Jul 25, 2006, at 4:20 PM, Jorge Godoy wrote:

You should really never, ever, call "new Array". It's silly. In this  
case the array you created is new anyway.. why?

Also, index isn't initialized to 0.. so the first run through is  
going to be undefined... that can't be correct as written here.

> and later, in another function (after swapDOM...):

>       for (var index; index < 400; index++) {
>           var sample = index+':sample';
>           connect(sample, 'onchange', calculate_results);
>       }

> Any hints on how to make it better would be appreciated.

A full example that people could play with would help.

-bob


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 21:03
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 21:03:20 -0300
Local: Ter 25 jul 2006 21:03
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

Bob Ippolito <b...@redivi.com> writes:
> You should really never, ever, call "new Array". It's silly. In this case the
> array you created is new anyway.. why?

I dunno.  I've seen lots of codes using "new Array" and this is why I used
it. ;-)

> Also, index isn't initialized to 0.. so the first run through is going to be
> undefined... that can't be correct as written here.

It was the test code.  Real code comes with a value from the database.

> A full example that people could play with would help.

I'll write one and post on the ML again.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 21:30
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 21:30:12 -0300
Local: Ter 25 jul 2006 21:30
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

> I'll write one and post on the ML again.

Here it is.  You'll just have to fix the path to the packed version of
MochiKit.  This is just multiplying each numeric value by 3.

I've just made a few simplifications from my real case (where my for loop
iterates of a JSON result containing data that will be turned into table rows
instead of generating a loop with "known" indexes), but kept the structure of
everything else.

Thanks for your attention,
--
Jorge Godoy      <jgo...@gmail.com>

[ testing.html 1K ]


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Beau Hartshorne  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 21:42
De: Beau Hartshorne <hartsho...@gmail.com>
Data: Tue, 25 Jul 2006 17:42:17 -0700
Local: Ter 25 jul 2006 21:42
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?
On 25-Jul-06, at 5:30 PM, Jorge Godoy wrote:

> Here it is.  You'll just have to fix the path to the packed version of
> MochiKit.  This is just multiplying each numeric value by 3.

> I've just made a few simplifications from my real case (where my  
> for loop
> iterates of a JSON result containing data that will be turned into  
> table rows
> instead of generating a loop with "known" indexes), but kept the  
> structure of
> everything else.

I don't think you can attach anything to list posts. Could you please  
submit a trac ticket with an attachment?

Thanks!
Beau


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 21:50
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 21:50:42 -0300
Local: Ter 25 jul 2006 21:50
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

Beau Hartshorne <hartsho...@gmail.com> writes:
> I don't think you can attach anything to list posts. Could you please submit a
> trac ticket with an attachment?

It should have been attached inline after my signature.  But yes.  It is here:
http://trac.mochikit.org/ticket/152

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 22:18
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 22:18:36 -0300
Local: Ter 25 jul 2006 22:18
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

Jorge Godoy <jgo...@gmail.com> writes:
> Beau Hartshorne <hartsho...@gmail.com> writes:

>> I don't think you can attach anything to list posts. Could you please submit a
>> trac ticket with an attachment?

> It should have been attached inline after my signature.  But yes.  It is here:
> http://trac.mochikit.org/ticket/152

The limit that won't make the window appear seems to be 308.  So, something
like 615 (616 to be exact) loops in that construction is the limit for a
standar Firefox installation.

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Bob Ippolito  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 22:25
De: Bob Ippolito <b...@redivi.com>
Data: Tue, 25 Jul 2006 18:25:37 -0700
Local: Ter 25 jul 2006 22:25
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

On Jul 25, 2006, at 5:30 PM, Jorge Godoy wrote:

> Jorge Godoy <jgo...@gmail.com> writes:

>> I'll write one and post on the ML again.

> Here it is.  You'll just have to fix the path to the packed version of
> MochiKit.  This is just multiplying each numeric value by 3.

> I've just made a few simplifications from my real case (where my  
> for loop
> iterates of a JSON result containing data that will be turned into  
> table rows
> instead of generating a loop with "known" indexes), but kept the  
> structure of
> everything else.

Seems the attachment is missing...

-bob


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 25 jul 2006, 22:33
De: Jorge Godoy <jgo...@gmail.com>
Data: Tue, 25 Jul 2006 22:33:39 -0300
Local: Ter 25 jul 2006 22:33
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

Bob Ippolito <b...@redivi.com> writes:
> Seems the attachment is missing...

It appears on Google Groups and is attached to ticket #152 as well.  I dunno
why it appears on the web but isn't sent to users here...

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Jorge Godoy  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 31 jul 2006, 14:53
De: Jorge Godoy <jgo...@gmail.com>
Data: Mon, 31 Jul 2006 14:53:32 -0300
Local: Seg 31 jul 2006 14:53
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?

Jorge Godoy <jgo...@gmail.com> writes:
> Beau Hartshorne <hartsho...@gmail.com> writes:

>> I don't think you can attach anything to list posts. Could you please submit a
>> trac ticket with an attachment?

> It should have been attached inline after my signature.  But yes.  It is here:
> http://trac.mochikit.org/ticket/152

Hi!

Could you take a look at it?  Is my code wrong?  Should I adopt a different
approach to the problem? :-)

I'm really willing to go on with this part of the code (even though I'm
working on different parts simultaneously, this is pending on my side...).

--
Jorge Godoy      <jgo...@gmail.com>


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Beau Hartshorne  
Ver perfil   Traduzir para Traduzido (ver original)
 Mais opções 31 jul 2006, 15:14
De: Beau Hartshorne <hartsho...@gmail.com>
Data: Mon, 31 Jul 2006 11:14:35 -0700
Local: Seg 31 jul 2006 15:14
Assunto: Re: [mochikit] Re: Is there any problem with having many "connect"s on a page?
On 31-Jul-06, at 10:53 AM, Jorge Godoy wrote:

> Could you take a look at it?  Is my code wrong?  Should I adopt a  
> different
> approach to the problem? :-)

> I'm really willing to go on with this part of the code (even though  
> I'm
> working on different parts simultaneously, this is pending on my  
> side...).

Hi Jorge,

If you used native browser events to connect to a lot of elements,  
your page would probably slow to a crawl as well. I don't think your  
code or Signal are introducing any other problems on top of this one.

A solution to your problem might be to connect() at a higher level  
for an event, say on document or window. From there, you can see  
where it came from (http://mochikit.com/doc/html/MochiKit/
Signal.html#fn-target). Something like this *should* work in your  
situation, but you'll need to write and test the code to be sure.

Beau


    Responder ao autor    Encaminhar  
É necessário Acessar antes de postar mensagens.
Para postar uma mensagem você precisa primeiro participar deste grupo.
Atualize seu apelido na página de configurações da inscrição antes de postar.
Você não tem a permissão necessária para postar.
Fim das mensagens
« Voltar às Discussões « Tópico recente     Tópico antigo »

Criar um grupo - Grupos do Google - Página inicial do Google - Termos de Uso - Política de Privacidade
©2009 Google