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 was with ******* for 4 years at $230 a month, this is a huge savings for me, GOD BLESS YOU PEOPLE," - Comment from T.S. via Email
"I use IQ Feed, Great stuff as far as data analysis information, storage and retrieval is concerned." - Comment from Public Forum
"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
"I "bracket trade" all major news releases and I have not found one lag or glitch with DTN.IQ feed. I am very comfortable with their feed under all typical news conditions (Fed releases, employment numbers, etc)." - Comment from Public Forum
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"I was on the phone with a friend who uses CQG and right after the Fed announcement, CQG was as much as 30 seconds behind DTN.IQ. Some quotes were off by as much as 15-18 cents. Your feed never missed a beat." - Comment from Roger
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"I've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via Public Forum
"This is an excellent value, the system is generous (allowing for 500 stocks) and stable (and really is tick-by-tick), and the support is fantastic." - Comment from Shirin via Email
Home  Search  Register  Login  Blogs Recent Posts

Information on Various DTN Products:
DTN IQFeed | DTN ProphetX | DTN Ag | NxCore
Follow DTN_IQFeed on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »IQFeed Developer »IQFeed Developer Support »C++ Suggested Libraries, Speed
Author Topic: C++ Suggested Libraries, Speed (7 messages, Page 1 of 1)

oxford
-Interested User-
Posts: 12
Joined: Oct 4, 2013


Posted: Oct 8, 2013 09:18 AM          Msg. 1 of 7
Hi,

I'm a new developer with IQFeed and currently playing aroundwith the provided examples.

I'm focused on working mostly with the Level1 feed and kindly ask all readers, if you can suggest me your preferred libraries you work with.

Currently I'm looking for a really fast string library (VC11) and it's just too slow . I've googled around and tried some libs, but I'm no not really happy - considering the speed of the feed updates we receive. I've left some promising string algos to test. Main concerns are splitting and conversion function.

I'm further highly curious to know of your experience with COM vs. SOCKET, with regards to speed? How much is the difference in speed?

Thanks in advance!

DTN_Tim Walter
-DTN Guru-
Posts: 1090
Joined: Apr 25, 2006


Posted: Oct 8, 2013 10:26 AM          Msg. 2 of 7
Hello Oxford,

Just from our standpoint here, we use standard string libraries here. That said, I would recommend a couple things, do not use split if you can help it, inline processing of the string is far more efficient. Also, char arrays would certainly be the fastest option available as it would remove a large amount of overhead.

I would also recommend looking at dynamic fieldsets as well, removing any extraneous fields will help a ton if you are doing splits, because there will not be as many fields to parse. http://www.iqfeed.net/dev/api/docs/DynamicFieldsets.cfm

As to socket versus COM, COM simply encapsulates the socket interface for you, but because it is one more layer to pass through it will always be slower, but not by much. But, we do recommend sockets in pretty much every case.

Tim

Edited by DTN_Tim Walter on Oct 8, 2013 at 10:36 AM

oxford
-Interested User-
Posts: 12
Joined: Oct 4, 2013


Posted: Oct 8, 2013 02:15 PM          Msg. 3 of 7
Hi Tim,

Thanks for your reply.

I'm using the char array, and the best performance was achieved by using strtok (<cstring>), which does not satisfy. My goal is to split the char array before the next update is sent.

What do you mean by "inline processing"? Any hint or example?

Thanks again,
Oxford

DTN_Tim Walter
-DTN Guru-
Posts: 1090
Joined: Apr 25, 2006


Posted: Oct 8, 2013 02:46 PM          Msg. 4 of 7
Be careful of strtok, I don't think it handles consecutive delimeters by default.

By inline, I mean rather than spiltting and having to copy memory to other locations, I would loop through the string looking for a comma and processing it as I go. But, there really should not be any issue with doing this from any standard String library.

So I am curious, what is the actual issue you are trying to conquer? Maybe we can start there and find a better solution that is simpler to implement?

stargrazer
-DTN Evangelist-
Posts: 242
Joined: Jun 13, 2005

Right Here & Now


Posted: Oct 8, 2013 03:00 PM          Msg. 5 of 7
Looping through the string looking for commas is the way I do it. I pull the delimited character strings out and process as required.

For converting characters to native values, you can try boost::lexical_cast, which uses in place iterators, so should be robust and fast.

For extra pizzaz you could try boost::spirit, something with which you would design a parser, and parse the whole thing and give you the appropriate converted values. Possibly a bit overkill as it will parse and convert more than just the few fields you might need. Or mix dynamic field sets with boost::spirit.

oxford
-Interested User-
Posts: 12
Joined: Oct 4, 2013


Posted: Oct 8, 2013 03:40 PM          Msg. 6 of 7
I used strtok in combination with a loop to find the next position of the delimiter. But as you say, it copies around and that needs time.

My goal is to find the fastest way how to convert a char[] or string into a qualified structure (struct/class object), and then calculate further. Other issues I'm awaiting to have would be string conversions into doubles, etc. It's more a test and see which design approach to take. My utlimate goal is an analysis of times and sales data.

oxford
-Interested User-
Posts: 12
Joined: Oct 4, 2013


Posted: Oct 8, 2013 03:52 PM          Msg. 7 of 7
Hi Stargrazer,

Thanks for your reply.

It looks like the loop is the fast way - for now. I've to test some other search algos.

I've not highly experience with boost, so it remains to make some practical tests. Regarding casting, there are faster ways than lexical_cast, however boost::spirit can maybe make a difference.

Best,
Oxforx
 

 

Time: Thu November 23, 2017 6:16 PM CFBB v1.2.0 15 ms.
© AderSoftware 2002-2003