{"id":1966,"date":"2009-11-19T22:18:15","date_gmt":"2009-11-20T05:18:15","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=1966"},"modified":"2009-11-20T10:28:39","modified_gmt":"2009-11-20T17:28:39","slug":"ffmpeg-and-multiple-build-threads","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/ffmpeg-and-multiple-build-threads\/","title":{"rendered":"FFmpeg and Multiple Build Threads"},"content":{"rendered":"<p>I got bored today and decided to empirically determine how much <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> compilation time can be improved by using multiple build threads, i.e., &#8216;make -jN&#8217; where N &gt; 1. I also wanted to see if the old rule of &#8220;number of CPUs plus 1&#8221; makes any worthwhile difference. The thinking behind that latter rule is that there should always be one more build job queued up ready to be placed on the CPU if one of the current build jobs has to access the disk. I think I first learned this from reading the <a href=\"http:\/\/gentoo.org\/\">Gentoo<\/a> manuals. I didn&#8217;t find that it made a significant improvement. But then, <a href=\"http:\/\/funroll-loops.info\/\">Gentoo is for ricers<\/a>.<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/11\/ffmpeg-compile-graph-2xcore2duo.png\" alt=\"FFmpeg being built with multiple threads on a 2x Core 2 Duo\" title=\"FFmpeg being built with multiple threads on a 2x Core 2 Duo\" width=\"317\" height=\"259\" class=\"aligncenter size-full wp-image-1970\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/11\/ffmpeg-compile-graph-2xcore2duo.png 317w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/11\/ffmpeg-compile-graph-2xcore2duo-300x245.png 300w\" sizes=\"auto, (max-width: 317px) 100vw, 317px\" \/><br \/>\n<\/center><\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/11\/ffmpeg-compile-graph-core2duo.png\" alt=\"FFmpeg being built with multiple threads on a Core 2 Duo\" title=\"FFmpeg being built with multiple threads on a Core 2 Duo\" width=\"288\" height=\"254\" class=\"aligncenter size-full wp-image-1979\" \/><br \/>\n<\/center><\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2009\/11\/ffmpeg-compile-graph-2xHTatom.png\" alt=\"FFmpeg being built with multiple threads on a dual-core hyperthreaded Atom\" title=\"FFmpeg being built with multiple threads on a dual-core hyperthreaded Atom\" width=\"285\" height=\"252\" class=\"aligncenter size-full wp-image-1975\" \/><br \/>\n<\/center><\/p>\n<p>I think the most interesting thing to observe about these graphs is the CPU time (the amount of time the build jobs are actually spending on the combined CPUs). The number is roughly steady for the Core 2 CPUs regardless of number of jobs while the Hyperthreaded Atom CPU sees a marked increase in total CPU time. Is that an artifact of Hyperthreading? Or maybe I just didn&#8217;t put together a stable testing methodology.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do multiple build threads imrpove FFmpeg building?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-1966","post","type-post","status-publish","format-standard","hentry","category-programming"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1966","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=1966"}],"version-history":[{"count":12,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1966\/revisions"}],"predecessor-version":[{"id":1983,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/1966\/revisions\/1983"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=1966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=1966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=1966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}