Repository navigation
Commit d05c186
committed
perf(metadata-protocol): share a root property's reference-site walk within one derivation
Adding object_extension made deriveReferenceSites() walk the FieldSchema
record and the validation-rule array a second time: object and
object_extension declare the same `fields` and `validations`, and the
`validations` walk alone is most of a type's cost. The derivation test's
5s budget went red in CI (5532ms).
A root property's walk now runs once per derivation for every source type
declaring the same property, and later types replay its bindings. The key
is the property's schema less its prose (string `description`/`title`,
which no step reads), its trail and the root's `$defs`. The cache lives in
one derivation, so two calls still agree; the index equals the uncached
walk's exactly, and against main it adds only object_extension's four
sites (field, fields, object, picklist).
Measured, ms per derivation, 6 runs per round, shared box:
- main: 431 423 425 462 535 473 / 407 422 396 461 377 380
- head before: 680 875 865 783 759 603 / 666 664 726 674 698 853
- head after: 447 473 408 482 379 373 / 415 401 390 420 413 381
- main, same session as "after": 416 402 377 417 369 380 / 477 571 401 424 419 402
No timeout changed and no test skipped.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ccfa089 commit d05c186
1 file changed
Lines changed: 58 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
538 | 545 | | |
539 | 546 | | |
540 | 547 | | |
| |||
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| 558 | + | |
551 | 559 | | |
552 | 560 | | |
553 | 561 | | |
554 | 562 | | |
555 | | - | |
| 563 | + | |
| 564 | + | |
556 | 565 | | |
557 | 566 | | |
558 | 567 | | |
| |||
562 | 571 | | |
563 | 572 | | |
564 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
565 | 608 | | |
566 | 609 | | |
567 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
568 | 623 | | |
569 | 624 | | |
570 | 625 | | |
| |||
586 | 641 | | |
587 | 642 | | |
588 | 643 | | |
| 644 | + | |
589 | 645 | | |
590 | 646 | | |
591 | 647 | | |
| |||
601 | 657 | | |
602 | 658 | | |
603 | 659 | | |
604 | | - | |
| 660 | + | |
605 | 661 | | |
606 | 662 | | |
607 | 663 | | |
| |||
0 commit comments