Why is the JRuby app in App Engine taking so long (compared to the Python app)?

I am considering using JRuby in App Engine, but I heard that the Juby app in App Engine has a long launch delay and a Python application. Why is this?

Is it because JRuby jar files are so large that a cold start requires them to be loaded into memory before the application can start working? That would be my hunch, but I'm not sure if this is an exact technical explanation. And, if so, why is Python different?

+4
source share
2 answers

This is basically it. When your application has not been used after some time, App Engine will swap it until another request appears.

When this happens, it downloads all the JAR applications that your application requires, which can take a very long time, in some cases, 10-15 + seconds.

I have no experience with JRuby in particular, but this page contains some tips on how to reduce application startup time. Tips should be useful even if you are not strictly writing vanilla Java.

Basically, just don't include JARs in which your application is not heavily dependent.

+10
source

Disclaimer: I did not compare it myself

The difference between the version of Python and JRuby in particular is probably due to the fact that JRuby is a language implemented on top of another language. The Python engine, on the other hand, is native and much closer to CPython (some proprietary version of Odorless assimilation , I would suggest). This means that for Python, the interpreter is by definition already loaded, but for JRuby, your application must start by loading the Ruby interpreter before it can start with its application logic.

0
source

Source: https://habr.com/ru/post/1305580/


All Articles