Re: Speeding up Maven

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Speeding up Maven

Karl Heinz Marbaise-3
Hi Mark,

I simply missed this project:

https://github.com/khmarbaise/maven-buildtime-profiler

Kind regards
Karl Heinz Marbaise


On 13/04/18 21:20, Mark Raynsford wrote:

> Hello.
>
> Is there any way I might speed up Maven? I've been using it for years
> and, for the first time, I'm actually executing it from an IDE rather
> than using the IDE's built-in compiler. It seems like there's a rather
> large and apparently fixed amount of overhead per invocation. Take the
> following "could not be simpler" project:
>
>    https://github.com/io7m/maven-minimal-20180413
>
> I piped the output through tai64n [1] to give a better indication of
> exactly how long everything is taking. That's a project that compiles a
> single Java file and produces a jar. It doesn't run any tests, it
> doesn't include any resources. 16 seconds total execution [2]!
>
> Now for an infrequent command-line build, that's not *too* obnoxious.
> For a "click a button in the IDE because I want to try this bit of code
> now" build, that's a world of suffering.
>
> It seems like Maven first spends ten entire seconds doing not very
> much. That cannot be attributed to JVM startup time (Hello World on my
> system takes about 100ms to reach user code, and even the largest Java
> application I still takes less than a second to reach user code after
> all the classes have loaded).
>
> Is there anything I can do to cut this down? If not, is this something
> that's intended to be addressed in the near future?
>
> [1] http://cr.yp.to/daemontools/tai64n.html
> [2] The Maven output claims 6 seconds, but that doesn't include the
>      time it took for the build to start.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Speeding up Maven

Mark Raynsford
On 2018-04-13T16:29:27 -0400
Paul Hammant <[hidden email]> wrote:

> Mark,
>
> Assuming a pre-filled Maven local cache, I've a 16 second build that's only
> longer when I run a screen recorder in order to make the video show here -
> https://paulhammant.com/2017/02/05/a-16-second-java-webapp-build-including-webdriver-tests/
>
> That one runs three WebDriver tests too after the unit and service tests -
> meaning (implicitly) it's testing JavaScript as well as Java in that time.
>
> In order to make it fast I've abandoned the fail-safe plugin and do all
> parts of the test-pyramid in surefire (see the pom).
'Ello.

So you're saying it's my problem? ;)

I'm also assuming a pre-filled Maven local cache, but this example
project (with no dependencies) takes about six seconds to build with
(usually) about ten seconds of Maven churning before the build even
begins. This is for a build that compiles one tiny file, produces a
jar, and does nothing else.

I assumed that it was happening for everyone, but apparently it isn't.

--
Mark Raynsford | http://www.io7m.com


attachment0 (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Speeding up Maven

Paul Hammant
Can you yourself try another dissimilar machine?
Reply | Threaded
Open this post in threaded view
|

Re: Speeding up Maven

Bernd Eckenfels
In reply to this post by Mark Raynsford
Hello,

Maven is not the fastest, but in your case it sounds unusual slow. What are your machine specs? Any SSD? Do you happen to have a on-access malware scanner active? They react very bad to Java scanning large number of JAR files.

Gruss
Bernd

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
From: Mark Raynsford <[hidden email]>
Sent: Friday, April 13, 2018 11:21:33 PM
To: Paul Hammant
Cc: Maven Developers List
Subject: Re: Speeding up Maven

On 2018-04-13T16:29:27 -0400
Paul Hammant <[hidden email]> wrote:

> Mark,
>
> Assuming a pre-filled Maven local cache, I've a 16 second build that's only
> longer when I run a screen recorder in order to make the video show here -
> https://paulhammant.com/2017/02/05/a-16-second-java-webapp-build-including-webdriver-tests/
>
> That one runs three WebDriver tests too after the unit and service tests -
> meaning (implicitly) it's testing JavaScript as well as Java in that time.
>
> In order to make it fast I've abandoned the fail-safe plugin and do all
> parts of the test-pyramid in surefire (see the pom).

'Ello.

So you're saying it's my problem? ;)

I'm also assuming a pre-filled Maven local cache, but this example
project (with no dependencies) takes about six seconds to build with
(usually) about ten seconds of Maven churning before the build even
begins. This is for a build that compiles one tiny file, produces a
jar, and does nothing else.

I assumed that it was happening for everyone, but apparently it isn't.

--
Mark Raynsford | http://www.io7m.com

Reply | Threaded
Open this post in threaded view
|

Re: Speeding up Maven

Kristian Rosenvold-4
Just make sure you're not running low on entropy on your linux box, all
sorts of weird slowdowns happen then.

https://major.io/2007/07/01/check-available-entropy-in-linux/

Kristian


2018-04-16 11:28 GMT+02:00 Mark Raynsford <[hidden email]>:

> With absolutely impeccable timing, I've had a couple of hardware
> failures. It is theoretically possible that this was the cause of the
> performance issues - although there were no error messages logged
> anywhere.
>
> I'm waiting for replacement parts, so it'll be a week or so before I
> can continue pulling on this thread.
>
> Thanks for the responses, all!
>
> --
> Mark Raynsford | http://www.io7m.com
>
>