On Jun 29, 2:39 pm, Mike Hearn <mh.in.engl...@gmail.com> wrote: > Could you elaborate on why one would implement a JIT instead of an AOT > compiler? I've wracked my brains and can't think of any situation, > ever, in which it makes sense to try and compile a statically typed > program on the fly when deadlines are strict rather than at install > time, when it's OK to take a few extra seconds to really optimize > deeply.
You have to store the compiled output somewhere. If you do a "df" on a G1 you'll see that we're up against the wall on /system and, if you have a modest number of apps installed, you probably don't have a lot of free space in /data. The bytecode expands by a factor of N, where the exact value of N depends on how good your compiler is and whether you're optimizing for speed or space (3-4x is somewhere in the ballpark). It also equates to a larger memory footprint at execution time, which means more paging overhead or fewer apps running concurrently. The net result is that we only want to compile the stuff that really needs to be compiled. With a JIT that's easy to figure out. For AOT you need profiling results from a "typical" run, where determining a typical run can be non-obvious. You're doing essentially the same work to get the profiling measurements for AOT and JIT, and need similar code for the compiler, so it just turns out to be easier to start with a JIT. For some of the core library stuff we can make a very good guess at what will get used a lot and what won't, so AOT is a good choice, but the potential speed bottlenecks in the framework are largely written in native code anyway. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---