Skip to content

Java Tiered Compilation #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rk29 opened this issue May 13, 2023 · 2 comments · May be fixed by #330
Open

Java Tiered Compilation #326

rk29 opened this issue May 13, 2023 · 2 comments · May be fixed by #330

Comments

@rk29
Copy link

rk29 commented May 13, 2023

I've seen good improvements for Lambda functions written in Java using tiered compilation, as described in this article:

https://aws.amazon.com/blogs/compute/increasing-performance-of-java-aws-lambda-functions-using-tiered-compilation/

Even just using TieredStopAtLevel=1 my team has seen the cold start times cut in half for many of our Lambda functions. I do think this is something that has more of an affect when you have more initialization code though, so it might not provide as much benefit in this package, since the code in the lambda is minimal. It might be worth a try, and would be a good data point.

I have not measured the results for the combination yet, but Tiered Compilation can also be combined with SnapStart.

@rk29
Copy link
Author

rk29 commented May 13, 2023

Tiered Compilation can be enabled just by setting an environment variable, as described here:

https://aws.amazon.com/blogs/compute/optimizing-aws-lambda-function-performance-for-java/

The other article explains how to do the same thing with a layer, which is probably overkill for this project. A simple environment variable should be much easier to add.

@maxday maxday linked a pull request May 17, 2023 that will close this issue
@jreijn
Copy link
Contributor

jreijn commented Nov 18, 2023

FYI. Tiered compilation is by default enabled in the Java 17 runtime. I assume this is the same case for Java 21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants