{"id":1927,"date":"2013-09-07T22:46:37","date_gmt":"2013-09-07T22:46:37","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=1927"},"modified":"2013-09-07T22:46:37","modified_gmt":"2013-09-07T22:46:37","slug":"improving-performance-of-gradle-scala-build-with-a-compiler-daemon","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/improving-performance-of-gradle-scala-build-with-a-compiler-daemon\/","title":{"rendered":"Improving Performance of Gradle + Scala Build with a compiler daemon"},"content":{"rendered":"<p>If you find the build times of Scala programs in gradle unacceptably slow, you can add the following to build.gradle. This took my simple build from 25 seconds to five.<\/p>\n<pre>compileScala {\n    scalaCompileOptions.useCompileDaemon = true\n\n    \/\/ optionally specify host and port of the daemon:\n    scalaCompileOptions.daemonServer = \"localhost:4243\"\n}<\/pre>\n<p>This doesn&#8217;t seem to be stable all the time; an alternative approach is to set the following settings in build.gradle, which is almost as fast:<\/p>\n<pre>\ntasks.withType(ScalaCompile) {\n    configure(scalaCompileOptions.forkOptions) {\n        memoryMaximumSize = '1g'\n        jvmArgs = ['-XX:MaxPermSize=512m']\n    }\n}\ntasks.withType(ScalaCompile) {\n    scalaCompileOptions.useAnt = false\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you find the build times of Scala programs in gradle unacceptably slow, you can add the following to build.gradle. This took my simple build from 25 seconds to five. compileScala { scalaCompileOptions.useCompileDaemon = true \/\/ optionally specify host and port of the daemon: scalaCompileOptions.daemonServer = &#8220;localhost:4243&#8221; } This doesn&#8217;t seem to be stable all &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/improving-performance-of-gradle-scala-build-with-a-compiler-daemon\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Improving Performance of Gradle + Scala Build with a compiler daemon&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[258,480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1927"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=1927"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/1927\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=1927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=1927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=1927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}