[ANN] capnp-rpc 2.0

I’m pleased to announce the release of capnp-rpc 2.0, an OCaml implementation of the Cap’n Proto RPC specification.

If you haven’t used the library before, please see the documentation and tutorial. Cap’n Proto RPC aims to provide secure, efficient, typed communications between multiple parties.

The main change in this version is the switch from Lwt to Eio for concurrency. The echo benchmark is about 40% faster than before. This isn’t because Eio is actually that much faster than Lwt, but more because it has better profiling support so spotting problems was easier. See https://roscidus.com/blog/blog/2024/07/22/performance/ for an example:

There is a capnp-rpc-lwt compatibility package that provides the old Lwt API using the new Eio version, allowing libraries using the old API to be used in applications using the new code, without having to update everything at once.

To migrate to the new version (checking everything still works after each step):

  1. First, update to capnp-rpc 1.2.4 (this ensures you are using the newer mirage-crypto API, to get that migration out of the way first).
  2. Switch your application (that sets up the networking) to capnp-rpc-unix 2.0.
  3. Migrate client and server code away from capnp-rpc-lwt when convenient.

For more detailed instructions, see the changelog.

Here’s an example of the changes needed in the solver-service project:

10 Likes