-
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
It might be nice to represent Buffer.t using a record as opposed to a straight up bigstring. ex:
type bigstring = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
type t = { buf: bigstring; pos: int; len: int}In some simple benchmarks in the past i've noticed the sub operation to be a little faster for the record based representation, than using the sub operation from Bigarray.Array1.
┌─────────────────┬──────────┬─────────┬────────────┐
│ Name │ Time/Run │ mWd/Run │ Percentage │
├─────────────────┼──────────┼─────────┼────────────┤
│ Iovec │ 2.55ns │ 4.00w │ 10.96% │
│ Bigstringaf.sub │ 23.25ns │ 7.00w │ 100.00% │
└─────────────────┴──────────┴─────────┴────────────┘
Potentially relevent discussion: https://discuss.ocaml.org/t/hannes-mehnert-interview-about-mirageos-and-ocaml-by-evrone/5784/10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels