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)




"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"Thanks for all of your help. Great customer service deserves to be recognized which one the reasons I've been a customer of DTN for over 10 years!" - Comment from Stuart
"I will tell others who want to go into trading that DTN ProphetX is an invaluable tool, I don't think anyone can trade without it..." - Comment from Luther
"You have an excellent product !!!!!!" - Comment from Arely
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"Version 4.0.0.2 has been working well for me and I appreciate that it is now a much tighter client to work with. I feel I can go to press with my own application and rely on a stable platform" - Comment from David in IA.
"I am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"I would just like to say that IQFeed version 4 is running very well and I am very happy with its performance. I would also like to extend a big thanks for the fast and efficient help that I always receive. My questions and concerns are always addressed promptly. Way to go!" - Comment from Josh in CO.
"Thanks for following up with me. You guys do a great job in tech support." - Comment from Phelps
"You are much better than lawyers or the phone company because you answer the phone when I call! I just love your customer service." - Comment from Isreal
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: Mon May 6, 2024 2:26 PM CFBB v1.2.0 11 ms.
© AderSoftware 2002-2003