www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - [OT] Three Optimization Tips for C++

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Vote up!

http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/


Andrei
Dec 19 2012
next sibling parent "Joshua Niehus" <jm.niehus gmail.com> writes:
On Thursday, 20 December 2012 at 05:29:46 UTC, Andrei 
Alexandrescu wrote:
 Vote up!
http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/
 Andrei
Almost 2 years ago, I stumbled across your book at a Barnes&Nobel and began my journey with D. It turns out its an "unsigned" copy. Any chance you'll sign it at the DConf?
Dec 20 2012
prev sibling next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Andrei Alexandrescu:

 http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/
I appreciate such slides and videos, thank you for sharing. But If possible I'd like a link to the slides in a place where I don't have to register to download them. I have also just seen this other slides pack from Jordan DeLong, it is very interesting, it's about a topic that is usually regarded as one of the strongest points of functional languages (that is using types to "make illegal states unrepresentable"): http://www.reddit.com/r/cpp/comments/1571m9/facebook_nyc_tech_talk_jordan_delong_using/ Bye, bearophile
Dec 21 2012
prev sibling next sibling parent reply "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Thursday, 20 December 2012 at 05:29:46 UTC, Andrei 
Alexandrescu wrote:
 Vote up!

 http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/


 Andrei
I think the most interesting thing from that talk is when you said that Facebook's back end code is spending 15% of its time converting ints to strings. I know you are looking at these small functions as simple examples of the optimisation tips you are giving, but I hope this isn't the kinds of optimisations you are doing at the Facebook. The problem isn't that the conversion is slow, the problem is that you are converting at all. Don't use text based formats for performance sensitive data! Of course, maybe the 15% claim was pure exaggeration. I really hope that's the case.
Dec 21 2012
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/21/12 7:23 AM, Peter Alexander wrote:
 On Thursday, 20 December 2012 at 05:29:46 UTC, Andrei Alexandrescu wrote:
 Vote up!

 http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/



 Andrei
I think the most interesting thing from that talk is when you said that Facebook's back end code is spending 15% of its time converting ints to strings.
Not all back end code. Certain applications.
 I know you are looking at these small functions as simple examples of
 the optimisation tips you are giving, but I hope this isn't the kinds of
 optimisations you are doing at the Facebook. The problem isn't that the
 conversion is slow, the problem is that you are converting at all. Don't
 use text based formats for performance sensitive data!

 Of course, maybe the 15% claim was pure exaggeration. I really hope
 that's the case.
Text representation has its own advantages. Andrei
Dec 21 2012
parent "Tove" <tove fransson.se> writes:
On Friday, 21 December 2012 at 16:28:35 UTC, Andrei Alexandrescu 
wrote:
 use text based formats for performance sensitive data!

 Of course, maybe the 15% claim was pure exaggeration. I really 
 hope
 that's the case.
Text representation has its own advantages. Andrei
interesting, does it have to be base 10? would it not be feasible to use hex strings in some scenarios? possible with bswap, or bitscan etc?
Dec 24 2012
prev sibling parent "Max Samukha" <maxsamukha gmail.com> writes:
On Thursday, 20 December 2012 at 05:29:46 UTC, Andrei 
Alexandrescu wrote:
 Vote up!

 http://www.reddit.com/r/programming/comments/155ivw/three_optimization_tips_for_c_video/


 Andrei
Nice talk. For anybody interested, PIC was made a bit faster by x64 due to introduction of RIP-relative addressing. Here is a concise and well-written article describing an x64 PIC implementation http://eli.thegreenplace.net/2011/11/11/position-independent-code-pic-in-shared-libraries-on-x64/.
Dec 21 2012