3 ms·
The other cool think about running in a JVM is those optimizations (I believe) are done at run-time -- a luxury that swift doesn't have.
by KingOfBrian 10y ago
The other cool think about running in a JVM is those optimizations (I believe) are done at run-time -- a luxury that swift doesn't have.
- pjmlp 10y agoSwift can also do it. This is what is called PGO, profile guided optimization. Basically you do several test runs using real use cases, under a profiler and then do a release build using the PGO gathered data as additional input.
- chrisseaton 10y agoYes they have to be done at runtime. In both cases the optimisation could become invalid if you load more classes, so the optimisation also needs to be reversible at runtime. This is an example of how it possible for a JIT to out-perform a static compiler.