Jump to content
Excelsior Forums
ktsang

JIT cache is deprecated?

Recommended Posts

Hi All,

We want to enable code protection with our server applications and found excelsior jet is a good option.

We successfully build native version of our applications by excelsior jet and it's up and running in our testing environment.

Everything are okay but one of our application (with heavily used spring libraries) are found slow startup time due to many JIT compilation overhead. (Please see the attached log server_overhead.log)

The startup time of native version is around 6 minutes (mostly are spent on spring context loading, which actually spent time on JIT compile spring classes) vs non native version which is around 40 seconds.

To solve this issue, we try some optimized options (as below) about JIT cache but it doesn't work. It never create cache.
 

Quote

 

jet.jit.cache.dir

jet.jit.cache

 


After reading excelsior document, I learnt that JET static compiler sometimes cannot resolve dependencies.

In our case, we have ApplicationContext in our main class like this:

public class MyAppServer {

	@Autowired
	private ApplicationContext applicationContext;

	public MyAppServer() {
	}

	...
}

However, the JET is not able to resolve ApplicationContext at runtime and try to JIT compile at the beginning during startup

[JIT compiler] compile org.springframework.context.ApplicationContext
[JIT compiler] compilation finished in 15ms, classes: 1

Attached our excelsior prj file for your reference.

Please kindly advise. We have to build a native version of our applications which can run as fast as our non native version.

Regards,

Ken

server.prj

server_overhead.log

Share this post


Link to post
Share on other sites
Quote

To solve this issue, we try some optimized options (as below) about JIT cache but it doesn't work. It never create cache.

JIT caching was deprecated in version 8.0 of Excelsior JET and has been removed since.

As for excessive JIT compilation: 
Could you please try specifying all dependencies' jars as `!CLASSPATHENTRY` equations?
You can remove all `!module` equations as well as `-CLASSABSENCE=HANDLE` and `-IGNOREMEMBERABSENCE+` to see which dependencies are missing from compilation set.

Also, have you tried using our Maven or Gradle plugins and/or Jet Control Panel tool?

Best Regards,
Ivan Trepakov
Excelsior Support

Share this post


Link to post
Share on other sites
Quote

Could you please try specifying all dependencies' jars as `!CLASSPATHENTRY` equations?

We moved all spring related libraries to CLASSPATHENTRY, the absent class list look more normal.

However, we still got many JIT compilation logs like this. Your jvm is well handled CGLIB dynamic proxy but it generates huge overhead during spring context initialization.

The more spring beans we defined in our app, the more JIT comiler log entries. Please advise.

[JIT compiler] compile com.mycompany.myapp.service.config.AppCacheConfig$$EnhancerBySpringCGLIB$$24a5e149
[JIT compiler] compilation finished in 13ms, classes: 1
Quote

You can remove all `!module` equations as well as `-CLASSABSENCE=HANDLE` and `-IGNOREMEMBERABSENCE+` to see which dependencies are missing from compilation set.

The main reason we use  !module is to save external library build time. If everything are included in CLASSPATHENTRY, we required 3-4 hours for building one backend application.

What is the best approach to build native server side application by JET (my applications are with over 50-100 external library jar files and 20 internal module libraries)?

Our current approach is to pre-build all external libraries jar to share objects. In our prj file, we include .so file in !module and internal libraries in CLASSPATHENTRY.

Quote

Also, have you tried using our Maven or Gradle plugins and/or Jet Control Panel tool?

We tried Jet Control Panel but it is not fit for batch building 8-10 applications (with average 50-100 external libraries for each applications).

So we write a java program to generate one JET prj file for one application and use the following script to build.

../../../../jet12.0-eval-amd64/bin/jc =p /home/ken/ejet/release/1.1.6/script/my-server/my-server-1.1.6-SNAPSHOT.prj
cd ../../../../jet12.0-eval-amd64
source setenv
cd /home/ken/ejet/release/1.1.6/script/
xpack -source ../output/my-server -target ../output/packed/my-server-native
cd ..
ENDTIME=$(date +%s)
echo "Total Time for build my-server is $(($ENDTIME - $STARTTIME))s"


 

Share this post


Link to post
Share on other sites

Hi,

Can you please send us the whole log with JIT-compiled classes, as well as *.vaz file.

If you prefer, you can send them directly to our support contact via email: java@excelsior-usa.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×