Avoiding transient AOT compilation of clojure source files

I have a cross Java clojure project that uses maven as a build tool. AOT compilation is required for some namespaces.

The problem is that compilation is performed as always. Checking the maven process gives the following observations:

  • When compiling, the processor latency time is very long (single core 70-90%).
  • Sampling in which a highly-anticipated stream gives a stack where the most internal calls are:

    at java.io.FileDescriptor.sync(Native Method)
    at clojure.lang.Compiler.writeClassFile(Compiler.java:7269)
    
  • When checking a folder target/classes/, a large number of files are created .class, mainly for clojure-based libraries that my project depends on.

What I tried:

  • Instructed clojure -maven-plugin to compile only the given namespaces. But dependency propagation is not blocked.
  • Explicitly included the given namespaces and excluded the dependency namespace. The dependency library is still recompiled by the AOT process.

Well, just before I hit the "POST" button, I found this problem . It seems like after 5 years we had such a discussion and the problem is not related to clojure -maven-plugin. So what's new in this matter? It takes about 4 minutes to mvn clean compileonce on my car for my not-so-big project, and I can literally grab coffee, sit back and chill ..

- , ? .

+4
1

, . :

clean.sh script . , 4- 1 .

, , - .

0

Source: https://habr.com/ru/post/1623726/


All Articles