Replies: 6 comments 11 replies
-
What kind of "performance" benefit do you expect go gain? Have you gotten as far yet to see how much you've managed to squeeze out? 🤔 I mean to be honest, Go is pretty damn well near C enough that I find it hard to imagine you'd get much faster 😅 |
Beta Was this translation helpful? Give feedback.
-
So I finally managed to have a working C interpreter and the difference in performance are pretty huge. Here are the results of the benchmark running the same Fibonacci algorithm of 35 (as in the examples) on Apple M2: I think it's interesting to see how I managed to gain such performance (I did it by looking at Python 3.11 implementation and taking inspiration from the monkey-c-monkey-do project): |
Beta Was this translation helpful? Give feedback.
-
I finally managed to merge the C VM in the Tau repository so that I don't have to rewrite everything else. Additionally I've been working on some very hardcore optimisations in the C VM that produced astonishing results (these benchmarks have been conducted on an Intel i7 8700K with the same fibonacci recursive algorithm as last time): This means that C Tau runs 5.75 times faster than the Go implementation and 2.25 times faster than Python 3.10. |
Beta Was this translation helpful? Give feedback.
-
Btw... I hope you don't mind, But I'll probably end up forking tau and keep the Go versions going if you don't mind, mostly because I actually quite like it 👌 |
Beta Was this translation helpful? Give feedback.
-
Sorry to bring up an old topic 😅 But I actually find this type of problem kind of interesting. I tried to get my forked version of tau up-to-date (minus the C VM) and I think I got it "close enough" 🤣 Spent time time going through this discussion again and took a CPU profile of:
See attached CPU Profile output (SVG): I think we spend a lot of type in Also noted in my own research that Go actually uses a binary search for switch cases greater than 3? Anyway I don't think the switch vs. call table buys you too much as I noted that tengo is actually pretty damn fast! 😱
Looking through their implementation, they way they handle types is a bit different, otherwise that's the only significant difference I can see. |
Beta Was this translation helpful? Give feedback.
-
Also it is worth noting that compiling your version of tau now doesn't work very well on macOS :/ I spent a bit of time trying to get it to compile but gave up :( This is one of the downsides of C I guess 🤣 |
Beta Was this translation helpful? Give feedback.
-
Lately I've been working on an experimental interpreter written in C for Tau for performance reasons.
My hope is that with the C interpreter we can squeeze more performance and hopefully beat Python.
To have an idea of what would be the difference in speed between the two interpreters for the moment I'm implementing a subset of Tau enough for running the fibonacci example in this repo and thus compare the two speeds.
To check it out refer to CTau.
Ideas, contributions and suggestions are very welcome :D
Beta Was this translation helpful? Give feedback.
All reactions