Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"I've been using IQFeed 4 in a multi-threaded situation for the last week or two on 2600 symbols or so with 100 simultaneous daily charts, and I have had 100% responsiveness." - Comment from Scott
"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
"With HUGE volume on AAPL and RIMM for 2 days, everyone in a trading room was whining about freezes, crashes and lag with *******, RealTick, TS and Cyber. InvestorRT with IQFeed was rock solid. I mean SOLID!" - Comment from Public IRC Chat
"My broker in Davenport suggested I give you a try as he uses your service and says its the best." - Comment from Bill via RT Chat
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"Just a quick one to say I'm very impressed so far :) The documentation for developers is excellent and I've quickly managed to get an app written to do historical downloads. The system is very robust and pretty quick considering the extent of data that's available. The support guys have been very helpful too, in combination with the forums it's been plain sailing so far!" - Comment from Adam
"And by the way, have to say this. I love the IQFeed software. It's rock solid and it has a really nice API." - Comment from Thomas via RT Chat
"Boy, probably spent a thousand hours trying to get ******* API to work right. And now two hours to have something running with IQFeed. Hmmm, guess I was pretty stupid to fight rather than switch all this time. And have gotten more customer service from you guys already than total from them… in five years." - Comment from Jim
"I cannot believe what a difference it makes trading with ProphetX!" - Comment from Bruce in Los Angeles
"The service is great, I see a noticeable improvement in my volume profiles over [broker]'s data feed" - Comment from Larry
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »Archive (2017 and earlier) »IQFeed Developer Support »datafeed optimization
Author Topic: datafeed optimization (3 messages, Page 1 of 1)

d_allen
-Interested User-
Posts: 29
Joined: Nov 5, 2008


Posted: Nov 26, 2008 12:51 PM          Msg. 1 of 3
hello my fellow iqFeeders,
i'm a newbie/novice and i was wondering if someone could me give advice on optimizing the IQFeed? i'm currently watching over 500 equity options and simultaneously parsing and saving (sql insert) the messages to a MySQL data base. i'm using the IQFeed activeX control to receive message and the language i'm using is vb.net. if anyone has any solutions, advice, recommendations, etc please share them with me...

thanks
Edited by d_allen on Feb 21, 2010 at 05:05 PM

jimc
-Interested User-
Posts: 35
Joined: Jan 22, 2008


Posted: Nov 26, 2008 02:41 PM          Msg. 2 of 3
Donald, I have a couple suggestions for you. First, I used the ActiveX feed with a .NET-based program (C#) for many months. The ActiveX overhead was too much for my computer (a reasonably fast dual CPU machine); when volume spiked, my program fell progressively further behind receiving and processing the feed. I'm only watching about 65 symbols, too. I recently switched to the socket interface, and it's much, much faster for me. (I think this big performance difference might not necessarily be there if one was writing a non-.NET program.) So rather than beat your head against the wall trying to get your ActiveX-based code running as fast as possible, you may want to switch to the socket interface. It's probably the biggest single thing you can do to speed things up.

Also, the socket interface lets you specify which fields you want to receive, and that can drastically reduce the amount of bandwidth and parsing it takes to receive the feed. The ActiveX interface doesn't support this feature yet.

Second, if your database can't keep up with so many inserts, you could:
1). Let the data build up for awhile (e.g., at least a few seconds), then have a separate thread go do an insert
2). Spend some time optimizing your database configuration for your needs; I use Oracle, so I don't know much about mySQL, but I'm sure there are plenty of things you can do to optimize it for an insert-heavy load like yours.
3). Run your database on a separate computer on your network
4). Instead, write the data to a file, and write a small program to run at the end of the day to insert it all into your database
5). Write the data to a file and read it back from a file, rather than into/out of a database

Third, when optimizing a program, usually a little bit of work goes a long way at first. In other words, look first for places where you're storing a value that's actually unchanged, or recalculating an indicator when the underlying data hasn't changed yet.

Fourth, once you've gotten the low-hanging fruit in terms of optimization, you may find it useful to use a third-party optimization tool. I use and like the Ants Profiler, but I'm sure there are many others.

One other thing: compile your program with using the "Release" configuration instead of the "Debug" configuration, if that's an option in VB. It makes a big difference in C#.

Good luck.

Jim

jimc
-Interested User-
Posts: 35
Joined: Jan 22, 2008


Posted: Dec 1, 2008 11:31 AM          Msg. 3 of 3
One other thing: allocating memory is usually a relatively expensive operation. So look for places where you're allocating memory many times (e.g., string creation) and change them to avoid so many allocations (e.g., use the StringBuilder class).

Jim
 

 

Time: Thu May 2, 2024 5:58 AM CFBB v1.2.0 15 ms.
© AderSoftware 2002-2003