question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dagger spends a lot of time formatting code

See original GitHub issue

In trying to optimize my build times, I profiled a typical (warmed up) Gradle build of my Android project with YourKit and noticed that it takes a lot of time generating Dagger code. I noticed that Dagger spends especially a lot of times in the com.google.googlejavaformat.java.Formatter.formatSource(CharSource, CharSink) method.

I’m not sure if formatting the source code is mandatory for it to compile. If not, I would like to ask for an option to disable source code formatting.

it8oxmf

Dagger version used: 2.2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:23
  • Comments:27

github_iconTop GitHub Comments

19reactions
JakeWhartoncommented, Aug 13, 2018

Can we revisit this now that JavaPoet has things like optional line breaks when column limits are hit?

What else can I add to JavaPoet to eliminate the need to run GJF? Can we disable it for now and treat any unsavory output as the bug that needs fixed?

11reactions
JakeWhartoncommented, Oct 21, 2016

Just to circle back on this, we see formatting taking approximately 40% of Dagger’s processor time. I would really love to get rid of this wasted time on local developer builds where 2 seconds is a non-trivial addition to the wall clock time of a build.

screen shot 2016-10-21 at 3 20 02 pm
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Dagger with Docker for better CI/CD - LogRocket Blog
Dagger is an open-source devkit for CI/CD. It works using Cue, which helps to validate and define text-based and dynamic configurations.
Read more >
Time formatting in Excel: inbuilt, custom, default - Ablebits
Everything you need to know about formatting time in Excel: how to change time to 12 or 24 hour format, apply custom formatting,...
Read more >
Dagger: a new way to build CI/CD pipelines - Hacker News
We desperately need a better, more efficient package manager, and Docker has been a huge setback; it has become normal for CICD to...
Read more >
(AMA) We're the Google team behind Guava, Dagger, Guice ...
How about this one: I've learned so much from spending the time reading your code. I've become a vastly better designer by following...
Read more >
Feature Engineering at Scale with Dagger and Feast - Tecton
Dagger or Data Aggregator is an easy-to-use, configuration over code, ... built on top of Apache Flink for stateful processing of real-time streaming...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found