Commit 5bc95de
authored
Rollup merge of rust-lang#57043 - ssomers:master, r=alexcrichton
Fix poor worst case performance of set intersection
Specifically, intersection of asymmetrically sized sets when the large set is on the left. See also the [latest answer on stackoverflow](https://stackoverflow.com/questions/35439376/python-set-intersection-is-faster-then-rust-hashset-intersection).
Also applied to the union member, where the effect is much less but still measurable.
Formatted the changed code only, does not increase the error count reported by tidy check, and tried to adhere to the spirit of the unit tests.1 file changed
+60
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | | - | |
415 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
416 | 423 | | |
417 | 424 | | |
418 | 425 | | |
| |||
436 | 443 | | |
437 | 444 | | |
438 | 445 | | |
439 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
440 | 455 | | |
441 | 456 | | |
442 | 457 | | |
| |||
584 | 599 | | |
585 | 600 | | |
586 | 601 | | |
587 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
588 | 607 | | |
589 | 608 | | |
590 | 609 | | |
| |||
1494 | 1513 | | |
1495 | 1514 | | |
1496 | 1515 | | |
| 1516 | + | |
1497 | 1517 | | |
1498 | 1518 | | |
1499 | 1519 | | |
| |||
1518 | 1538 | | |
1519 | 1539 | | |
1520 | 1540 | | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
1521 | 1557 | | |
1522 | 1558 | | |
1523 | 1559 | | |
| |||
1573 | 1609 | | |
1574 | 1610 | | |
1575 | 1611 | | |
| 1612 | + | |
| 1613 | + | |
1576 | 1614 | | |
1577 | 1615 | | |
1578 | 1616 | | |
1579 | | - | |
1580 | | - | |
1581 | 1617 | | |
1582 | 1618 | | |
1583 | 1619 | | |
| |||
1597 | 1633 | | |
1598 | 1634 | | |
1599 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1600 | 1653 | | |
1601 | 1654 | | |
1602 | 1655 | | |
| |||
0 commit comments