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
"I'm very glad I switched to IQFeed. It's working perfectly with no lag, even during fast market conditions." - Comment from Andy via Email
"I just wanted to let you know how fast and easy I found it to integrate IQFeed into our existing Java code using your JNI client. In my experience, such things almost never go so smoothly - great job!" - Comment from Nate
"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
"If you want customer service that answers the phone, your best bet is IQFeed. I cannot stop praising them or their technical support. They are always there for you, and they are quick. I have used ****** too but the best value is IQFeed." - Comment from Public Forum
"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.
"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
"You have an excellent feed. Very few spikes for Spot Forex." - Comment from Public Forum Post
"DTN feed was the only feed that consistently matched Bloomberg feed for BID/ASK data verification work these past years......DTN feed is a must for my supply & demand based trading using Cumulative Delta" - Comment from Public Forum Post
"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.
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: Wed April 24, 2024 12:34 AM CFBB v1.2.0 14 ms.
© AderSoftware 2002-2003