Re: NSURLConnection vs. NSThread

2009-05-15 Thread Michael Ash
On Fri, May 15, 2009 at 12:56 PM, Luke the Hiesterman wrote: > > On May 14, 2009, at 5:35 PM, Michael Ash wrote: > >> I agree completely that the simplest code should win, but I also think >> that the thread adds complexity, not just overhead. > > My point is that some programmers might find using

Re: NSURLConnection vs. NSThread

2009-05-15 Thread Luke the Hiesterman
On May 14, 2009, at 5:35 PM, Michael Ash wrote: I agree completely that the simplest code should win, but I also think that the thread adds complexity, not just overhead. My point is that some programmers might find using NSThread fits their way of thinking best. Others might find NSURLConn

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Eric E. Dolecki
I'm going to try NSURLConnection first I guess and see how it goes. I'm loading larger images that get resized down in the table so I'll have the larger images cached for display in a details view. Thanks for all of this valuable feedback! Eric On Thu, May 14, 2009 at 11:21 PM, George Warner wrot

Re: NSURLConnection vs. NSThread

2009-05-14 Thread George Warner
On Thu, 14 May 2009 16:52:48 -0400, Eric E. Dolecki" wrote: Just curious, but if I am loading images into a UIImageView in table cells from online URLs, is it better to use NSThread or use async NSURLConnection to ensure that the scrolling is smooth while images are loaded in? This proba

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Michael Ash
On Thu, May 14, 2009 at 6:42 PM, Luke the Hiesterman wrote: > To add to that thought, I should add that even if there is a performance > difference, I'd be surprised if it's anything that anyone would notice. It's > generally a mistake to assume there's a performance problem with a certain > appro

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Mike Abdullah
I am not saying that the threads created by NSURLConnection are in any way faster than those created manually. I am saying that NSURLConnection is going to use its own thread internally whatever you do, so throwing another thread into the mix is only adding additional overhead. As it happ

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Alastair Houghton
On 14 May 2009, at 23:39, Luke the Hiesterman wrote: Why is it assumed that threads created by NSURLConnection are faster than threads created manually with NSThread? It isn't. Mike's point is that the chances of someone who is asking whether or not to use NSThread on a developer mailing l

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Luke the Hiesterman
To add to that thought, I should add that even if there is a performance difference, I'd be surprised if it's anything that anyone would notice. It's generally a mistake to assume there's a performance problem with a certain approach until you've actually seen the performance problem. In ca

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Luke the Hiesterman
Why is it assumed that threads created by NSURLConnection are faster than threads created manually with NSThread? Luke On May 14, 2009, at 3:36 PM, Mike Abdullah wrote: Threads would be unnecessary hassle and probably slower performing. NSURLConnection maintains its own private thread for p

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Mike Abdullah
Threads would be unnecessary hassle and probably slower performing. NSURLConnection maintains its own private thread for performing the work of all open URL connections, even if you are using the synchronous API. By using NSThread, you are just bringing an extra unnecessary thread into the

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Luke the Hiesterman
I actually think for a simple case like this one, the NSThread approach will have simpler, more straightforward code. I say go with whichever way makes more sense for your style of coding. Luke On May 14, 2009, at 2:56 PM, Michael Ash wrote: On Thu, May 14, 2009 at 4:52 PM, Eric E. Dolecki

Re: NSURLConnection vs. NSThread

2009-05-14 Thread Michael Ash
On Thu, May 14, 2009 at 4:52 PM, Eric E. Dolecki wrote: > Just curious, but if I am loading images into a UIImageView in table cells > from online URLs, is it better to use NSThread or use async NSURLConnection > to ensure that the scrolling is smooth while images are loaded in? I'd recommend the