Disable Pre-Dexing to Improve Build Performance

Hi guys!

I need your help to disable Pre-Dexing to Improve Build Performance. I am new in circleci and in Android. So, it’s really difficult to me notice obvious things. I read in Support documentation that they recommend disable pre-dexing to improve build performance. I tried to use the example they provide but I can not see any improvement on the time.

This is the link: https://www.littlerobots.nl/blog/disable-android-pre-dexing-on-ci-builds/

My circle.yml is:

general:
  artifacts:
    - "app/build/reports/androidTests/connected"

machine:
    java:
        version: oraclejdk8
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
    pre:
        - bundle install
        - bundle update fastlane
#it is commented to try to improve build time
#    override:
#        - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-19.1.0,android-19,extra-google-m2repository,extra-google-google_play_services,extra-android-support
#        - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

deployment:
#it is commented because is taking around 12 minutes
#  espresso:
#    branch: gradle_config
#    commands:
#    # start the emulator
#      - emulator -avd circleci-android22 -no-audio -no-window:
#          background: true
#          parallel: true
#    # wait for it to have booted
#      - circle-android wait-for-boot
#    # unlock the emulator screen
#      - sleep 30
#      - adb shell input keyevent 82
#    # run tests  against the emulator.
#      - ./gradlew connectedAndroidTest -PdisablePreDex
#    # copy the build outputs to artifacts
#      - cp -r app/build/outputs $CIRCLE_ARTIFACTS
#    # copy the test results to the test results directory.
#      - cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS

  crashlytics:
    branch: gradle_config
    #tag: /release-.*/
    owner: me
    commands:
      - bundle exec fastlane beta

  release:
    tag: /production-.*/
    commands:
      - bundle exec fastlane deploy

checkout:
  post:
    - cp -r android-licenses/. $ANDROID_HOME/licenses

test:
   override:
      # Disable Pre-Dexing to Improve Build Performance
      # https://circleci.com/docs/android/#disable-pre-dexing-to-improve-build-performance
      - ./gradlew test -PdisablePreDex
  post:
     - mkdir -p $CIRCLE_TEST_REPORTS/junit/
     - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

What do you think? Am I doing something wrong?