Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by andai on Tuesday March 07, 2023 @01:32PM
(#35059150)
Any idea where the slowness is coming from?
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by intrepidhero on Tuesday March 07, 2023 @02:21PM
(#35059891)
I'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-interprete...
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by xiphias2 on Tuesday March 07, 2023 @03:06PM
(#35060462)
With 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.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by tinco on Tuesday March 07, 2023 @02:53PM
(#35060292)
Well 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.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by Yoric on Tuesday March 07, 2023 @04:28PM
(#35061514)
Does Python have a GC these days?
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by ketralnis on Tuesday March 07, 2023 @04:40PM
(#35061633)
It uses refcounting in the common case and then a second cycle-detecting GC for the less common cases
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by Yoric on Tuesday March 07, 2023 @06:00PM
(#35062550)
Ah, I forgot the cycle-detector.
Thanks!
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by youknowone on Tuesday March 07, 2023 @03:35PM
(#35060817)
RustPython didn't adapt the optimization designs yet. One of the current major goal is this optimization: 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
So it still has long way to go not C vs Rust but from the design level.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w...
by patrick451 on Wednesday March 08, 2023 @02:13AM
(#35066142)
This seems like a very optimistic take. For some reason, it made me think about spectre and heartbleed and how my computer just kept getting slower a couple years back.
Currently it's more about clarity and a nice clean code base, but it can only get faster from here