ABP Studio Goes AOT: Faster Startups with Ready-to-Run (R2R) Publishing

User Avatar
1 month ago, 708 views, 1 comments
Cover Image

We're excited that ABP Studio now supports Ready-to-Run (R2R) publishing (starting from v0.9.16+), a hybrid form of ahead-of-time (AOT) compilation. This enhancement significantly improves the startup time and overall performance of ABP Studio, making it faster and more performant than ever before.

Let's dive into what R2R publishing is, how it works, and the benefits it brings to ABP Studio.

What is Ready-to-Run (R2R) Publishing?

Ready-to-Run (R2R) is a form of AOT compilation available in the .NET ecosystem. Unlike traditional just-in-time (JIT) compilation, R2R precompiles parts of your application to native code before deployment. This precompiled code helps reduce the startup time by minimizing the work needed during runtime.

However, R2R isn't a complete AOT compilation. Instead, it's a hybrid approach because it stores both:

  • Native code for precompiled methods (to improve startup time and performance)

  • Intermediate Language (IL) code for methods that may need further JIT compilation

This hybrid nature is why R2R binaries are typically larger. For ABP Studio, the storage size increased by ~150 MB with R2R enabled, but the trade-off is well worth it for the performance and startup-time gains.

How R2R (Ready-to-Run) Improves ABP Studio

Faster Startup Time 🚀

One of the biggest advantages of R2R publishing is its impact on startup times. In our local tests, enabling R2R resulted in startup times being reduced by 2.5x ⬇️.

This means you can get to work faster, without waiting for the application to being startup from the beginning. Whether you're launching ABP Studio to manage projects, generate code, or deploy applications, the improved responsiveness is noticeable.

Performance Enhancements 📈

In addition to faster startups, R2R publishing contributes to overall performance improvements. By precompiling frequently used methods, R2R reduces the workload on the JIT compiler during execution, leading to smoother and more efficient operations.

Trade-offs: Increased Storage Size 🆙

With great performance comes a slight trade-off: storage size. R2R binaries include both native and IL code, which increases the file size. In the case of ABP Studio, the storage footprint increased by ~150 MB. However, the substantial improvements in speed and responsiveness make this a worthwhile investment.

How to Enable R2R Publishing in Your Applications?

If you're developing applications and want to benefit from R2R, here's a quick guide on how to enable it in your .NET projects:

  1. You can add the following configuration to your final project's .csproj file:
<PropertyGroup>
    <PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
  1. Then, publish your application with the dotnet publish command:
dotnet publish -c Release

Alternatively, you can specify the PublishReadyToRun flag directly to the dotnet publish command as follows:

dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true

That's it! Your application will now include precompiled native code for faster startup and great performance benefits.

Please refer to the official documentation before publishing your application with R2R.

Conclusion

As ABP team, we're always looking for ways to improve the developer experience. By adopting Ready-to-Run (R2R) publishing for ABP Studio, we're aiming to deliver a faster and more efficient tool for your development needs.

Stay tuned for more updates and enhancements as we continue to optimize ABP Studio and please provide us with your invaluable feedback.

1 comments

Leave Comment
User Avatar
berkansasmaz 1 month ago

Great improvement!

More From Engincanv

ABP.IO Platform 9.0 Has Been Released Based on .NET 9.0

Today, ABP 9.0 stable version has been released based on .NET 9.0. You can create solutions with ABP 9.0 starting from ABP Studio v0.9.11 or by usi... Continue Reading

EngincanV November 2024

ABP.IO Platform 9.0 RC Has Been Published

ABP 9.0 release candidate has been released today. Read the blog post to learn all new features in details. Continue Reading

EngincanV October 2024

ABP.IO Platform 8.3 Final Has Been Released

ABP 8.3 stable version has been released today. Read the blog post to learn all new features in details. Continue Reading

EngincanV September 2024

New ABP Documentation System: Everything You Need In One Place 📣

We have combined the ABP (open-source) and ABP Commercial (paid) documents into a single, comprehensive resource. This unification brings you a bet... Continue Reading

EngincanV August 2024

ABP.IO Platform 8.3 RC Has Been Published

Today, we are happy to release ABP version 8.3 RC (Release Candidate). This blog post introduces the new features and important changes in this new... Continue Reading

EngincanV August 2024

Introducing the New ABP CLI

📢 We're excited to introduce the new ABP CLI after the announcement of the new unified ABP Platform. Continue Reading

EngincanV July 2024

ABP.IO Platform 8.2 Final Has Been Released

ABP Framework and ABP Commercial 8.2 versions have been released today. Continue Reading

EngincanV June 2024

ABP.IO Platform 8.2 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 8.2 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV May 2024

ABP.IO Platform 8.1 Final Has Been Released

ABP Framework and ABP Commercial 8.1 versions have been released today. Continue Reading

EngincanV April 2024

ABP.IO Platform 8.1 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 8.1 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV February 2024

ABP.IO Platform 8.0 Has Been Released Based on .NET 8.0

Today, ABP Framework and ABP Commercial 8.0 versions have been released based on .NET 8.0. Continue Reading

EngincanV December 2023

ABP.IO Platform 8.0 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 8.0 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV November 2023

ABP.IO Platform 7.4 Final Has Been Released

ABP Framework and ABP Commercial 7.4 versions have been released today. Continue Reading

EngincanV October 2023

Unleash the Power of ABP CMS Kit: A Dynamic Content Showcase

We're excited to introduce to you ABP's CMS Kit Module – a versatile module that empowers you to build your own dynamic content website with ease. ... Continue Reading

EngincanV September 2023

ABP.IO Platform 7.4 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 7.4 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV August 2023

ABP.IO Platform 7.3 Final Has Been Released

ABP Framework and ABP Commercial 7.3 versions have been released today. Continue Reading

EngincanV July 2023

ABP.IO Platform 7.3 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 7.3 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV June 2023

ABP.IO Platform 7.2 Final Has Been Released

ABP Framework and ABP Commercial 7.2 versions have been released today. Continue Reading

EngincanV May 2023

ABP.IO Platform 7.2 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 7.2 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV April 2023

ABP.IO Platform 7.1 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 7.1 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV February 2023

ABP.IO Platform 7.0 Final Has Been Released

ABP Framework and ABP Commercial 7.0 versions have been released today. Continue Reading

EngincanV January 2023

ABP.IO Platform 7.0 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 7.0 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV November 2022

ABP.IO Platform 6.0 Final Has Been Released

ABP Framework and ABP Commercial 6.0 versions have been released today. Continue Reading

EngincanV October 2022

ABP.IO Platform 6.0 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 6.0 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV July 2022

ABP.IO Platform 5.3 Final Has Been Released

ABP Framework and ABP Commercial 5.3 versions have been released today. Continue Reading

EngincanV June 2022

ABP.IO Platform 5.3 RC Has Been Published

Today, we are happy to release the ABP Framework and ABP Commercial version 5.3 RC (Release Candidate). This blog post introduces the new features ... Continue Reading

EngincanV May 2022