Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 809 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 809 Bytes

JavaCompiler API 的内存编译优化用例

用法

String lambdaSource = """
        import java.util.function.BiFunction;
        public class LambdaContainer {
            public static BiFunction<Integer, Integer, Integer> getLambda() {
                return (x, y) -> x + y;
            }
        }
        """;

CompilationResult compile = JavaCompiler.NATIVE.compile("LambdaContainer.java", lambdaSource);

优化之前

优化之前

优化之后

优化之后

优化思路

License

This project is licensed under the GPLv2 with the classpath exception. See the LICENSE file for details.