ocaml-grpc icon indicating copy to clipboard operation
ocaml-grpc copied to clipboard

Reimplementation of the library

Open wokalski opened this issue 1 year ago • 11 comments

This PR contains a reimplementation of the library. Only the eio variant works for now. The goal of the reimplementation is to make it more:

  1. modular
  2. performant
  3. ergonomic

Building an opinionated workflow is not a part of this library, I will implement it in a separate library.

TODO

  • [ ] Refactor the lwt variant
  • [ ] Refactor the async variant
  • [ ] Depart from exposing ('a -> string) and (string -> 'a) (de)serializers and expose Bigstringaf directly to avoid copying. string variants can be put on top for those who need them simply in the userspace. The string variants impede the performance due to excessive copying.
  • [ ] Slight API modifications to reduce redundancy (headers probably don't need to contain the extra part for example)
  • [ ] Introduce 'ctx to server request handlers. Not sure if it's needed - maybe can be done in the user space, maybe has to be a part of the library - will experiment with it.

wokalski avatar Apr 16 '24 09:04 wokalski

@wokalski if you use ~~the OCaml 5.3 beta~~ OCaml 5.3 trunk (opam switch create 5.3.0+trunk) with https://github.com/janestreet/memtrace/pull/22 then you can do memory profiling with Eio.

Edit, got confused with my compiler versions.

tmcgilchrist avatar Apr 16 '24 23:04 tmcgilchrist

statmemprof ftw!!!

wokalski avatar Apr 17 '24 04:04 wokalski

@tmcgilchrist will statmemprof be available in 5.2 or only in 5.3?

wokalski avatar Apr 19 '24 14:04 wokalski

Only in 5.3. Based on this libraries dependencies it should be possible to build against that version. The problematic pieces are usually PPX and merlin/lsp.

tmcgilchrist avatar Apr 28 '24 22:04 tmcgilchrist

just a little update - we are using this on production and we will probably push the final commits to this soon.

wokalski avatar Oct 02 '24 07:10 wokalski