The zed editor has a custom rope implementation: https://github.com/zed-industries/zed/tree/main/crates/rope Would be cool to see a comparison of the performance! I don't think it has a builder API, but the rest seems to be available.