• K
    Async compiler processing (#3043) · d9ff4ecc
    Kitson Kelly 提交于
    Basically this does pre-processing of TypeScript files and gathers all the
    dependencies asynchronously. Only then after all the dependencies are gathered,
    does it do a compile, which at that point all the dependencies are cached in
    memory in the compiler, so with the exception of the hard coded assets, there
    are no ops during the compilation.
    
    Because op_fetch_source_files is now handled asynchronously in the runtime, we
    can eliminate the tokio_util::block_on() which was causing the increase in
    threads. Benchmarking on my machine has shown about a 5% improvement in speed
    when dealing with compiling TypeScript. Still a long way to go, but an
    improvement.
    
    In theory the module name resolution and the fetching of the source files could
    be broken out as two different ops. This would prevent situations of sending the
    full source file all the time when actually the module is the same module
    referenced by multiple modules, but that could be done subsequently to this.
    d9ff4ecc
compiler.rs 2.5 KB