You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dune exec -- ./bench_patterns.exe -ascii -quota 0.25
Estimated testing time 750ms (3 benchmarks x 250ms). Change using '-quota'.
Name Time/Run Percentage
--------------------------- ---------- ------------
Monomorphic large pattern 6.54ns 67.89%
Monomorphic small pattern 9.63ns 100.00%
Polymorphic large pattern 9.63ns 99.97%
According to these results:
The monomorphic large pattern ( type t = | Alice | Bob | Charlie | David is the fastest pattern).
Next fastest is the Polymorphic large pattern ( type t = | `Alice | `Bob | `Charlie | `David ) (See percentage to confirm)
Slowest is the Monomorphic small pattern ( type t = | Alice | Bob ).
This is contrary to what is expressed in the text of the book:
These results confirm the performance hypothesis that we obtained earlier by inspecting the lambda code. The shortest running time comes from the small conditional pattern match, and polymorphic variant pattern matching is the slowest. There isn’t a hugely significant difference in these examples, but you can use the same techniques to peer into the innards of your own source code and narrow down any performance hotspots.
The text was updated successfully, but these errors were encountered:
In https://dev.realworldocaml.org/compiler-backend.html we have the following results (text reproduced as-is from rwo chapter):
According to these results:
type t = | Alice | Bob | Charlie | David
is the fastest pattern).type t = | `Alice | `Bob | `Charlie | `David
) (See percentage to confirm)type t = | Alice | Bob
).This is contrary to what is expressed in the text of the book:
The text was updated successfully, but these errors were encountered: