Cold starts with SnapStart for Java Frameworks (Spring Boot vs Quarkus vs Micronaut)
Tags: serverless, java, quarkus, springboot
Published: 2023-02-17 11:11:58

At the last **re:Invent** 2022 AWS gave a lot of attention to the term Serverless. The [main Keynote](https://youtu.be/RfvL_423a-I) of AWS CTO **Dr. Werner Vogels** was very saturated with asynchronous approach and event-driven architecture. Also, new announcements were very closely related to these topics e.g. Step Functions & Event Bridge improvements.

Apart from all these trendy announcements, AWS also shows that it is trying to invest in technologies very cross-sectionally. It doesn’t cut itself off from Java technology, among others. This is evidenced by one of the largest Serverless announcements -  [SnapStart](https://aws.amazon.com/blogs/aws/new-accelerate-your-lambda-functions-with-lambda-snapstart/).

Due to the fact that I am associated with Java technology from the beginning of my professional career, I was very excited about this announcement. I was aware that so far JVM-based languages are not the main players for Lambda functions. Mainly because of its long cold start.
I haven't checked in a long time to see if anything has improved. So I decided that the release of SnapStart is a good time to evaluate cold starts for Java and its frameworks - Spring Boot, Quarkus, and Micronaut.

---

## What is SnapStart?

Typically, AWS Lambda set up a new execution environment each time a function is first invoked or when the function is scaled up to handle increased traffic. As you probably know applications written in Java before accepting traffic need some time to initialize and start-up. This is the nature of JVM. SnapStart has been created to address this issue.

When SnapStart is enabled Lambda ahead of time creates a snapshot of initialized execution environment (memory and disk state) and persists it in the cache for low-latency access. This eliminates the need for the function to spend time on initialization (when the event came), as Lambda can quickly resume from the persisted snapshot instead.

I said "ahead of time" because Snapshot creation happens when you publish a function version and SnapStart works only for the published version of the Lambda function (can’t just use `$LATEST`).
Normally `Init` phase is the stage during Lambda performs multiple tasks like preparing the runtime container, downloading function code, initializing it, and so on… and then moving to the next phase. `Init` phase is Limited to **10 seconds**. When SnapStart is activated, the `Init` phase happens earlier - yes, yes… when you publish a function version. In this case, 10-second timeout doesn't apply. Snapshot initialization can take up to **15 minutes**.


![AWS Lambda SnapStart lifecycle diagram ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m71hyt29i11k6alak60z.png)


Someone more curious might ask _how the snapshot of the initiated function is possible to create?_ The answer is hidden behind a few magic terms.
First of all - [CRaC](https://wiki.openjdk.org/display/crac) (Coordinated Restore at Checkpoint) - open source project led by **OpenJDK**. It's focused on creating Java API responsible for saving and restoring the state of a JVM, including the currently running application - so-called `checkpointing`.  CRaC based on next key project - [CRIU (Checkpoint/Restore in Userspace)](https://criu.org/Main_Page) - that allows application running on Linux system to be paused and restarted at some point later in time, potentially on a different machine. The last key piece of this SnapStart puzzle is [Firecracker](https://firecracker-microvm.github.io/) and his **microVMs**. SnapStart uses micro Virtual Machine (microVM) snapshots to checkpoint and restore full applications. Interestingly, it turns out that Amazon engineers from Firecracker and Corretto (AWS JDK distribution) teams were involved in CRaC project at the early stage.

This means that AWS has long since taken the first steps to address the cold start problem for Java. It confirms my thesis that AWS invests in breakthrough technologies and knows that Java and JVM are still important in the IT market.

But unfortunately, not everything is so beautiful. SnapStart and the methods on which it is based introduced some  challenges -  Due to the fact that it operates on a memory dump.

- **Randomness** - all results of `java.util.Random` operations can be the same so use `java.security.SecureRandom` instead because Amazon handles it in Corretto. But if one of your dependencies uses the first one, you still be in trouble.
- **Connections keeping** -  state of connections that your function establishes during the initialization phase isn't guaranteed when Lambda resumes from a snapshot. In most cases, network connections that an AWS SDK establishes automatically resume but for other connections you need to handle it on your own.
- **Stale credentials** - the created snapshot also caches things like injected secrets and passwords (of course the whole snapshot is encrypted). Passwords can be rotated automatically. However, the snapshot can be used for a long period of time and not know anything about the password change. Our snapshot is immutable so will continue to use stale credentials. This applies not only to secrets. You need to protect yourself against such a case for any frequently changed data that you pull from an external sources into function memory. But don’t worry, you have tools to handle it e.g. post-snapshot hook.
- **Other lacks of support for AWS Lambda** -  provisioned concurrency, arm64 architecture, EFS, larger ephemeral storage (max 512 MB)

I'm curious if SnapStart will remain a functionality reserved only for Java runtime or maybe it will turn out that AWS prepares a similar trick for other runtimes. Presumably, other runtimes can't use snapshotting in quite the same way as JVM and others wouldn’t make sense to even attempt eg. Golang. But, I would like to see a SnapStart kind of solution for Node, which also can have hiccups in cold start ... especially with a large number of dependencies.

---

## Spring Boot vs Quarkus vs Micronaut - introduction of competitors

Before we get to the merits, a brief introduction of competitors. Overall, all 3 frameworks are similar in terms of functionality and are suitable for building web apps and microservices, but they have different design goals and trade-offs.

BTW all sources and codes, as always, can be found on my [GitHub](https://github.com/luafanti/serverless-java-frameworks)

### Spring Boot

Spring Boot is the most widely adopted and well-established of the three frameworks. Pivotal product has also the largest and most active community. It has been around for over a decade. It provides a wide range of features and is highly configurable, making it a good choice for large and complex applications. However, Spring Boot is more resource-intensive than Quarkus and Micronaut. Spring Boot uses a traditional, Just-in-Time (JIT) compilation approach, which can result in longer startup times compared to Quarkus and Micronaut, which use Ahead-of-Time (AOT) compilation. AOT compilation pre-compiles the code at build time, resulting in faster startup times and smaller memory footprint. Also, runtime dependency injection adds some overhead and complexity to spring-based workloads.

### Quarkus

Quarkus is a relatively new framework that aims to provide the same functionality as Spring Boot, but with a smaller footprint and faster startup time. A project initiated by RedHat was created to be used for native compilation for GraalVM. It aims to be effective platform for serverless, cloud, and Kubernetes environments. Quarkus uses Ahead-of-Time (AOT) compilation to reduce startup time and memory usage. The community strongly appreciates the speed and convenience of development. More and more projects boast of migrating microservice workloads from Spring Boot to Quarkus. At the end I can add that the documentation is really good.

### Micronaut

Micronaut like Quarkus is a relatively newer framework, but it has been gaining popularity in recent years. It has a very spring-inspired programming model. It also uses Reactor (instead of Vert.x that Quarkus use). So if you are coming from a Spring world, in Micronaut you will find many similar patterns, techniques e.g. Mono and Flux from Reactor core. At the same time Micronaut aims to avoid downsides of Spring. It minimizes using reflections and proxies and doesn't use runtime bytecode generation. The source I found says that performance is a tiny bit better with Quarkus, but it's just negligible value.

---

## Measurements and charts

Let's move on to the main point - measurements. They were the main reason for writing this article. I wanted to measure how a cold start looks in 2023 for Java and its most popular frameworks. How much SnapStart makes things better. If SnapStart also affect warm start? How resource changes (Lambda memory) affect a cold & warm start performance? I hope the charts and tables below will help you answer these questions.

### Vanilla Java


<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">Non SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>0%</td>
            <td>754.9</td>
            <td>790.8</td>
            <td>826.9</td>
            <td>904</td>
            <td>11.3</td>
            <td>37</td>
            <td>228.2</td>
            <td>275.4</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>566.6</td>
            <td>599.9</td>
            <td>666.9</td>
            <td>676.1</td>
            <td>1.9</td>
            <td>15.4</td>
            <td>107.1</td>
            <td>328.2</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>549.4</td>
            <td>474.3</td>
            <td>502.1</td>
            <td>529.5</td>
            <td>1.6</td>
            <td>8.4</td>
            <td>50.9</td>
            <td>97.3</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>426.1</td>
            <td>445.5</td>
            <td>466.1</td>
            <td>489.7</td>
            <td>1.6</td>
            <td>3.3</td>
            <td>20.6</td>
            <td>25.5</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>301.7</td>
            <td>327.7</td>
            <td>415.9</td>
            <td>450.4</td>
            <td>1.5</td>
            <td>2.5</td>
            <td>13.2</td>
            <td>21.1</td>
        </tr>
</table>



<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>0%</td>
            <td>705.3</td>
            <td>773.3</td>
            <td>817.8</td>
            <td>896.2</td>
            <td>17.4</td>
            <td>52.6</td>
            <td>268</td>
            <td>479.7</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>401.6</td>
            <td>447.9</td>
            <td>473.2</td>
            <td>536.6</td>
            <td>7.7</td>
            <td>20.3</td>
            <td>120.2</td>
            <td>214.3</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>231.9</td>
            <td>261.9</td>
            <td>311.7</td>
            <td>1174.6</td>
            <td>1.7</td>
            <td>9.7</td>
            <td>53.5</td>
            <td>135.6</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>203.9</td>
            <td>231.6</td>
            <td>367.3</td>
            <td>399.1</td>
            <td>1.6</td>
            <td>3.7</td>
            <td>24.8</td>
            <td>53.4</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>241.5</td>
            <td>353.4</td>
            <td>484.1</td>
            <td>501.4</td>
            <td>1.5</td>
            <td>2.6</td>
            <td>14</td>
            <td>25.7</td>
        </tr>
</table>

![Java Cold start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikfu637xkip7pdrjcwto.png)
<figcaption>Java Cold start median</figcaption>

![Java Warm start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yyhjiixn5tuo6wh52ay4.png)
<figcaption>Java Warm start median</figcaption>


---

### Spring Boot


<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">Non SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>10,5%</td>
            <td>5584.1</td>
            <td>6867.7</td>
            <td>7119.3</td>
            <td>7157.4</td>
            <td>28.3</td>
            <td>1135.7</td>
            <td>3582.5</td>
            <td>3808.8</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>3515.4</td>
            <td>3647.8</td>
            <td>3725.2</td>
            <td>3762.8</td>
            <td>12.1</td>
            <td>20.2</td>
            <td>52.9</td>
            <td>180.6</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>3396.6</td>
            <td>3512.3</td>
            <td>3599.6</td>
            <td>3599.6</td>
            <td>3.9</td>
            <td>9.2</td>
            <td>18.5</td>
            <td>94.7</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>2366.4</td>
            <td>2525.2</td>
            <td>3127.5</td>
            <td>3191.1</td>
            <td>3.4</td>
            <td>5</td>
            <td>10.6</td>
            <td>33.4</td>
        </tr>
</table>


<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>60.3%</td>
            <td>3920</td>
            <td>5027.8</td>
            <td>5149.8</td>
            <td>5173.7</td>
            <td>2399.7</td>
            <td>3717.8</td>
            <td>3931.8</td>
            <td>4141.4</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>515.3</td>
            <td>554.2</td>
            <td>598.7</td>
            <td>611.4</td>
            <td>5.6</td>
            <td>18.6</td>
            <td>37.1</td>
            <td>54.3</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>347.3</td>
            <td>381.1</td>
            <td>451.6</td>
            <td>1270</td>
            <td>3.8</td>
            <td>9.1</td>
            <td>17.1</td>
            <td>32.3</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>350.4</td>
            <td>417.3</td>
            <td>604.7</td>
            <td>641</td>
            <td>3.6</td>
            <td>5.7</td>
            <td>16.9</td>
            <td>65.1</td>
        </tr>
</table>


![Spring Boot Cold start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c27g9rtgepob7888ep16.png)
<figcaption>Spring Boot Cold start median</figcaption>

![Spring Boot Warm start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvo5gu9gm3lp8ikx5t2y.png)
<figcaption>Spring Boot Warm start median</figcaption>

---


### Quarkus


<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">Non SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>3452.7</td>
            <td>3543.6</td>
            <td>3732.7</td>
            <td>3757.3</td>
            <td>50.5</td>
            <td>73.1</td>
            <td>213.8</td>
            <td>317.2</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>2738.2</td>
            <td>2818.7</td>
            <td>2890</td>
            <td>2899.4</td>
            <td>16.5</td>
            <td>34</td>
            <td>93.1</td>
            <td>189.5</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>2305.7</td>
            <td>2387.7</td>
            <td>2512.6</td>
            <td>4079.8</td>
            <td>5.8</td>
            <td>11.4</td>
            <td>14.5</td>
            <td>70.2</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>1676.2</td>
            <td>1823</td>
            <td>2028.8</td>
            <td>2046.3</td>
            <td>4.4</td>
            <td>7.7</td>
            <td>18.4</td>
            <td>42.6</td>
        </tr>
</table>



<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>1918.5</td>
            <td>1977.8</td>
            <td>2034.1</td>
            <td>2063.4</td>
            <td>48.8</td>
            <td>63.5</td>
            <td>168.2</td>
            <td>264.1</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>1059.1</td>
            <td>1115.8</td>
            <td>1144.8</td>
            <td>1148.2</td>
            <td>16</td>
            <td>33.7</td>
            <td>94.6</td>
            <td>172.5</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>583.38</td>
            <td>622</td>
            <td>690.4</td>
            <td>711.2</td>
            <td>5.5</td>
            <td>13.6</td>
            <td>37.9</td>
            <td>64.3</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>455.7</td>
            <td>498.6</td>
            <td>556</td>
            <td>566.1</td>
            <td>4.3</td>
            <td>7.4</td>
            <td>20.2</td>
            <td>57.2</td>
        </tr>
</table>


![Quarkus Cold start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zamzdl61smrqqxtshrtm.png)
<figcaption>Quarkus Cold start median</figcaption>

![Quarkus Warm start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uexirpqus9a4s7p2m4uc.png)
<figcaption>Quarkus Warm start median</figcaption>

---


### Micronaut

<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">Non SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>3758.9</td>
            <td>3912.2</td>
            <td>4362.3</td>
            <td>4262.7</td>
            <td>29.1</td>
            <td>46.8</td>
            <td>174.1</td>
            <td>315.7</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>3391.1</td>
            <td>3626</td>
            <td>3916.1</td>
            <td>3941.4</td>
            <td>9.3</td>
            <td>18.9</td>
            <td>55</td>
            <td>151.1</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>3146.2</td>
            <td>3357.5</td>
            <td>3680.2</td>
            <td>3723.9</td>
            <td>3.6</td>
            <td>9.6</td>
            <td>25.7</td>
            <td>82</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>2517.6</td>
            <td>2628.2</td>
            <td>2738.1</td>
            <td>2881.9</td>
            <td>3.2</td>
            <td>4.6</td>
            <td>12.7</td>
            <td>45.9</td>
        </tr>
</table>

<table class="table-bordered">
        <tr>
            <th colspan="2" style="horizontal-align : middle;text-align:center;">SnapStart</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
            <th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>           
        </tr>
        <tr>
            <th scope="col"> memory (MB)</th>
            <th scope="col">error rate</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
            <th scope="col">p50</th>
            <th scope="col">p90</th>
            <th scope="col">p99</th>
            <th scope="col">max</th>
        </tr>        
        <tr>
            <th>128</th>
            <td>100%</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
            <td>N/A</td>
        </tr>
        <tr>
            <th>256</th>
            <td>0%</td>
            <td>1725.4</td>
            <td>1814.6</td>
            <td>2257.8</td>
            <td>2289.8</td>
            <td>29.1</td>
            <td>44.2</td>
            <td>175.2</td>
            <td>231.8</td>
        </tr>
        <tr>
            <th>512</th>
            <td>0%</td>
            <td>677</td>
            <td>729.7</td>
            <td>798.4</td>
            <td>809.1</td>
            <td>11.4</td>
            <td>20.5</td>
            <td>65.8</td>
            <td>91</td>
        </tr>
        <tr>
            <th>1024</th>
            <td>0%</td>
            <td>468.6</td>
            <td>518.9</td>
            <td>626.3</td>
            <td>1373.1</td>
            <td>3.7</td>
            <td>8.6</td>
            <td>25.5</td>
            <td>97.7</td>
        </tr>
        <tr>
            <th>4096</th>
            <td>0%</td>
            <td>388.8</td>
            <td>439.2</td>
            <td>562.1</td>
            <td>594.3</td>
            <td>3.1</td>
            <td>4.9</td>
            <td>16.7</td>
            <td>67.1</td>
        </tr>
</table>


![Micronaut Cold start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2njcsg82eqr3rawl80m.png)
<figcaption>Micronaut Cold start median</figcaption>

![Micronaut Warm start median - SnapStart comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3aubj6i5tztyqa1l2ew.png)
<figcaption>Micronaut Warm start median</figcaption>

---


**Spring Boot vs Quarkus vs Micronaut vs Java - cold start charts**


![Spring Boot, Quarkus, Micronaut, Java - cold start without SnapStart median](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oclht5xxkr0wtx24m1wx.png)
<figcaption>Spring Boot, Quarkus, Micronaut, Java - cold start without SnapStart median</figcaption>

![Spring Boot, Quarkus, Micronaut, Java - cold start with SnapStart median](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9kghl0rfsrpvs160hpi.png)
<figcaption>Spring Boot, Quarkus, Micronaut, Java - cold start with SnapStart enabled median</figcaption>

---

### General conclusions and observations 

- only pure Java Lambda can be run with 128 MB configuration and handle traffic. Frameworks fail with `java.lang.OutOfMemoryError`
- Spring Boot framework fails part of requests also with 256 MB configuration. This spoils chart presentation for 256 MB
- function package size is the largest for Spring Boot (13,7 MB) and the smallest for Micronaut (11,8 MB) apart from pure Java that size is around 1MB
- the biggest difference in performance can be observed when upgrading memory from 256 MB to 512 MB. This applies to all frameworks, cold/warm start
- enabling SnapStart brings the greatest benefit for Spring Boot - almost x10 shorter cold start in few configurations. For Quarkus it is average x4 short and for Micronaut +/- x6
- for all frameworks with SnapStart enabled cold start comes close to pure Java cold start which is a fantastic result
- looking at the median graph, you can see that Quarkus had the shortest cold starts without SnapStart. On the other hand, with SnapStart enabled it performs worst
- SnapStart doesn't significantly affect warm start. It's hard to say if it has at all