Concurrency comparison node, go and V #25175
jorgeluismireles
started this conversation in
Ideas
Replies: 3 comments 4 replies
-
Java 21 (Threads and SynchronousQueue) is 2-3 times faster than V 0.4.11 ![]() |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hopefully, you're compiling the V code with At any rate, V is still a Beta level language. Very little work has been put into optimization, except allowing for the C compiler to do what it can. |
Beta Was this translation helpful? Give feedback.
4 replies
-
Rust 1.89.0 (async_std) is fast: |
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
Uh oh!
There was an error while loading. Please reload this page.
-
After issue #25130 and benchmark I wanted to know where the time is spent calculating primes in node, go and V by using a lot of channels, threads or equivalent.
I found V's spawn using linux pthreads is relatively slow but also the channels synch accounts in the overall time. Next images worth than thousand words show the times (log) expected to get a new prime as blue bars and the times creating a new thread to participate calculating more primes as green bars.
First graph is node's, second go's and third V's:
The total time is around the sum of all blue and green bars.
With such strategies, V can't compute in my system to say 5000 primes because the memory exhausts.
We could argue V's green time (pthreads) could be reduced once coroutines (photon library) works with current channels. But I think V channels themselves synch is an important issue to revise if we want the go/node speed. For instance, node blue times grows gently as if there is a control inside while go's blue times shows interesting patterns alternating times as a comb. V's blue times looks chaotic.
More details here with larger images.
Beta Was this translation helpful? Give feedback.
All reactions