{"id":1940,"date":"2009-11-08T16:15:25","date_gmt":"2009-11-08T23:15:25","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=1940"},"modified":"2009-11-12T17:43:35","modified_gmt":"2009-11-13T00:43:35","slug":"state-of-the-art-compiler-optimization","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/state-of-the-art-compiler-optimization\/","title":{"rendered":"State of the Art Compiler Optimization"},"content":{"rendered":"<p><a href=\"http:\/\/blog.fefe.de\/?ts=b40829f5\">Felix von Leitner<\/a> delivered a <a href=\"http:\/\/www.linux-kongress.org\/2009\/slides\/compiler_survey_felix_von_leitner.pdf\">talk at the 2009 Linux Kongress about the state of the art in compiler optimization (link to PDF slides)<\/a>. Presentation slides by themselves are not a good way to understand a talk and it would be better to learn if video for the actual talk is posted somewhere. Compiler optimization (or lack thereof) is fairly important to <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> developers.<\/p>\n<p>The talk analyzes how LLVM, icc, MSVC, Sun C, and gcc generate fast code in this day and age. One basic theme I gathered is that coders should forgo clever C optimizations as they tend to be counterproductive. I wish I could believe that, but there was that <a href=\"http:\/\/multimedia.cx\/eggs\/optimizing-away-arrows\/\">recent episode where I optimized FFmpeg&#8217;s Theora decoder by removing structure dereferences<\/a>. I&#8217;m sure that other performance-minded multimedia hackers will have other nits to pick with the broad generalizations in the presentation. I call your attention to the fighting words (which I have taken out of context since it&#8217;s such a fun quote) on slide 41: <strong>&#8220;Note: gcc is smarter than the video codec programmer on all platforms.&#8221;<\/strong> Further, slides 53-55 specifically call out <a href=\"http:\/\/www.underbit.com\/products\/mad\/\">madplay<\/a> for inline ASM that allegedly didn&#8217;t improve efficiency vs. what the compiler could achieve with the raw C code.<\/p>\n<p>On the whole, the findings are probably quite accurate for the kind of C code that most people need to write (e.g., &#8220;No need to write a &gt;&gt; 2 when you mean a\/4!&#8221;). <\/p>\n<p>Speaking of compilers, <a href=\"http:\/\/fate.multimedia.cx\/\">FATE<\/a> now covers Intel&#8217;s 11.1 series C compiler for both 32- and 64-bit icc. I have also updated the stale snapshots of the gcc-svn for my machines (I still need to write a tool to do that for me automatically and continuously).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Where we are in the battle of compiler-automated vs. hand-tuned program optimization<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101,28],"tags":[],"class_list":["post-1940","post","type-post","status-publish","format-standard","hentry","category-fate-server","category-programming"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=1940"}],"version-history":[{"count":7,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1940\/revisions"}],"predecessor-version":[{"id":1954,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1940\/revisions\/1954"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=1940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=1940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=1940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}