Tuesday, July 28, 2015

Gradle Daemon - boost your build performance

You use Gradle and want to speed up a bit your build time? Nobody wants to wait for compilation, assembly etc. Let's try this easy to setup performance boost:

If you enable Gradle Daemons, you can actually reuse the Gradle context that you've just created for your subsequent builds! It basically doesn't completely kill the process when a Gradle build finishes, but reuses the common framework classes and thus improving build time.

I've tried it on my projects and the improvement was from a 40s build down to 20s on subsequent builds !

Here's what you need to do and know:
touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties

  • enables Gradle daemon for all your projects by default (don't worry you can turn it off for individual projects as well)
  • if you use multiple Gradle versions, a different daemon is created for each one! This is a potential deal-breaker for some developers, but a good reason to align all your projects to a single version of Gradle.

  • in case you want to recreate the daemon, you can stop them all using:

./gradlew --stop
And that's it!

For more info check the dedicated page:
https://docs.gradle.org/current/userguide/gradle_daemon.html 

Monday, June 29, 2015

Chocolatey - apt-get for windows

As a Windows user, I was quite envious of Linux/OS X tools like apt-get or brew... But not anymore!  I've just found the Chocolatey tool for Powershell which let's you easily find and install software on your Windows-powered PC.

Let's see an example:
Searching for Slack and installing afterwards





















This way you can maintain apps and versions on your PC using scripts.
If you want to check if there's an upgrade to any of your programs, just write:

choco upgrade all
If you want to give it a try yourself, visit https://chocolatey.org/  and follow the instructions