Skip to content

Remove unnecessary no_ov arguments from IntDomTuple#2020

Open
sim642 wants to merge 5 commits intomasterfrom
intdomain-no_ov
Open

Remove unnecessary no_ov arguments from IntDomTuple#2020
sim642 wants to merge 5 commits intomasterfrom
intdomain-no_ov

Conversation

@sim642
Copy link
Copy Markdown
Member

@sim642 sim642 commented May 6, 2026

From rsync profiling I noticed some time being spent on currying and uncurrying in IntDomTuple.opt_map2.
It may have been a convenient way to write that function but this back and forth is unnecessary and allocates a bunch of closures each time.

This PR replaces it with the existing GobOption.map2 which is implemented directly.
The only difference with opt_map2 was that it had the optional no_ov argument. But turns out this is almost always unused and can easily be worked around in the single use case.

I doubt this will make a significant difference for rsync though but I can try.

TODO

  • rsync

@sim642 sim642 added this to the v2.8.0 Clumsy Clurichaun milestone May 6, 2026
@sim642 sim642 self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 09:19
@sim642 sim642 added cleanup Refactoring, clean-up performance Analysis time, memory usage analyze-that labels May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes IntDomTuple option-combining helpers by removing the custom opt_map2 (which relied on curry/uncurry) and switching to the direct GobOption.map2 implementation, while also simplifying several polymorphic record function types by dropping the unused ?no_ov optional argument.

Changes:

  • Removed opt_map2 and replaced its usages with GobOption.map2 in tuple-wise mapping/projection helpers.
  • Simplified internal polymorphic function record types (poly2_pr, poly1, poly2) by removing the unused ?no_ov parameter.
  • Adjusted call sites accordingly (e.g., leq, join/meet/widen/narrow, comparisons, and overflow-checking map2ovc).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cdomain/value/cdomains/int/intDomTuple.ml Outdated
Copilot AI review requested due to automatic review settings May 7, 2026 12:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/cdomain/value/cdomains/int/intDomTuple.ml
Comment thread src/cdomain/value/cdomains/int/intDomTuple.ml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyze-that cleanup Refactoring, clean-up performance Analysis time, memory usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants