Commit 96a7c9b
authored
[libc++] Simplify vector<bool> fill constructors (#160521)
#119632 introduced a code size and performance regression. This was
verified by running the included benchmark against trunk and trunk with
#119632 reverted. Instead of actually reverting that patch, we can
inline `__construct_at_end` into the few places it's used instead,
simplifying the implementation further (by not handling special cases we
never actually encounter).
```
Benchmark Baseline Candidate Difference % Difference
------------------------ ---------- ----------- ------------ --------------
BM_vector_bool_size_ctor 29.91 8.56 -21.35 -71.37
```1 parent 30402c7 commit 96a7c9b
File tree
2 files changed
+28
-19
lines changed- libcxx
- include/__vector
- test/benchmarks/containers/sequence
2 files changed
+28
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | 481 | | |
483 | 482 | | |
484 | 483 | | |
| |||
567 | 566 | | |
568 | 567 | | |
569 | 568 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 569 | | |
585 | 570 | | |
586 | 571 | | |
| |||
613 | 598 | | |
614 | 599 | | |
615 | 600 | | |
616 | | - | |
| 601 | + | |
| 602 | + | |
617 | 603 | | |
618 | 604 | | |
619 | 605 | | |
| |||
623 | 609 | | |
624 | 610 | | |
625 | 611 | | |
626 | | - | |
| 612 | + | |
| 613 | + | |
627 | 614 | | |
628 | 615 | | |
629 | 616 | | |
| |||
633 | 620 | | |
634 | 621 | | |
635 | 622 | | |
636 | | - | |
| 623 | + | |
| 624 | + | |
637 | 625 | | |
638 | 626 | | |
639 | 627 | | |
| |||
643 | 631 | | |
644 | 632 | | |
645 | 633 | | |
646 | | - | |
| 634 | + | |
| 635 | + | |
647 | 636 | | |
648 | 637 | | |
649 | 638 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments