Commit bd8ffe3
committed
https: optimize session cache property access
Cache frequently accessed properties in _cacheSession and _evictSession
methods to improve performance. This reduces the number of property
lookups in hot paths of HTTPS session caching.
Changes:
- _cacheSession: Cache map and list properties separately, avoiding
destructuring as suggested in review
- _evictSession: Only cache list property since map is accessed once
The optimization follows a similar pattern to other performance
improvements in the codebase by caching frequently accessed object
properties in local variables.
Benchmark results show 12-18% improvement in session cache operations:
https/https-session-cache.js n=10000 sessions=100: 18.2% improvement
https/https-session-cache.js n=10000 sessions=256: 12.7% improvement
Signed-off-by: jbj338033 <[email protected]>1 parent 3e79dba commit bd8ffe3
2 files changed
+57
-9
lines changed| 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 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
575 | 578 | | |
576 | | - | |
577 | | - | |
| 579 | + | |
| 580 | + | |
578 | 581 | | |
579 | 582 | | |
580 | 583 | | |
581 | 584 | | |
582 | | - | |
583 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
584 | 588 | | |
585 | | - | |
| 589 | + | |
586 | 590 | | |
587 | 591 | | |
588 | | - | |
589 | | - | |
| 592 | + | |
| 593 | + | |
590 | 594 | | |
591 | 595 | | |
592 | 596 | | |
593 | | - | |
| 597 | + | |
| 598 | + | |
594 | 599 | | |
595 | 600 | | |
596 | 601 | | |
597 | | - | |
| 602 | + | |
598 | 603 | | |
599 | 604 | | |
600 | 605 | | |
| |||
0 commit comments