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 am very pleased with the DTNIQ system for quotes and news." - Comment from Larry
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"Previously I was using *******. IQFeed is WAY more economical, and for my charting needs is just as good, if not better." - Comment from Public Forum Post
"I ran your IQFeed DDE vs. my broker vs. a level II window for some slow-moving options. I would see the level II quote change, then your feed update instantaneously. My broker's DDE, however, would take as much as 30 seconds to update. I am not chasing milliseconds, but half a minute is unacceptable." - Comment from Rob
"I have to tell you though that using the IQFeed API is about the easiest and cleanest I have seen for some time." - Comment from Jim
"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 use IQ Feed, Great stuff as far as data analysis information, storage and retrieval is concerned." - Comment from Public Forum
"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
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
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 »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: 1238
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: 1238
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 Guru-
Posts: 302
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 May 16, 2024 8:44 PM CFBB v1.2.0 12 ms.
© AderSoftware 2002-2003