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)




"If you are serious about your trading I would not rely on IB data for serious daytrading. Took me a while to justify the cost of IQ Feed and in the end, it's just a 2 point stop on ES. Better safe than sorry" - 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
"Just a thank you for the very helpful and prompt assistance and services. You provided me with noticeably superior service in my setup compared to a couple of other options I had looked at." - Comment from John
"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"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'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
"IQ feed is brilliant. The support is mind-bending. What service!" - Comment from Public Forum Post
"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
"I am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"There is no doubt that IQFeed is the best data provider. I am very satisfied with your services. And IQFeed is the only one that I would recommend to my friends. Now, most of them are using your product in China." - Comment from Zhezhe
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: 1064
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: 1064
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: 240
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 October 19, 2017 7:29 AM CFBB v1.2.0 15 ms.
© AderSoftware 2002-2003