Android users are sure to enlighten. After some time thinking about this, Google has come up with a solution. The Runtime of Android will change. An app has to have a runtime environment for it to perform better. The problem of lagging is sure to be eradicated by following this method.
The below image shows the architecture of the Android OS. It features four tiers of work (from the bottom up). The first tier is the Kernel. The kernel consists of the core information that the app needs to have for running properly and without crashing. This consists of the driver such as for Camera, Audio,etc. which has to load on startup or boot. The next layer consists of the libraries. These are packages which are already coded and are to be included for a very smooth operation. These include some technologies like OpenGL, CSS, etc. This is where the app gets processed. If you happened to have rooted your phone, and installed Root Explorer, you can go into that file explorer to explore your root drive.
In the app folder you’ll see that all apps are listed as com.processname.apk. The generation of this filename is due to these libraries. In libraries itself, you can see the Runtime environment. This is the main for application startup. Android uses JIT (Just-in-Time) method of Runtime in which the application will load in the Dalvik cache and only when the application is active will all the processes load ie. all the processes will load at that particular time. So it might use most of your CPU and the CPU scheduling will be heavy. Thus you may feel a lag in your Android device. Google has come up with a solution. It now uses ART processing- introducing from KitKat (4.4).
The ART type uses an AOT (Ahead of time) which replaces the Dalvik cache and is said to make the device faster and use less battery when compared to JIT processing. The Runtime environment are interchangeable as seen in the images above. These improvements are to make sure Android devices will never be the same again!!