How is Zig so fast? #313
mattheww95
started this conversation in
General
Replies: 1 comment
-
After going through the pull requests and re-running the bench marks. I see that the Zig entries are now marked unfaithful. However, I am still amazed by the performance of the code from various languages that have been brought together. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After running all of the benchmarks In WSL2 running Debian, It appears that Zig has come out on top with quite a large lead and I was wondering if anyone noticed a similar outcome? If so I was hoping someone could provide a potential explanation for how Zig is so much faster than both C code and assembly code. I have attached the top results below and repeated the benchmarks yet identified the same outcome. If I have misinterpreted the results, please let me know.
I was going through the Zig code for solution 3, but I am inexperienced when it comes to C languages and I am struggling to fully understand how this performance was achieved. I did notice a pre-generation step was included in their code, and was wondering if anything is being calculated at compile time as the Zig compilations took up quite a bit of disk space.
I want to believe that the language is just that fast, but the difference in performance between Zig and languages like C and Assembly just feels a bit off especially when going against the optimized code compilers like gcc produce.
Just in case it is relevant I am using an AMD 3900x and running Windows 10.
Beta Was this translation helpful? Give feedback.
All reactions