Skip to content

Commit

Permalink
made digest id generation more robust
Browse files Browse the repository at this point in the history
When allowing sharing, marshalling will produce different values for
structurally equal values depending on the way they were built. This
leads to unnecessary recomputations. This problem showed in an
unexpected setting: I was observing unnecessary recomputations when
switching from byte code compilation to native. I guess that due to
different code optimizations, value sharing was different in the two
cases.
  • Loading branch information
pveber committed Nov 27, 2020
1 parent c083d5e commit 9491a4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internals/workflow.ml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ and token =
and any = Any : _ t -> any

let digest x =
Digest.to_hex (Digest.string (Marshal.to_string x []))
Digest.to_hex (Digest.string (Marshal.(to_string x [No_sharing])))

let id : type s. s t -> string = function
| Input { id ; _ } -> id
Expand Down

0 comments on commit 9491a4d

Please sign in to comment.