{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/dub/issues/498","labels_url":"https://api.github.com/repos/D-Programming-Language/dub/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/dub/issues/498/comments","events_url":"https://api.github.com/repos/D-Programming-Language/dub/issues/498/events","html_url":"https://github.com/D-Programming-Language/dub/pull/498","id":55797374,"number":498,"title":"Cached Parallel Separate Compilation of Project Modules","user":{"login":"nordlow","id":829407,"avatar_url":"https://avatars.githubusercontent.com/u/829407?v=3","gravatar_id":"","url":"https://api.github.com/users/nordlow","html_url":"https://github.com/nordlow","followers_url":"https://api.github.com/users/nordlow/followers","following_url":"https://api.github.com/users/nordlow/following{/other_user}","gists_url":"https://api.github.com/users/nordlow/gists{/gist_id}","starred_url":"https://api.github.com/users/nordlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nordlow/subscriptions","organizations_url":"https://api.github.com/users/nordlow/orgs","repos_url":"https://api.github.com/users/nordlow/repos","events_url":"https://api.github.com/users/nordlow/events{/privacy}","received_events_url":"https://api.github.com/users/nordlow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-01-28T18:43:47Z","updated_at":"2015-03-27T17:18:34Z","closed_at":"2015-01-31T20:07:01Z","pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dub/pulls/498","html_url":"https://github.com/D-Programming-Language/dub/pull/498","diff_url":"https://github.com/D-Programming-Language/dub/pull/498.diff","patch_url":"https://github.com/D-Programming-Language/dub/pull/498.patch"},"body":"Is there a way to tell DUB to compile all its sources as separate objects which are then fed to ld similar to how most other build tools work.\r\n\r\nThis since my project has grown beyound 30k lines of code and takes 7.5 to build with DUB. I don't want DMD to recompile every line in my project if I change only of them. Since my cross-module interfaces are un-templatized I've already tested that this gives significant speeds-up in iterative build time (~2s for a typical iterative build in this 30k-project) when I edit one module at a time and use DMD together with ld.gold. \r\n\r\nThe only way I managed to change behaviour of DUB was through the `--build-mode` flag as\r\n\r\n```Shell\r\ntime dub build --build-mode=singleFile\r\n```\r\n\r\nwhich makes it compile each .d file separately:\r\n\r\n```\r\nBuilding knetquery ~master configuration \"application\", build \r\ntype debug.\r\nCompiling using dmd...\r\nCompiling ../algorithm_ex.d...\r\nCompiling ../arsd/characterencodings.d...\r\nCompiling ../arsd/dom.d...\r\nCompiling ../assert_ex.d...\r\nCompiling ../backtrace/backtrace.d...\r\nCompiling ../combinations.d...\r\nCompiling ../dbg.d...\r\nCompiling ../grammars.d...\r\nCompiling ../ixes.d...\r\nCompiling ../knet/base.d...\r\n../sort_ex.d(143): Warning: use std.algorithm.sort instead of \r\n.sort property\r\n../sort_ex.d(168): Warning: use std.algorithm.sort instead of \r\n.sort property\r\nCompiling ../knet/cn5.d...\r\nCompiling ../knet/decodings.d...\r\nCompiling ../knet/folklex.d...\r\nCompiling ../knet/languages.d...\r\nCompiling ../knet/lectures/all.d...\r\nCompiling ../knet/lemmas.d...\r\nCompiling ../knet/moby.d...\r\nCompiling ../knet/nell.d...\r\nCompiling ../knet/origins.d...\r\nCompiling ../knet/relations.d...\r\nCompiling ../knet/roles.d...\r\nCompiling ../knet/senses.d...\r\nCompiling ../knet/swesaurus.d...\r\nCompiling ../knet/synlex.d...\r\nCompiling ../knet/thematics.d...\r\nCompiling ../knet/wordnet.d...\r\nCompiling ../mmfile_ex.d...\r\nCompiling ../msgpack.d...\r\nCompiling ../permutations.d...\r\nCompiling ../predicates.d...\r\nCompiling ../range_ex.d...\r\nCompiling ../rational.d...\r\nCompiling ../skip_ex.d...\r\nCompiling ../sort_ex.d...\r\nCompiling ../stemming.d...\r\nCompiling ../traits_ex.d...\r\nCompiling ../wordnet.d...\r\nCompiling source/app.d...\r\nLinking...\r\n```\r\n\r\nThis takes about twice as long (~14s).\r\n\r\n- It doesn't seem to support parallelism here. Where's the -j --jobs flag?!\r\n- And I can't see any caching á lá SCons or ccache in action either.\r\n\r\nHasn't this been implemented in DUB yet or is something wrong?\r\n\r\nIf this is on the TODO list I would be glad to help out implementing support for parallell cached builds.\r\n\r\nI'm using DUB master HEAD and ld.gold as my default linker on Ubuntu 14.04.\r\n\r\nSee also: http://forum.dlang.org/thread/wzkxfedfzsybwxpnmvmj@forum.dlang.org?page=1\r\n\r\nhttps://github.com/gecko0307/Cook2 seems like something useful that can inspire this DUB in this regard."},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/dub/issues/comments/87017026","html_url":"https://github.com/D-Programming-Language/dub/pull/498#issuecomment-87017026","issue_url":"https://api.github.com/repos/D-Programming-Language/dub/issues/498","id":87017026,"user":{"login":"s-ludwig","id":1645969,"avatar_url":"https://avatars.githubusercontent.com/u/1645969?v=3","gravatar_id":"","url":"https://api.github.com/users/s-ludwig","html_url":"https://github.com/s-ludwig","followers_url":"https://api.github.com/users/s-ludwig/followers","following_url":"https://api.github.com/users/s-ludwig/following{/other_user}","gists_url":"https://api.github.com/users/s-ludwig/gists{/gist_id}","starred_url":"https://api.github.com/users/s-ludwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-ludwig/subscriptions","organizations_url":"https://api.github.com/users/s-ludwig/orgs","repos_url":"https://api.github.com/users/s-ludwig/repos","events_url":"https://api.github.com/users/s-ludwig/events{/privacy}","received_events_url":"https://api.github.com/users/s-ludwig/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T17:18:34Z","updated_at":"2015-03-27T17:18:34Z","body":"Made this optional with a `--parallel` switch."}}