Commit a8de3f0
perf(devices): add inline hints to hot-path helper functions
Add #[inline] attributes to small, frequently-called helper functions
in virtio device hot paths:
1. vsock_windows.rs:
- hdr_u16/u32/u64: Read header fields (called on every packet)
- set_u16/u32/u64: Write header fields (called on every response)
2. net_windows.rs:
- VirtioNetHdr::from_bytes: Parse header (called on every TX frame)
- VirtioNetHdr::to_bytes: Serialize header (called on every RX frame)
These functions are 1-3 lines and called in tight loops. Inlining
eliminates function call overhead and enables better optimization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e75e77b commit a8de3f0
2 files changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| 341 | + | |
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| 346 | + | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
347 | 350 | | |
| 351 | + | |
348 | 352 | | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| 356 | + | |
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| 361 | + | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
| |||
0 commit comments