You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Vladimir Sitnikov <si...@gmail.com> on 2014/11/26 23:06:59 UTC

maven vs incremental compilation vs MCOMPILER-209

Hi,

I've noticed that maven always recompiles all the files.
Even if you run mvn install multiple times in a row, mvn will
recompile java code as follows:
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 884 source files to
/Users/vladimirsitnikov/Documents/code/incubator-optiq/core/target/classes

That bothers me, so I went and found that it is a known
maven-compiler-plugin problem (see [1] and [2])

The suggested solution is adding
<useIncrementalCompilation>false</useIncrementalCompilation> to the
configuration of maven-compiler-plugin. It looks like the setting is
inverse :)

Here's my comparison of adding the option: rebuild time is reduced
from 28 sec to 18 sec (see [3])
Any objections if I add useIncrementalCompilation=false in the pom?

I guess the rest of the build time is taken by recreating of the jars
(due to resource properties being recreated with new value of
"build.timestamp")

[1]: http://stackoverflow.com/questions/17944108/maven-compiler-plugin-always-detecting-a-set-of-sources-as-stale
[2]: https://jira.codehaus.org/browse/MCOMPILER-209
[3]: https://gist.github.com/vlsi/3d490836ff6ebaf193db

-- 
Regards,
Vladimir Sitnikov

Re: maven vs incremental compilation vs MCOMPILER-209

Posted by Julian Hyde <ju...@gmail.com>.
Vladimir,

As you make these changes to the build infrastructure, you should check that the snapshot and release builds continue to work (in "dry run" mode, obviously). They are each documented in the HOWTO.

Julian


> On Nov 27, 2014, at 3:00 AM, Vladimir Sitnikov <si...@gmail.com> wrote:
> 
> I've created relevant issue: https://issues.apache.org/jira/browse/CALCITE-484
> 
> Vladimir


Re: maven vs incremental compilation vs MCOMPILER-209

Posted by Vladimir Sitnikov <si...@gmail.com>.
I've created relevant issue: https://issues.apache.org/jira/browse/CALCITE-484

Vladimir

Re: maven vs incremental compilation vs MCOMPILER-209

Posted by Vladimir Sitnikov <si...@gmail.com>.
> not rebuild the jars

It looks like the next main problem is with maven-resources-plugin.
When I build just avatica, the only "newer" files are DEPENDENCIES,
LICENSE, NOTICE.

The list of bad plugins is:
1) maven-resources-plugin. It always regenerate files above files from
velocity templates.
2) git.properties -- we might not need the exact build timestamp for dev builds
3) generate-fmpp-sources -- seems to regenerate the same parser again and again
4) hydromatic-resource-maven-plugin seems to regenerate the same
runtime for each execution
5) org-apache-calcite-jdbc.properties includes build.timestamp

If I "disable" those plugins, the subsequent builds take 6-7 seconds
and the jars are not updated.

Total time: 6.237 s

Most time consuming are:
1.4s Calcite
1.2s Calcite Ubenchmark
0.9s Calcite Plus
0.8s Calcite Core
0.6s Calcite Spark

Vladimir

Re: maven vs incremental compilation vs MCOMPILER-209

Posted by Julian Hyde <ju...@gmail.com>.
+1

And if you can figure out a way to not rebuild the jars, that would be good too. It would be fine if we only generated a new build.timestamp after a clean.

> On Nov 26, 2014, at 2:06 PM, Vladimir Sitnikov <si...@gmail.com> wrote:
> 
> Hi,
> 
> I've noticed that maven always recompiles all the files.
> Even if you run mvn install multiple times in a row, mvn will
> recompile java code as follows:
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 884 source files to
> /Users/vladimirsitnikov/Documents/code/incubator-optiq/core/target/classes
> 
> That bothers me, so I went and found that it is a known
> maven-compiler-plugin problem (see [1] and [2])
> 
> The suggested solution is adding
> <useIncrementalCompilation>false</useIncrementalCompilation> to the
> configuration of maven-compiler-plugin. It looks like the setting is
> inverse :)
> 
> Here's my comparison of adding the option: rebuild time is reduced
> from 28 sec to 18 sec (see [3])
> Any objections if I add useIncrementalCompilation=false in the pom?
> 
> I guess the rest of the build time is taken by recreating of the jars
> (due to resource properties being recreated with new value of
> "build.timestamp")
> 
> [1]: http://stackoverflow.com/questions/17944108/maven-compiler-plugin-always-detecting-a-set-of-sources-as-stale
> [2]: https://jira.codehaus.org/browse/MCOMPILER-209
> [3]: https://gist.github.com/vlsi/3d490836ff6ebaf193db
> 
> -- 
> Regards,
> Vladimir Sitnikov