Four insertion sorts become four calls - #3
Merged
Merged
Conversation
twill 1.9.0's sort orders numbers as well as strings and takes a comparison, which is docs/needs.md entry 12. strutil.sort_strs goes straight through; manifest.sort_deps and lockfile.sort_entries order by compare_str on the name; resolve.sort_versions by semver.compare, because a version order is not a string order and 1.10.0 sorts after 1.9.0. The entry's complaint was not speed. Dependency lists are tens of entries and the quadratic cost was invisible. It was that four near-identical sorts differing only in the comparison are four places for the ordering a lockfile depends on to go wrong. The builtin is stable, so a re-rendered lockfile still produces no diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI installs v1.9.0 and spool.toml asks for ^1.9.0, because the sort this branch adopts is in that release and not in the one pinned before it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/needs.mdentry 12 closes. twill 1.9.0'ssortorders numbers as well as strings and takes a comparison:strutil.sort_strsgoes straight throughmanifest.sort_depsandlockfile.sort_entriesorder bycompare_stron the nameresolve.sort_versionsbysemver.compare, because a version order is not a string order and 1.10.0 sorts after 1.9.0 rather than before itThe entry's complaint was not speed. Dependency lists are tens of entries and the quadratic cost was invisible. It was that four near-identical sorts differing only in the comparison are four places for the ordering a lockfile depends on to go wrong.
The builtin is stable, so a re-rendered lockfile still produces no diff.
CI and
spool.tomlmove to 1.9.0 in the second commit. Six suites pass.🤖 Generated with Claude Code