Commit 9137c56
committed
module: add extra caching layer
This adds an extra modules caching layer that operates on the parent's
`path` property and the current require argument. That together can
be used as unique identifier to speed up loading the same module more
than once. It is a cache on top of the current modules cache.
It has the nice feature that this cache does not only work in the same
file but it works for the whole current directory. So if the same file
is loaded in any other file from the same directory, it will also hit
this cache instead of having to resolve the file again.
To keep it backwards compatible with the old modules cache, it detects
invalidation of that cache.1 parent 538f745 commit 9137c56
1 file changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
598 | 600 | | |
599 | 601 | | |
600 | 602 | | |
| 603 | + | |
601 | 604 | | |
602 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
603 | 619 | | |
604 | 620 | | |
605 | 621 | | |
606 | 622 | | |
607 | 623 | | |
608 | | - | |
| 624 | + | |
609 | 625 | | |
610 | 626 | | |
611 | 627 | | |
| |||
625 | 641 | | |
626 | 642 | | |
627 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
628 | 647 | | |
629 | 648 | | |
630 | 649 | | |
| |||
633 | 652 | | |
634 | 653 | | |
635 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
636 | 658 | | |
637 | 659 | | |
638 | 660 | | |
| |||
0 commit comments