>I'm using cffeed for a bunch of rss feeds (specifically 4 feeds for now). >For code reuse, I have a component which has a function for passing >parameters including source (as a structure). > >One approach (named A): >Not using cfthread, execution seems reasonably fast. >http://24.254.1.94:8000/cf8/smallbiznewsfeed_nothread.cfm? > >Another approach (named B): >Using cfhread, execution speed not consistent. >http://24.254.1.94:8000/cf8/smallbiznewsfeed_threads.cfm? > >Commonality: >-- both call/invoke the same cfc method & same technique of invocation >-- both use cfwindow to handle display > >Differences: >-- as mentioned above, A does not use cfthread while B does >-- with A, four cfwindow are constructed manually for each feed while >cfwindow is inside the feed output loop for the B, so, cfwindow is >dynamically constructed, and so B has a few more lines of code for >dynamically setting x and y value. > >Server Infor & Setting: >-- OS= Windows XP; CFserverVersion=8 standard; CF thread default=10 > >Additional Info: >-- the cfc has about 20 line of code; >-- both A and B has about 100 line of code respectively; >-- read up some blogs on cfthread, however, in this case, it does not seem >to help, and I happen to think my code is not lousy, so, what's up? >-- Exeution time is hiding behind windows :)
I'm not even sure what you're real question is, it seems you're implying that the <cfthread /> version is worse performing (which wasn't my experience hitting the pages a few times. The <cfthread /> version was always faster. Your environment is going to largely dictate what kind of advantages you see from threading tasks in your code. Also remember anytime you need to join the threads together, which would be the case here, your code is still going to have to wait for the slowest running thread. That means if you have a feed that on average takes 900ms to return its results, that's not a bottleneck threading your code will fix. The benefit really comes from when you have 4 processes that each takes 900ms to complete. You're going to have to wait at least 2800ms for that task to finish when run in serial. By threading the processes and running them in parallel, you'll drastically reduce the wait time since all of those tasks run at the same time. You could end up reducing the wait time by 2100ms. You'd really notice the benefits of threading the requests if you start running into network latency issues or issues with the server returning the results in timely manors. -Dan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294843 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

