Rust: use lto
Python: use string operation than re