Conversation
AltGr
commented
Dec 17, 2025
- fast-path for string comparisons with the same pointer
- improvement of equality expansion for constant constructors
There was a problem hiding this comment.
Do you have a sense of how much speed gain we get thanks to that?
There was a problem hiding this comment.
For expand_op, we should gain a lot in code size (and thus compilation / interpretation time): the code generated is now linear in size instead of quadratic in the number of constructors, when considering only the constant constructors. That could be life-saving for the cases that caused problem with OCaml's 244 constructors limitation.
For the string comparison, Vincent reported performance issues on sets and it should alleviate them, but I haven't benched yet (from reading the code, the missing fast-path was the main difference between our function and the OCaml built-in comparison ; but the latter is also based on memcmp which we can't compete with)
5ae4207 to
d5bae83
Compare
It is no longer quadratic on constant constructors, using direct comparison.