Skip to content
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

Optimize write_natural_field #14

Open
emersion opened this issue May 11, 2018 · 0 comments
Open

Optimize write_natural_field #14

emersion opened this issue May 11, 2018 · 0 comments

Comments

@emersion
Copy link
Contributor

emersion commented May 11, 2018

The next perf bottleneck is write_natural_field. I thought byte_sequence was used in memory images, but it turns out this is used instead:

type byte_pattern_element = maybe byte
type byte_pattern = list byte_pattern_element

(* An element might have an address/offset, and it has some contents. *)
type element = <| startpos : maybe natural
                ; length   : maybe natural
                ; contents : byte_pattern
                |>

Is there a reason why we use maybe byte instead of byte here?

Since element is used 140 times in the whole codebase, replacing it with something else is possible but definitely not trivial.

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

No branches or pull requests

1 participant