
-----------------------------------
copthesaint
Fri Jan 18, 2013 2:57 pm

What is the most efficient way to do type conversions?
-----------------------------------
I was wondering what is the most efficient (fastest) way of doing type conversions, Over the last year I have seen two main things people generally choose to use from reading online posts, they use a library called [
url=http://www.boost.org/]Boost or use  [url=http://www.cplusplus.com/reference/sstream/stringstream/]StringStream. My question is what is the most efficient (again meaning how fast the conversion can be done) way to convert types.

-----------------------------------
Tony
Fri Jan 18, 2013 3:24 pm

RE:What is the most efficient way to do type conversions?
-----------------------------------
well you could take the two methods and benchmark them against each other...

is your performance bottleneck really in type conversions?

-----------------------------------
copthesaint
Sat Jan 19, 2013 9:30 pm

RE:What is the most efficient way to do type conversions?
-----------------------------------
Well its not so much that I'm worried about performance being significantly effected by any type conversions with what I am doing, its that I like both methods for type conversions, however I was hoping there was a general consensus of which one was more reliable && faster.  I guess my choice is only dependent on my preference then?

-----------------------------------
Tony
Sat Jan 19, 2013 10:30 pm

RE:What is the most efficient way to do type conversions?
-----------------------------------
Go with your preference.

Going out of your way for insignificant performance gains is also known as "premature optimization" and is generally a bad thing.
