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.
The next perf bottleneck is
write_natural_field
. I thoughtbyte_sequence
was used in memory images, but it turns out this is used instead:Is there a reason why we use
maybe byte
instead ofbyte
here?Since
element
is used 140 times in the whole codebase, replacing it with something else is possible but definitely not trivial.