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

Improve documentation of partial solution #294

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Dec 11, 2024

Improve the docstrings for the partial solution and rename some fields to be easier to understand.

Thanks to @Eh2406 for providing the context for these fields!

@konstin konstin requested a review from Eh2406 December 11, 2024 19:42
Copy link

codspeed-hq bot commented Dec 11, 2024

CodSpeed Performance Report

Merging #294 will degrade performances by 6.53%

Comparing konsti/dev/partial-solution-docs (9565eca) with dev (e9170cb)

Summary

❌ 1 (👁 1) regressions
✅ 5 untouched benchmarks

Benchmarks breakdown

Benchmark dev konsti/dev/partial-solution-docs Change
👁 sudoku-hard 3.9 ms 4.2 ms -6.53%

@konstin
Copy link
Member Author

konstin commented Dec 11, 2024

That's a dubious looking perf regression

src/internal/core.rs Outdated Show resolved Hide resolved
Comment on lines +33 to 34
/// The number of decisions that have been made, equal to the number of packages with decisions.
current_decision_level: DecisionLevel,
Copy link
Member

@zanieb zanieb Dec 11, 2024

Choose a reason for hiding this comment

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

"packages with decisions" being "packages with a decided version"?

Copy link
Member

Choose a reason for hiding this comment

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

yes

/// extract the solution, and to backtrack to a particular decision level. The
/// `AssignmentsIntersection` is always a `Decision`.
///
/// `[changed_this_decision_level..]`: Packages that are dependencies of some other package,
Copy link
Member

Choose a reason for hiding this comment

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

changed_this_decision_level looks removed?

@mpizenberg
Copy link
Member

That's a dubious looking perf regression

the only two structural changes are a tuple converted to a struct with field names, and another struct which has the order of its fields changed. Could it be byte alignement due to the new fields order?

@konstin
Copy link
Member Author

konstin commented Dec 12, 2024

I can't reproduce this locally, and definitely not in the 6% range:

sudoku-hard             time:   [564.46 µs 564.59 µs 564.72 µs]
                        change: [-0.6899% -0.3674% -0.0552%] (p = 0.02 < 0.05)
                        Change within noise threshold.
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  8 (8.00%) high severe

@Eh2406
Copy link
Member

Eh2406 commented Dec 18, 2024

Could it be byte alignement due to the new fields order?

Unless a structure is marked repr(c) rust is allowed to reorder the fields to best pack alignment. So it would be very odd if changing the definition order led to a significant difference in size. It could affect the order fields are dropped, or the implementation of Hash or Eq. I have seen the order effect Eq in such a way that performance changed, but I don't think that applies here.

Overall I am happy with this change, but leave final decision on wordsmithing questions to @mpizenberg.

Copy link
Member

@mpizenberg mpizenberg left a comment

Choose a reason for hiding this comment

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

It’s a clear improvement in my point of view. Thank you!

@konstin konstin force-pushed the konsti/dev/partial-solution-docs branch 2 times, most recently from 1e2fcc5 to 1c003c4 Compare December 18, 2024 11:23
konstin and others added 4 commits December 18, 2024 12:24
Improve the docstrings for the partial solution and rename some fields to be easier to understand.
Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: Zanie Blue <contact@zanie.dev>
@konstin konstin force-pushed the konsti/dev/partial-solution-docs branch from 1c003c4 to 9565eca Compare December 18, 2024 11:25
@konstin
Copy link
Member Author

konstin commented Dec 18, 2024

Had some trouble rebasing but i think everything is in.

@konstin konstin enabled auto-merge December 18, 2024 11:25
@konstin konstin added this pull request to the merge queue Dec 18, 2024
Merged via the queue into dev with commit ffef172 Dec 18, 2024
5 checks passed
@konstin konstin deleted the konsti/dev/partial-solution-docs branch December 18, 2024 11:28
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.

4 participants