Single-pass compilers read and process the source code only once, performing all compilation stages in that single pass. Multi-pass compilers read the source code multiple times, each pass handling different stages.
Single-pass compilers typically use less memory because they do not need to store intermediate representations of the code for later passes. Multi-pass compilers store intermediate results between passes, which can increase memory usage.
Multi-pass compilers can perform more thorough and complex optimizations because they analyze the code multiple times, allowing them to gather more information and refine the output. Single-pass compilers have limited optimization capabilities due to processing the code only once.
Single-pass compilers tend to be faster because they process the source code in one go, while multi-pass compilers read the source code multiple times, which takes more time.
Embedded systems usually have limited memory and processing power. Single-pass compilers use less memory and compile faster, making them suitable for such environments. Multi-pass compilers, while capable of better optimization, require more resources and time.