Hacker News new | ask | show | jobs
Show HN: CSP Benchmarks – Go vs. core.async (Clojure) vs. libgoc (C) (github.com)
2 points by divs1210 58 days ago
Hi, HN!

Author of libgoc here.

I made a CSP library in C along with async I/O and HTTP client/server layers.

It is blazing fast, beating Go and Clojure at several benchmarks.

The library is stable, and has an extensive test suite.

I have several optimizations and features planned, all logged as issues in the github repo.

libgoc currently uses void* extensively and is ducktyped, but this will eventually change when STC generics will be integrated.

Two most important features are:

- it provides cross-platform cooperative threads (goroutines / virtual threads / fibers) in C

- it exposes a very user friendly async I/O C interface to libuv

I'll be happy to answer questions!

2 comments

This is very cool, glad to see it! I couldn’t figure out which version of the JVM you used for the core.async tests? Also, you are using old versions of both Clojure and core.async which have both had optimizations in the last year that should help all of these. Some of these tests may also be helped by using io-thread (with JVM virtual threads) instead of go in latest core.async.
Hi, Alex!

Happy you find it cool!

I will update the Clojure and core.async versions to latest.

You're right I forgot to mention the JVM version in the benchmarks.

I'll be running fresh benchmarks once the current task I'm working on is done.

I will have to look into io-thread, not familiar with it.

Although my aim with the benchmarks is to have nearly identical code for all platforms without any platform-specific optimizations - I'm not sure yet how io-thread plays into that.

Will definitely add the JVM version and update Clojure dependencies and let you know when I have fresh benchmarks.

I did something similar on CSP, it was pure hell.