It's really no different that just having a compiler, the only difference is that it compiles every time it needs to run the code as the code is loaded. It also caches the compiled code so it doesn't have to keep compiling it.
Any decent compiler on any modern platform should be able to compile a meg of JS that's already in memory in well under a quarter of a second. Once compiled it running so much faster more than makes up for the compile time in most cases and opens the door to compiler level speeds.
It's called JIT -- "Just in Time" -- compilation. Rather than distributing the binary you distribute the source and compile it when/as needed. Other than when the compilation occurs it's no different than any other language compilation in that regard.
As to optimization beforehand, I'm unware of it really doing anything noteworthy in that regard since JS itself really isn't optimal for that. It does not appear to be a multi-pass compiler, it has no intermediate bytecode stage, so I'm not quite sure where or what they'd be optimizing.
Jason Knight
The less code you use, the less there is to break
It's really no different that just having a compiler, the only difference is that it compiles every time it needs to run the code as the code is loaded. It also caches the compiled code so it doesn't have to keep compiling it.
Any decent compiler on any modern platform should be able to compile a meg of JS that's already in memory in well under a quarter of a second. Once compiled it running so much faster more than makes up for the compile time in most cases and opens the door to compiler level speeds.
It's called JIT -- "Just in Time" -- compilation. Rather than distributing the binary you distribute the source and compile it when/as needed. Other than when the compilation occurs it's no different than any other language compilation in that regard.
As to optimization beforehand, I'm unware of it really doing anything noteworthy in that regard since JS itself really isn't optimal for that. It does not appear to be a multi-pass compiler, it has no intermediate bytecode stage, so I'm not quite sure where or what they'd be optimizing.