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

merge: micro-optimize Merge, clean up constructors #2538

Merged
merged 7 commits into from
Nov 7, 2023

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Nov 7, 2023

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

lib/src/merge.rs Outdated Show resolved Hide resolved
cli/src/merge_tools/builtin.rs Show resolved Hide resolved
yuja added 7 commits November 7, 2023 16:34
It's super common that a Merge object holds a resolved value, so let's inline
up to 1 element. T of Merge<T> usually consists of a couple of pointer-sized
fields. I don't see any measurable speed up, but it's no worse than the
original.
Also migrated some callers of 3-way merge, where [left, base, right] order
looks okay.
We no longer need to iterate removes and adds separately.
This is basically the same change as the previous commit.
Since (removes, adds) pair is no longer the canonical representation of Merge,
the name Merge::new() seems too generic. Let's give more verbose name.
@yuja yuja force-pushed the push-nnwtrrustpwr branch from a19b3a0 to 634e409 Compare November 7, 2023 07:42
@yuja yuja merged commit d1b0c4c into jj-vcs:main Nov 7, 2023
15 checks passed
@yuja yuja deleted the push-nnwtrrustpwr branch November 7, 2023 08:10
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

Successfully merging this pull request may close these issues.

2 participants