Repository navigation
Commit bf46140
Settle the conditional targets before deriving the guards
createConditionalExpressions() derived a guard for every differing key, and
since the guard type became the branch set difference that costs a
TypeCombinator::remove() of the two branch types - the most expensive step of
a merge.
A guard is only ever consumed paired with a target: a different key in the
first target loop, any key in the second. So the targets are settled first
with the cheap checks, the merge returns early when no key can be one, and
the subtraction is skipped for a guard whose only possible target is its own
key, which the target loop unsets from its own guard set anyway. The first
target loop reuses the settled set instead of repeating the checks.
Analysing Slevomat: 603.1s -> 591.6s user CPU, with byte-identical output.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDqrN1pcN3qWc7xzKfkJaF1 parent b3547b6 commit bf46140
2 files changed
Lines changed: 108 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
381 | 417 | | |
382 | 418 | | |
383 | 419 | | |
| |||
441 | 477 | | |
442 | 478 | | |
443 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
444 | 486 | | |
445 | 487 | | |
446 | 488 | | |
| |||
476 | 518 | | |
477 | 519 | | |
478 | 520 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
| 521 | + | |
483 | 522 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | 523 | | |
494 | 524 | | |
495 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
479 | 532 | | |
480 | 533 | | |
481 | 534 | | |
| |||
587 | 640 | | |
588 | 641 | | |
589 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
590 | 649 | | |
591 | 650 | | |
592 | 651 | | |
| |||
641 | 700 | | |
642 | 701 | | |
643 | 702 | | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
648 | 708 | | |
649 | 709 | | |
650 | | - | |
| 710 | + | |
651 | 711 | | |
652 | 712 | | |
653 | 713 | | |
654 | 714 | | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | 715 | | |
671 | 716 | | |
672 | 717 | | |
| |||
0 commit comments