You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mako is a both I/O intensive and CPU intensive program, directly reading the source codes and writing outputs with std::fs will cause the main compile blocking.
fs read:
those long timing fs reads and fs stats are been invoked by mako::load::read_content and nodejs_resolver.
in mako::load::read_content, there is only a call of std::fs::read_to_end,maybe no better implements. The crate memmap2 is a choice, but also will leads to some risks.
a lots of invalid readlink and stat calls invoked by nodejs_resolver, why ?
fs write:
fs write is fast enough when building examples/with-antd, maybe no need to optimize. Not test on heavy project.
Hot build:
Still spends a lot of time on fs reads
Timing Profiler:
Too much Regex::new, is being solved by @PeachScript
System Trace:
Threads:
Threads are not well load balanced, a lot of blocking occurs
What's those tokio workers doing for?
Sys calls:
Those are spending on rayon and tokio threads.
Those are spending on mako::load::read_content and nodejs_resolver. About nodejs_resolver probleam, test it again after switch to oxc-resolver.
tree shaking 和 generate 在主线程中串行执行,在构建 example/with-antd 时,这两个阶段各占总耗时的 1/4
xusd320
changed the title
RFC: Too much blocking I/O maybe a performance bottleneck, we need to use async I/O
profile with xcode instruments
Mar 11, 2024
Problem
Mako is a both I/O intensive and CPU intensive program, directly reading the source codes and writing outputs with std::fs will cause the main compile blocking.
Analysis
TODO: Use tools like Xcode Instruments to track the I/O syscalls.
Solution
Let I/O and compiler run in individual thread pool.
The text was updated successfully, but these errors were encountered: