Commits
Click on a commit to change the comparison rangeOptimize array sorting with in-place operations
Changes to sort_array_unique():
- Sort Vec<Value> in-place by comparing &str references
- Eliminate Vec<String> allocation and N string copies
- Zero heap allocations vs 3+ allocations before
- Affects 11 fields: keywords, categories, libc, bundled deps, etc.
Changes to sort_paths_naturally():
- Pre-compute depth and lowercase once per string (not on every comparison)
- Eliminate O(N² log N) to_lowercase() calls during sorting
- Move Values instead of copying strings
- Reduce from 3+ Vec allocations to 1 Vec allocation
Performance impact:
- sort_array_unique: 100% reduction in allocations (3+ → 0)
- sort_paths_naturally: 66% reduction in allocations + ~1000x fewer temporary string allocations
- Both functions: Zero string copies (N → 0) Fix formatting with cargo fmt
- Remove trailing spaces before blank lines
- Format sort_unstable_by closure on one line