-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a serialization library #45
Comments
I did some experimentation with Angstrom and my basic parser was an order of magnitude slower than Pgx's current code. I might try a little bit more experimentation with flambda. It's also awkward to write since OCaml doesn't have unsigned types, so we either need to use the |
We should probably look into how PG'OCaml and Postgres_async do serialization and see if we can come up with a base parser/serializer library that they could both theoretically use too. |
Nevermind, it looks like if we add Async overhead into account, Angstrom_async actually reads data more efficiently than Pgx does, which massively swamps the difference in parse speed:
I'll clean this up and put up a basic repo sometime soon. |
I started working on this here: https://github.com/brendanlong/ocaml-postgres-protocol |
Right now we serialize and deserialize very, very manually (reading and writing one byte at a time). We should see if we can replace that code with something like cstruct. This should make the code more readable, and also make it more efficient.
(I also looked into bitstring and faraday, but they seem lower-level and I don't know if we want that? Faraday is probably more efficient..)
The text was updated successfully, but these errors were encountered: