Commit 62f2d3b
committed
Auto merge of #14318 - Eh2406:wrap_is_not_cheap, r=epage
dont call wrap in a no-op source_id::with*
### What does this PR try to resolve?
When running resolution in parallel (which my pubgrub tests do but cargo does not) there can be a lot of contention on the lock for constructing new `source_id`. When investigating much of this is due to `without_precise` in `encodable_package_id` in `check_duplicate_pkgs_in_lockfile`. There are many ways to solve this, the simplest seems to be to return `self` if the requested modification made no difference.
### How should we test and review this PR?
All tests still pass and it's an internal re-factor.
In addition running all crates on crates.io through cargoes resolver in parallel on 190 cores went from >20k sec cpu time to ~10k.
### Additional information1 file changed
+15
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
| 471 | + | |
475 | 472 | | |
476 | 473 | | |
477 | 474 | | |
478 | 475 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
| 476 | + | |
483 | 477 | | |
484 | 478 | | |
485 | 479 | | |
486 | 480 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 481 | + | |
491 | 482 | | |
492 | 483 | | |
493 | 484 | | |
494 | 485 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
499 | 498 | | |
500 | 499 | | |
501 | 500 | | |
| |||
0 commit comments