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)




"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
"I am keeping IQFeed, much better reliabilty than *******. I may refer a few other people in the office to switch as well." - Comment from Don
"I used to have *******, but they are way more money for the same thing. I have had no probs with data from DTN since switching over." - Comment from Public Forum Post
"You have an excellent product !!!!!!" - Comment from Arely
"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.
"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
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from 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
"For anyone considering using DTN.IQ for a data feed, my experience with the quality of data and the tech support has been very positive." - Comment from Public Forum
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: 1036
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: 1036
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 September 21, 2017 7:53 PM CFBB v1.2.0 16 ms.
© AderSoftware 2002-2003