On Sat, Apr 11, 2009 at 4:57 AM, Dean S. Jones <[email protected]> wrote:

>
> I'm not saying IncrementalCommand doesn't help, it just breaks up the
> JavaScript into smaller units, adding DeferredCommand lets the "GIF
> Animation" use the thread while the JS is scheduled to run.

Which exactly solves the problem he is having whereby the animation freezes.


> Async has
> alot to do with it... while waiting for a reply, the browser thread is
> free, quiescent, ...

right, but nowhere did he mention he was making an RPC call or some other
kind of AJAX request.  This is strictly regular Javascript code.


> the combination of both Incremental and Deferred
> can smooth the effect tho.

DeferredCommand is simply a utility to append code to be executed at the end
of the current event loop.  It's not about smoothing the effect - it
actually will remove any freezes in your animation if you make your
incremental steps small enough (you might get like at most 3-6 milliseconds
of jitter if you do it right, which you'll never actually see or even be
able to measure).


>
>
> On Apr 11, 4:42 am, Vitali Lovich <[email protected]> wrote:
> > On Sat, Apr 11, 2009 at 4:30 AM, Dean S. Jones <[email protected]>
> wrote:
> >
> >
> >
> > > onModuleLoad() the culprit... anytime a significant amount of
> > > JavaScript is run, it uses the single browser thread. That same thread
> > > is
> > > used to run "Animated GIF's", hence they freeze while script is being
> > > run. Breaking up the tasks will only make the GIF animation
> > > "choppy" while waiting for an Async call to return.
> >
> > What does an async call have to do with this?  That's networking stuff
> which
> > doesn't apply here.
> >
> > I said used DeferredCommand with IncrementalCommand which simply keeps
> > appending an event to be processed on the event thread while there's more
> > work to be done.  Make sure that every invocation of your incremental
> > command takes 1/rate where rate is the fps of your gif (split it up
> further
> > if it's still kinda choppy), & you shouldn't have any stuttering.  Your
> app
> > might take longer to load, but it'll be more responsive.
> >
> > > I found no easy
> > > way around this is GWT.
> >
> > There is - IncrementalCommand.
> >
> >
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to