I know this is kind of generic, but it applies to all code.
C++ has a reputation to be pretty slow. One reason is due to it having a garbage collector. This uses much more memory (ram). Rust, however, does not have this resulting in faster code.