{"id":1225,"date":"2009-03-09T01:23:35","date_gmt":"2009-03-09T08:23:35","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=1225"},"modified":"2020-07-25T22:41:35","modified_gmt":"2020-07-26T05:41:35","slug":"icc-vs-gcc-smackdown-round-3","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/icc-vs-gcc-smackdown-round-3\/","title":{"rendered":"icc vs. gcc Smackdown, Round 3"},"content":{"rendered":"<p>How did I become the benchmark peon? Oh right, I actually dared to put forth some solid benchmarks and called for suggestions for possible improvements to the benchmark methodology. This is what I get.<\/p>\n<p>Doing these benchmarks per all the suggestions I have received is time-consuming and error-prone. But if you know anything about me by now, you should know that I like automating <a href=\"http:\/\/fate.multimedia.cx\/\">time-consuming and error-prone tasks<\/a>. This problem is looking more and more like a nail, so allow me to apply my new favorite hammer: <strong>Python<\/strong>!<\/p>\n<p>Here&#8217;s the pitch: Write a Python script that iterates through a sequence of compiler configurations, each with its own path and unique cflags, and compiles FFmpeg. For each resulting build, decode a long movie twice, tracking the execution time in milliseconds. Also, for good measure, <a href=\"http:\/\/multimedia.cx\/eggs\/compiler-performance-profiling-with-ffmpeg\/#comment-142372\">follow Reimar&#8217;s advice<\/a> and validate that the builds are doing the right thing. To this end, transcode the first 10 seconds of the movie to a separate, unique file for later inspection. After each iteration, write the results to a CSV file for graphing.<\/p>\n<p>And here&#8217;s the graph:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/03\/icc-vs-gcc-round3.png\" alt=\"icc vs. gcc smackdown, round 3\" title=\"icc vs. gcc smackdown, round 3\" width=\"444\" height=\"268\" class=\"aligncenter size-full wp-image-1227\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/03\/icc-vs-gcc-round3.png 444w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/03\/icc-vs-gcc-round3-300x181.png 300w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><br \/>\n<\/center><\/p>\n<p><em>Look at that!<\/em> gcc 4.3.2 still isn&#8217;t a contender but gcc 4.4-svn is putting up a fight.<\/p>\n<p>Here are the precise details of this run:<\/p>\n<ul>\n<li>Movie file is the same as before: 104-minute AVI; ISO MPEG-4 part 2 video (a.k.a. DivX\/XviD) at 512&#215;224, 24 fps; 32 kbps, 48 kHz MP3<\/li>\n<li>This experiment includes gcc 4.4.0-svn, revision 143046, built on 2009-01-03 (I&#8217;m a bit behind)<\/li>\n<li>All validations passed<\/li>\n<li>Machine is a Core 2 Duo, 2.13 GHz<\/li>\n<li>All 8 configurations are compiled with &#8211;disable-amd3dnow &#8211;disable-amd3dnowext &#8211;disable-mmx &#8211;disable-mmx2 &#8211;disable-sse &#8211;disable-ssse3 &#8211;disable-yasm<\/li>\n<li>icc configuration compiled with &#8211;cpu=core2 &#8211;parallel<\/li>\n<li>gcc 4.3.2 and 4.4.0-svn configurations compiled with -march=core2 -mtune=core2<\/li>\n<li>all other gcc versions compiled with no special options<\/li>\n<\/ul>\n<p><strong>See Also:<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/multimedia.cx\/eggs\/performance-smackdown-now-with-64-bit\/\">Next smackdown in the series<\/a><\/li>\n<li><a href=\"http:\/\/multimedia.cx\/eggs\/intel-beats-up-gcc\/\">Previous smackdown in the series<\/a><\/li>\n<\/ul>\n<p>What&#8217;s in store for round 4? It sure would be nice to get icc 11.0 series working on my machine for once to see if it can do any better. And since I have the benchmark framework, it would be nice to stuff LLVM in there to see how it stacks up. I would also like to see how the various builds perform when decoding H.264\/AAC. The problem with that is the tremendous memory leak that slows execution to a crawl during a lengthy transcode. Of course I would be willing to entertain any suggestions you have for compiler options in the next round.<\/p>\n<p>Better yet, perhaps you would like to try out the framework yourself. As is my custom, I like to publish my ad-hoc Python scripts here on my blog or else I might never be able to find them again.<\/p>\n<p><!--more--><\/p>\n<p>To configure this, modify SOURCE_DIR and BUILD_DIR (the latter is very important since the script will &#8216;rm -rf&#8217; it before the build, just like in FATE). Find the 2 places in the code that state &#8220;\/home\/fate\/movie.avi&#8221; and replace them with your favorite long media file. Then, monkey with the CONFIGURATIONS dictionary and the sub-dictionaries within (modifying the &#8220;cflags&#8221; and &#8220;compiler_path&#8221; keys). After the thing runs (BTW, you might want to redirect stdout to \/dev\/null), look for output.csv in the current working directory. Go ahead and modify the &#8216;make -j3&#8217; part to an appropriate number of CPU threads for your machine. Oh, and run at your own risk, particularly due to the automatic &#8216;rm -rf&#8217;.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/multimediamike\/2e5796ccb44e5656a67d02c218c5cb23.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>icc still wins, but gcc 4.4-svn is a contender<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[116,122,285],"class_list":["post-1225","post","type-post","status-publish","format-standard","hentry","category-python","tag-gcc","tag-icc","tag-python"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1225","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=1225"}],"version-history":[{"count":14,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1225\/revisions"}],"predecessor-version":[{"id":4594,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1225\/revisions\/4594"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=1225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=1225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=1225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}