|You might have noticed that on the first launch after a system reboot (cold start), Java applications take longer to start than on subsequent launches (warm start). And even at their fastest, Java applications still take longer to start than similar native applications.|
Excelsior JET, a compliant Java SE 6 implementation (JVM) with an Ahead-Of-Time compiler and deployment toolkit, optimizes Java startup overhead:
- Pre-compilation to native code provides quick warm starts
- Implemented I/O optimizations minimize cold startup times
In either case, you may expect your optimized Java application to start twice as fast.
Java vs Native vs Optimized Java
The following startup time comparison includes different RSS feed readers: two native Windows applications (Feed-Demon and FeedReader) and one implemented in Java (RSSOwl). The latter was run on the standard JRE 1.6.0_20 and then compiled with Excelsior JET 7.2 Professional Edition/profile 1.6.0_20.
These applications were run on a mid-range laptop (dual-core ULV Intel Celeron SU2300, 2GB RAM), and their warm and cold startup times measured as the time to fully display the main window.
As you can see, the RSSOwl application optimized with Excelsior JET starts:
- 2x to 3x faster than on the JRE
- almost as fast as the similar native applications
- How it works?
Excelsior JET uses native (AOT) pre-compilation of Java bytecode to create optimized native, allowing Java applications to run directly on hardware from the very start. This removes JVM bootstrap overhead such as interpretation and JIT compilation.
In addition, Excelsior JET includes the Startup Optimization Toolkit, enabling the application developer to use profile-guided I/O optimizations prior to application deployment. These optimizations reduce the number of disk reads and make access to the application executable close to sequential, thus improving cold startup times.
For more details, see the "Startup time optimization" chapter in Excelsior JET User's Guide.
- How to use it?
- When it cannot help?
Some applications perform time-consuming actions on startup, such as opening a network connection. For these applications, the startup time is not bound to Java code execution nor to loading the application files from disk. As a result, the optimizations offered by Excelsior JET may have a small impact on the overall application startup time.
For applications that run off a USB Flash Drive or Solid State Drive, the effect of the startup time optimization is smaller compared to traditional hard drives. However, you may still expect a 1.5x startup time improvement for these applications.
Note: To achieve maximum effect of the startup optimization, follow the recommendations from the section "How to further reduce the startup time" of this Excelsior JET Knowledge Base article.