Commit fe5d57c
committed
perf(@angular/ssr): optimized request handling performance
This commit refactors request handling logic, leading to significant performance improvements.
**Benchmark**
| Metric | Before Optimization | After Optimization | Improvement |
|---------------|----------------------|----------------------|-------------|
| Latency (Avg) | 2655.35 ms | 2385.85 ms | ~10.1% |
| Latency (50%) | 2615 ms | 2416.33 ms | ~7.6% |
| Req/Sec (Avg) | 364.54 | 400.12 | ~9.8% |
| Bytes/Sec (Avg)| 7.7 MB | 8.45 MB | ~9.7% |
| Requests | 12k | 13k | ~8.3% |
| Errors | 10 (timeouts) | 0 | 100% |
**Test Details:**
* **Command:** `npx autocannon -c 100 -d 30 -p 10 http://localhost:<port>`
* **Parameters:**
* `-c 100`: 100 concurrent connections
* `-d 30`: 30 seconds duration
* `-p 10`: 10 pipelining factor
* **Iterations:** 3 tests were run before optimization, and 3 tests were run after optimization. Average of each set of tests was used for the comparison.
* **Samples:** 30 samples were collected per test run for Req/Bytes counts.
The optimized request handling logic (After Optimization) demonstrates substantial improvements across all key performance metrics compared to the original logic (Before Optimization). Latency is significantly reduced, request throughput (Req/Sec) and data transfer (Bytes/Sec) are increased, and all timeout errors have been eliminated. This indicates a more efficient and reliable request processing.1 parent 63428f3 commit fe5d57c
1 file changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
0 commit comments