@rleungx set up a basic benchmarking framework that uses Criterion.
By the middle of last week, we had a first iteration of the RPC system that we were happy with, and started using it to build out shared workspaces. To do that, we're adding replication to Xray's model objects. The goal is to be able to use model objects without worrying about whether or not they are remote or local.
We're converging on a design where most model objects are represented by a trait, with local and remote concrete implementations of this trait. For example, the project model has a Project
trait along with LocalProject
and RemoteProject
implementations. We also have an rpc::server::Service
implementation that has a shared reference to a LocalProject
and exposes it to a remote client. On the client side, the RemoteProject
owns a rpc::client::Service
object. When you call a method like open_buffer
on the client side, it's translated into a network request to a service on the remote peer, which translates the request to a method call on the corresponding LocalProject
.
We have unit tests passing for replication of file system trees and projects, along with the initial state for buffers. We still need to replicate buffer edits. We also have some work to do to refine our treatment of ownership for services on the server side. We think the best approach might be to enable both the client and the server to retain services. So if the server wants to keep a service alive and return it across multiple requests or updates, it can store off a handle to the service. Or it can drop the handle, in which case the client can take ownership over the service. Once the client drops, we'll communicate this fact across the wire and decrement the service's reference count. It's essentially an Rc
transmitted over the network. We'll see how it goes.
This week, @maxbrunsfeld will be diving in on integrating the Tree-sitter incremental parsing system into Xray. The first step involves some adjustments to the runtime to enable syntax trees to be fully persistent and sharable across threads. Xray's buffers already support this kind of usage, so including syntax trees will enable lots of interesting computations to be pushed into the background.
@as-cii and I are meeting up in Amsterdam this week to write as much code as possible together in person. To that end, I'm going to keep this update short so we can get to work.