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

Compiler Backend: Explanation of test timings do not follow the actual numbers #3674

Open
jaisw7 opened this issue Mar 9, 2024 · 0 comments

Comments

@jaisw7
Copy link

jaisw7 commented Mar 9, 2024

Source: Compiler Backend

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%

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

Offending statement

shortest running time comes from the small conditional pattern match

However Time/Run suggests that

shortest running time comes from the large monomorphic pattern match

It's counter-intuitive. We expect that the small conditional pattern match should be faster. But, quantitatively speaking, the jump tables are faster at least for this benchmark.

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