Ben Johnson
2006-Jul-15 20:39 UTC
[Rails] Is there a huge performance difference between using multiple periodically_call_remote functions or one?
My application has multiple things on the interface that need to be updated periodically. Some things every second, others not so much. Some of these things are global, meaning they are on the interface at all times, and some of these things are view specific. So what I figured I would do is add the periodically_call_remote function for the global elements and another one for the view specific elements. The problem is, at times, there are 2 or 3 periodically_call_remote functions running at the same time. Is this bad for performance? Would it be better to call that function once and just pass it the view that I''m on and give back anything that the view needs? Basically merge these 3 function calls into one. Thanks for the help. Thank You, Ben Johnson E: bjohnson@contuitive.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060715/206f4259/attachment.html
Elliott Clark
2006-Jul-16 09:45 UTC
[Rails] Is there a huge performance difference between using multiple periodically_call_remote functions or one?
On 7/15/06, Ben Johnson <bjohnson@contuitive.com> wrote:> > My application has multiple things on the interface that need to be updated > periodically. Some things every second, others not so much. Some of these > things are global, meaning they are on the interface at all times, and some > of these things are view specific. So what I figured I would do is add the > periodically_call_remote function for the global elements and another one > for the view specific elements. The problem is, at times, there are 2 or 3 > periodically_call_remote functions running at the same time. Is this bad for > performance? Would it be better to call that function once and just pass it > the view that I''m on and give back anything that the view needs? Basically > merge these 3 function calls into one.That depends. Its a trip back to the server so yes there is a pretty decent difference(assuming you are targeting internet rather then a LAN/intranet). If the periodic calls are updating things at around the same interval you might want to look into combining them using json. However if they are not updating at the same time then merging them might actually hurt performance since you would be updating everything(somethings too ofter and others just enough) -- Elliott Clark eclark@cc.gatech.edu eclark@nife.us