[MODULE][SYSTEM/LESS] ART Optimization v2.0 [DISCONTINUED]

Which Compiler Filter did you like?

  • everything

    Votes: 219 44.6%
  • speed

    Votes: 171 34.8%
  • balanced

    Votes: 71 14.5%
  • space

    Votes: 6 1.2%
  • interpret-only

    Votes: 7 1.4%
  • verify-none

    Votes: 17 3.5%

  • Total voters
    491
Status
Not open for further replies.
Search This thread

veez21

Senior Member
Feb 22, 2016
2,172
2,751
Guess Where
Android Runtime Optimization
DISCONTINUED lol

Android Lollipop includes a new virtual machine called ART (Android Runtime.) ART uses AOT (ahead-of-time) compilation into native code, which performs better than JIT (just-in-time) compilation into bytecode. You can configure ART to perform this optimization in different ways. Android Lollipop includes the dex2oat tool for optimizing applications on deployment.

Compiler Filters
Since Lollipop, dex2oat takes a variety of --compiler-filter options to control how it compiles. Passing in a compiler filter flag for a particular app specifies how it’s pre-optimized. Here’s a description of each available option:
  • everything - compiles almost everything, excluding class initializers and some rare methods that are too large to be represented by the compiler’s internal representation.
  • speed - compiles most methods and maximizes runtime performance, which is the default option. ** default value on this module
  • balanced - attempts to get the best performance return on compilation investment.
  • space - compiles a limited number of methods, prioritizing storage space.
  • interpret-only - skips all compilation and relies on the interpreter to run code.
  • verify-none - special option that skips verification and compilation, should be used only for trusted system code.

This module sets a few dalvik.vm and pm.dexopt properties:
Code:
dalvik.vm.dex2oat-filter [B]**editable with the given compiler filters[/B]
dalvik.vm.image-dex2oat-filter
pm.dexopt.bg-dexopt
dalvik.vm.check-dex-sum
dalvik.vm.checkjni
dalvik.vm.usejit
dalvik.vm.heaptargetutilization
dalvik.vm.dex2oat-threads


Magisk Module (UI in Terminal Emulator)
How to use:

  1. Open Terminal Emulator
  2. Type su and then
    Code:
    art_magisk
  3. Then choose your filter

Non-Magisk (command line)
How to use:

Code:
ART Optimization by veez21
setfilter [--compiler-filter] [file]
    compiler filters:
	  everything
	  speed
	  balanced
	  space
	  interpret-only
	  verify-none
Ex:
Code:
setfilter everything
** this will find the file on common/default directories
Code:
setfilter everything /system/su.d/name.sh
** this will use the directory you entered, instead of the defaults



MORE INFORMATION ON THIS TOPIC HERE and here


UNIFIED INSTALLER IS PRESENT SINCE v1. IT INSTALLS IN A SPECIFIED ORDER (look below) . SO IF YOU DON'T HAVE MAGISK, YOU CAN STILL FLASH THE ZIP IN THE DOWNLOADS!

Order of Detection during Installation:
Code:
 > Magisk > Systemless SuperSU > System SuperSU > Init.d

AFTER FLASHING, FOR THE FIRST TIME, WIPE DALVIK/ART CACHE. THIS IS NEEDED FOR IT TO TAKE EFFECT. YOU DON'T HAVE TO WHEN UPDATING THOUGH

THAT'S WHY YOU HAVE TO CHANGE THE --compiler-filter IF YOU WANT MORE APP PERFORMANCE. speed BEING THE DEFAULT IN ROMS (IF THE DEV HAVEN'T CHANGED IT), YOU CAN CHANGE IT TO everything IF YOU WANT MORE PERFORMANCE (BUT COSTS MORE SPACE). IDEAL VALUE WOULD BE balanced IF YOU ASK ME. ;)

** This module can have problems with heavily modified OEM Roms (e.g. TouchWiz, MIUI). YOU HAVE BEEN WARNED. But this problem is inconsistent and just might work for you.
Read this Samsung ROM users: https://forum.xda-developers.com/showpost.php?p=72401085&postcount=594 ** possibly fixed on v1.3+

MOD Edit Links Removed Download here[/URL] or at Magisk Manager ** install in recovery
README and Changelogs
Uninstaller
Crash Fix
Source

Source (Magisk Repo)
MOD Edit Links Removed

DONATE? If you want to (ノ・ω・)ノ゙
 
Last edited by a moderator:

veez21

Senior Member
Feb 22, 2016
2,172
2,751
Guess Where
F.A.Q.

How to see if the changes are applied?
  • See Magisk log. ART Optimizations should be able to log there
  • Do this command and search for the properties given at the first post and if it there, it's working
    Code:
    su
    getprop | grep dalvik
Bootloop! Help me!
When in Magisk, RIL doesn't work, some apps crash, HELP!
  • Try flashing the crash fix. It might/might not work
Xposed not responding properly! Help me!
  • Can't do anything about it. Try wiping dalvik-cache, if that doesn't work uninstall the module
I don't use Magisk. How to can I use this?
  • Flash the zip at the OP. It installs to System if Magisk is not detected
I had some kind of trouble when using everything filter. Solution?
  • Try changing to speed. Several users have some trouble with everything too.
SuperSU + Magisk + This module is causing bootloop/some kind of problem. What do I do?
  • Uninstall the Magisk Module and install Non-Magisk instead
 
Last edited:

veez21

Senior Member
Feb 22, 2016
2,172
2,751
Guess Where
UPDATE TO v0.2!

Changelog:
- post-fs-data.sh and service.sh is additionally used to set properties
- fixed setting dalvik.vm.image-dex2oat-filter

Download
 
Last edited:
  • Like
Reactions: vhick

alroger

Senior Member
May 19, 2011
1,299
1,937
Deerfield Beach
It can be used in nougat. I don't know the result of using it in it but try testing it and tell me the results if there's any problem :)

Working fine on Nougat here.
I have a feeling that Plex (my media player) is MUCH snappier. And no, it hans't been updated lately.
Everything working... but I can't point a finger at anything else besides Plex.

Cheers! :D
 
  • Like
Reactions: niko60

rohitece06

Senior Member
Sep 14, 2010
977
139
If just edit system.prop with
dalvik.vm.dex2oat-filter=interpret-only
dalvik.vm.image-dex2oat-filter=speed

it should be work?
 

Tesla

Senior Member
Oct 15, 2012
1,152
570
i.imgur.com
Hello m8 o/
Can you provide more download links?

"SYSTEM NOTICE: We apologize for any issues loading the site. We are working on a solution right now. Thanks for the understanding."
"Invalid response from the server: 502"

So when i can download this file i 1. Flash it in Magisk? 2. Flash it in TWRP?
 

JERW28

Senior Member
Apr 22, 2015
117
46
Somewhere in.the U.S.A
Hello m8 o/
Can you provide more download links?

"SYSTEM NOTICE: We apologize for any issues loading the site. We are working on a solution right now. Thanks for the understanding."
"Invalid response from the server: 502"

So when i can download this file i 1. Flash it in Magisk? 2. Flash it in TWRP?
2.Flash in TWRP
According to the OP, the mod requires wiping delvik/cashe after flashing the mod to work.
 

Tesla

Senior Member
Oct 15, 2012
1,152
570
i.imgur.com
2.Flash in TWRP
According to the OP, the mod requires wiping delvik/cashe after flashing the mod to work.

:good:
Download works at the moment.

Edit: My phone (Note 4) is really fast as it is, but initial testing shows a bit faster launch of camera app.
Sure, it might be placebo. Hard to know just yet ;)
 
Last edited:

rignfool

Senior Member
Dec 8, 2010
5,010
2,734
The Poconos
Umm...

No... You've got this backwards...

Apps would launch slower... Not quicker... As your first boot is quicker... At least with the flags mentioned at the top of the post...

If you're looking for what would be faster app launch... You'd want to use the 'everything' flag as it builds a much larger cache file...

Sent from my Nexus 6 using Tapatalk
 

cafe-creme

Senior Member
Nov 1, 2012
341
468
Evian
Thanks for the development and module for Magisk.

The effect is contrary with a Note 7 (MM) ported for SM N9005.
Installation according to indications, the smartphone is slower when starting up another 20 seconds.
There is no problem or fc but identically android lag enormously.
Perhaps a problem with the management of the kernel, ram ... etc
I tried to modify the filters without success for me.

A little feedback.
Thank you :)
 

saturday_night

Senior Member
Sep 7, 2016
756
877
This module sounds very interesting, but i have one question that isnt so clear to me... Does it speed up the start of apps in general or is it just the first start of the system after wiping dalvik/cache?
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 92
    Android Runtime Optimization
    DISCONTINUED lol

    Android Lollipop includes a new virtual machine called ART (Android Runtime.) ART uses AOT (ahead-of-time) compilation into native code, which performs better than JIT (just-in-time) compilation into bytecode. You can configure ART to perform this optimization in different ways. Android Lollipop includes the dex2oat tool for optimizing applications on deployment.

    Compiler Filters
    Since Lollipop, dex2oat takes a variety of --compiler-filter options to control how it compiles. Passing in a compiler filter flag for a particular app specifies how it’s pre-optimized. Here’s a description of each available option:
    • everything - compiles almost everything, excluding class initializers and some rare methods that are too large to be represented by the compiler’s internal representation.
    • speed - compiles most methods and maximizes runtime performance, which is the default option. ** default value on this module
    • balanced - attempts to get the best performance return on compilation investment.
    • space - compiles a limited number of methods, prioritizing storage space.
    • interpret-only - skips all compilation and relies on the interpreter to run code.
    • verify-none - special option that skips verification and compilation, should be used only for trusted system code.

    This module sets a few dalvik.vm and pm.dexopt properties:
    Code:
    dalvik.vm.dex2oat-filter [B]**editable with the given compiler filters[/B]
    dalvik.vm.image-dex2oat-filter
    pm.dexopt.bg-dexopt
    dalvik.vm.check-dex-sum
    dalvik.vm.checkjni
    dalvik.vm.usejit
    dalvik.vm.heaptargetutilization
    dalvik.vm.dex2oat-threads


    Magisk Module (UI in Terminal Emulator)
    How to use:

    1. Open Terminal Emulator
    2. Type su and then
      Code:
      art_magisk
    3. Then choose your filter

    Non-Magisk (command line)
    How to use:

    Code:
    ART Optimization by veez21
    setfilter [--compiler-filter] [file]
        compiler filters:
    	  everything
    	  speed
    	  balanced
    	  space
    	  interpret-only
    	  verify-none
    Ex:
    Code:
    setfilter everything
    ** this will find the file on common/default directories
    Code:
    setfilter everything /system/su.d/name.sh
    ** this will use the directory you entered, instead of the defaults



    MORE INFORMATION ON THIS TOPIC HERE and here


    UNIFIED INSTALLER IS PRESENT SINCE v1. IT INSTALLS IN A SPECIFIED ORDER (look below) . SO IF YOU DON'T HAVE MAGISK, YOU CAN STILL FLASH THE ZIP IN THE DOWNLOADS!

    Order of Detection during Installation:
    Code:
     > Magisk > Systemless SuperSU > System SuperSU > Init.d

    AFTER FLASHING, FOR THE FIRST TIME, WIPE DALVIK/ART CACHE. THIS IS NEEDED FOR IT TO TAKE EFFECT. YOU DON'T HAVE TO WHEN UPDATING THOUGH

    THAT'S WHY YOU HAVE TO CHANGE THE --compiler-filter IF YOU WANT MORE APP PERFORMANCE. speed BEING THE DEFAULT IN ROMS (IF THE DEV HAVEN'T CHANGED IT), YOU CAN CHANGE IT TO everything IF YOU WANT MORE PERFORMANCE (BUT COSTS MORE SPACE). IDEAL VALUE WOULD BE balanced IF YOU ASK ME. ;)

    ** This module can have problems with heavily modified OEM Roms (e.g. TouchWiz, MIUI). YOU HAVE BEEN WARNED. But this problem is inconsistent and just might work for you.
    Read this Samsung ROM users: https://forum.xda-developers.com/showpost.php?p=72401085&postcount=594 ** possibly fixed on v1.3+

    MOD Edit Links Removed Download here[/URL] or at Magisk Manager ** install in recovery
    README and Changelogs
    Uninstaller
    Crash Fix
    Source

    Source (Magisk Repo)
    MOD Edit Links Removed

    DONATE? If you want to (ノ・ω・)ノ゙
    20
    F.A.Q.

    How to see if the changes are applied?
    • See Magisk log. ART Optimizations should be able to log there
    • Do this command and search for the properties given at the first post and if it there, it's working
      Code:
      su
      getprop | grep dalvik
    Bootloop! Help me!
    When in Magisk, RIL doesn't work, some apps crash, HELP!
    • Try flashing the crash fix. It might/might not work
    Xposed not responding properly! Help me!
    • Can't do anything about it. Try wiping dalvik-cache, if that doesn't work uninstall the module
    I don't use Magisk. How to can I use this?
    • Flash the zip at the OP. It installs to System if Magisk is not detected
    I had some kind of trouble when using everything filter. Solution?
    • Try changing to speed. Several users have some trouble with everything too.
    SuperSU + Magisk + This module is causing bootloop/some kind of problem. What do I do?
    • Uninstall the Magisk Module and install Non-Magisk instead
    20
    UPDATE TO v1.5!

    An update! Yay :D

    Changelog:
    * update-binary updated to support Magisk v13+
    * exit codes fixed
    * Future proofing
    * Other cosmetic changes

    Please download at Magisk Manager
    For non-magisk users, you can build it yourself at github (google it). It's pretty late here at ours

    You can donate here:
    https://forum.xda-developers.com/donatetome.php?u=7296895
    18
    Sorry but the module is discontinued

    The thing is ART is complicated. Modifying stuff in it could result in worse performance if not done correctly.
    I don't have the time and dedication to learn more about the subject and update this module.
    The thread will be closed soon.

    Thanks for the support. If you're interested in my other "stuff", join this telegram channel MOD Edit Links Removed :)
    18
    UPDATE TO v1.4.1!

    Changelog:
    • setfilter needs root access!
    • art_magisk needs root access!
    • Dynamic version comment for Non-Magisk!

    Download here (** if you had problems flashing the zip from this link, redownload again **)
    or at Magisk Manager