Commit a72a46f
committed
perf(v5): replace
Both used `Bytes::copy_from_slice`, which allocates a String and copies
its bytes into a second Bytes allocation before dropping the String.
Replace with `Bytes::from` to take ownership of the String's buffer
directly — same approach as the v4 Publish constructor — cutting the
topic allocation count from 2, down to 1 per publish.copy_from_slice in Publish::new and LastWill::new
1 parent 2167da0 commit a72a46f
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments