LiveQuery when used for events does not use event delegation. It binds the
event directly to the matched elements. The reason the latest version of
LiveQuery depends on 1.3.x is to take advantage of some internal changes to
jQuery, not because it uses live. The live method in jQuery uses event
delegation.
If you use LiveQuery *a lot* then you will most likely see slow downs. Live
Query tries to be non-invasive about its operations but if it is a large dom
with lots of queries, then it will be slow. You can minimize these affects
by using a context and good selectors.

The reason to use LiveQuery over live is if you need to do something more
than bind an event or if event delegation just doesn't work for the event
you are binding. Otherwise you should use live if you need to bind events to
a large number of dom elements that may or may not be in existence at
runtime. If it is a small number of elements and they exist at runtime then
you should still use bind.

--
Brandon Aaron


On Sun, Apr 19, 2009 at 11:16 AM, Geoffrey <geoffreykjqu...@gmail.com>wrote:

>
> $.live and Live Query are both wonderful. I am hoping to put them to
> extensive use in my projects.
>
> I have a few questions about $.live and Live Query and their effect on
> performance.
>
> Background: If I recall correctly, the original release of Live Query
> could have some performance problems. I don't remember if things
> bogged down when the DOM had a lot of elements, when you added a large
> number of Live Query events, did a lot of updating or exactly what.
>
> Question 1:
> What were the specific concerns around performance with the 1.0.x
> releases of Live Query?
>
> Now with jquey 1.3, there is $.live. $.live does not do everything
> that Live Query does, but does do some of it.
>
> Question 2:
> Does $.live use a different technique for handling events than Live
> Query?
>
> Question 2a:
> If it is different, are there any performance concerns using $.live
> like there used to be with Live Query?
>
> Live Query 1.1.x requires jquery 1.3. I am guessing that the new
> version uses $.live internally.
>
> Question 3a:
> Is the performance of Live Query better in the 1.1.x version?
>
> Question 3b:
> Are there some selectors that have better performance than others? or
> to say it another way, do all of the selectors perform the same or,
> for example, does
> $('input').livequery('click', function() { });
> perform better than
> $('input').livequery('change', function() { });?
>
> Using $.live or Live Query.
> Question 4:
> Is there any difference in performce between using
> $('input').livequery('click', function() { });
> vs
> $("input").live("click", function(){ });?
>
>
> I am thinking of really diving in to using $.live and/or Live Query. I
> am trying to get a complete understanding of all of the issues that
> may arise.
>
> Thanks
> -Geoff
>
>
>
>

Reply via email to