Skip to content

remove Buf module, now that cstruct is mature#128

Closed
hannesm wants to merge 1 commit into
mirage:masterfrom
hannesm:no-buf
Closed

remove Buf module, now that cstruct is mature#128
hannesm wants to merge 1 commit into
mirage:masterfrom
hannesm:no-buf

Conversation

@hannesm
Copy link
Copy Markdown
Member

@hannesm hannesm commented Feb 12, 2017

@dsheets told me when Buf was written, cstruct was not yet in a mature state. There was no performance measurement of buf vs cstruct done.

Since I like less code more, this seemed to be a good excuse to read through ocaml-dns ;)

any opinions /cc @avsm @djs55 @dsheets @yomimono

Comment thread lib/protocol.ml
let marshal ?alloc q =
[q.Packet.id, Packet.marshal (Buf.create ?alloc 4096) q]
let marshal q =
[q.Packet.id, Packet.marshal (Cstruct.create 4096) q]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is ?alloc removed here? Is it no longer necessary for page-aligned allocations in Mirage on Xen?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good remark. at the moment (see mirage/mirage-net-xen#17), Mirage on Xen (in mirage-net-xen) copies the frame anyways to (half-page) aligned memory. no need for page aligned on kvm afaik.

this allows us to remove the entire allocation magic from ocaml-dns, and use Cstruct.create instead. I partially started this (by removing ?alloc parameters), but didn't finish (will do so soon). no io-page will be harmed by this change ;)

@hannesm hannesm mentioned this pull request Feb 24, 2017
@hannesm
Copy link
Copy Markdown
Member Author

hannesm commented Feb 24, 2017

superseeded by #132

@hannesm hannesm closed this Feb 24, 2017
@hannesm hannesm deleted the no-buf branch February 24, 2017 14:35
RyanGibb pushed a commit to RyanGibb/ocaml-dns that referenced this pull request Sep 26, 2022
As discussed in mirage#128, with the exception of bin_prot, camlzip, zlib-xen
and dolog.
RyanGibb pushed a commit to RyanGibb/ocaml-dns that referenced this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants