Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Python version #1

Closed
jokey2k opened this issue May 15, 2013 · 2 comments
Closed

Improve Python version #1

jokey2k opened this issue May 15, 2013 · 2 comments

Comments

@jokey2k
Copy link

jokey2k commented May 15, 2013

The python version you have is overly complex and slow as hell ;)

Better use this one:
https://bitbucket.org/brownan/pypy-tutorial/src/tip/example1.py

Might also want to include PyPy timing results in your output as well as a translated version with RPython.

@pablojorge
Copy link
Owner

Hi @jokey2k, yes, it's unnecessarily complex and slow! The idea was to make it "elegant", not fast, then I added other versions to compare them.

Anyway, I added a second version similar to that example, and one which is also similar but slightly modified so it can be translated with RPython. I added a new table at the end comparing all versions. What's surprising is that the RPython version of the interpreter is faster than the C version, even compiled with optimizations! Only the brainfuck programs translated to C and then compiled run faster than the RPython interpreter.

Thanks for your suggestions!

@jokey2k
Copy link
Author

jokey2k commented Sep 1, 2013

That's the big pro when you compile something with a tracing jit. If there are loops, things are heavily speeded up ;) You are right, that otherwise some handcrafted this might be faster. but then concerning time of development and ease of maintenance gives most credit ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants