vessel icon indicating copy to clipboard operation
vessel copied to clipboard

Req: AOT compile more than just the main namespace

Open hlship opened this issue 1 year ago • 0 comments

Currently, vessel is passed a --main-class and AOT compiles that namespace and every namespace that is transitively reachable from it.

We are experimenting with improving component startup time. One of our initiatives is to replace a ns :require with a kind of placeholder component that uses requiring-resolve and a fully qualified symbol at runtime to load a namespace and execute a builder function (rather than directly execute the builder function). Combined with other changes, this will allow multiple threads to instantiate and start components in parallel.

Because of this, the component's namespace is not transitively reachable from the main namespace, as there is no longer a hard require on the namespace. Unfortunately, this means that the component's namespace is not AOT compiled.

The lack of compilation undermines the other parallelizing improvements, because the requiring-resolve has to load Clojure source and compile it, rather than load compiled code and execute it.

We would like vessel to scan the classpath for all Clojure source files, identify those that have not yet been AOT compiled, and compile each.

hlship avatar May 02 '23 23:05 hlship