Package org.eolang.hone
Class OptimizeMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eolang.hone.OptimizeMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="optimize",
defaultPhase=PROCESS_CLASSES,
requiresProject=false)
public final class OptimizeMojo
extends org.apache.maven.plugin.AbstractMojo
Converts Bytecode to Bytecode in order to make it faster.
This goal takes every .class file from the
target/classes/ directory, converts it to .xmir
format (which is XML representation of EO),
then converts .xmir to .phi (which is
𝜑-calculus),
then optimizes it via
phino,
and then back to .xmir and to .class. As a result,
you obtain optimized Bytecode in the target/classes/ directory,
which supposedly works faster than before.
The entire optimization pipeline happens inside Docker container, which is run from the image specified in the image parameter. The image may either be pulled or built locally. We recommend pulling it from the Docker Hub with the help of the pull goal. Also, we recommend deleting the image after optimization is done, with the help of the rmi goal.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceC library interface for getting user IDs. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringDocker image to use.protected booleanWhether to use "sudo" when executing Docker commands.protected FileThe "target/" directory of Maven project.protected org.eolang.hone.TimingsTimings tracker for performance measurements.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
target
The "target/" directory of Maven project.- Since:
- 0.1.0
-
timings
protected org.eolang.hone.Timings timingsTimings tracker for performance measurements.- Since:
- 0.1.0
-
image
Docker image to use.- Since:
- 0.1.0
-
sudo
@Parameter(property="hone.sudo", defaultValue="false") protected boolean sudoWhether to use "sudo" when executing Docker commands.- Since:
- 0.1.0
-
-
Constructor Details
-
OptimizeMojo
public OptimizeMojo()
-
-
Method Details
-
exec
- Throws:
IOException
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-