02-20-2015, 06:14 AM
I know there's a shader cache (and a temporary texture cache). But has anyone experimented with AOT vs JIT and determined whether it would be feasible to cache native blocks.
(02-20-2015, 06:20 PM)degasus Wrote: [ -> ]What are the difference between AOT and JIT in your opinion? Especially for emulators?
(02-20-2015, 09:52 PM)degasus Wrote: [ -> ]I don't think so, our ppc jit is very fast so caching the native objects doesn't help much. But however we have issues because of shader comilation, but they are already stored on the disc.
(02-20-2015, 11:30 PM)Nintonito Wrote: [ -> ]Well in theory if you make a large enough cache, you could have an entire game's worth of code compiled and basically not need the JIT, and rely entirely on AOT-like behaviour to simply run an almost entirely native program.This is the common case while being ingame. Just on loading a new level, we start to jit the next blocks again.
(02-21-2015, 01:40 AM)Fiora Wrote: [ -> ]Dolphin's JIT is incredibly fast; the time spent in it is hard to measure with typical profiling tools because it's basically a rounding error. If you were using a vastly more heavyweight compiler, maybe it could be an issue?So the feeling I'm getting is that its a waste of time because the code won't be any faster, unless the CPU emulator was someone completely rewritten with a tracer in mind. Makes sense. I guess i sort of underestimated the speed of the existing JIT. Still, tracer JIT's are a wonderful concept, and I kinda wish we saw more of them (I personally would be willing to trade disk/ram space for a worthwhile speed up. Especially since I have all this RAM in my computer that never gets used.)
A tracing JIT definitely sounds like an interesting idea, but on a system that can arbitrarily swap out code in memory, the question of "what do I do to a trace when part of it gets invalidated" could be difficult. Plus, code size is already a big problem, and tracing JITs are known for that.
It's not impossible though; I do really like the idea of tracing as an approach. The first tracing JIT ever was actually for emulation/recompilation, not for compiling an existing language, despite the commonness of tracing JITs in Javascript and such today.