3 ms·
Any idea where the slowness is coming from?
by andai 4y ago
Any idea where the slowness is coming from?
- intrepidhero 4y agoI've been playing with making a rust interpreter and reading other people's work. Here's an interesting blog post (not mine) on making a interpreter in rust match the speed of a c implementation. It seems folks often have to resort to unsafe rust to get the performance they want. I don't claim to fully understand that and am looking for more information myself. http://www.dannyvankooten.com/blog/2022/rewriting-interpreter-rust/ http://www.dannyvankooten.com/blog/2022/rewriting-interprete...
- xiphias2 4y agoWith webservers we already saw that the way to make new things fast in Rust is to use lots of unsafe Rust when needed, optimize the code, and after that think about the right abstractions that minimize the unsafe code surface.
- tinco 4y agoWell there's no production class garbage collector in Rust yet, so in RustPython they're just using Rc's I think. That's one place to start. The other will probably be the quality of the JIT.
- youknowone 4y agoRustPython didn't adapt the optimization designs yet. One of the current major goal is this optimization: https://github.com/RustPython/RustPython/issues/3244 https://github.com/RustPython/RustPython/issues/3244 RustPython even cannot run `1+1` without calling `int.__add__` yet. And it is working on https://github.com/RustPython/RustPython/pull/4615 https://github.com/RustPython/RustPython/pull/4615 So it still has long way to go not C vs Rust but from the design level.