Commit d98495b
committed
module: Optimize RunModuleSplit().
This commit adds a level of indirection to the splits_ thread local
variable: instead of keeping an entire batch for each possible output
gate, we keep a pointer to a batch.
This makes RunModuleSplit() faster, because we avoid copying the whole
batch (we only use a pointer now).
This also fixes Issue #443, because now we're using ~64K of stack space
instead of ~2M.
I tried running `samples/acl` on my laptop before and after the change
and looking at how many packets are generated by source0:
| source0 burst | before (Mpps) | after (Mpps) |
| -------------:| -------------:| ------------:|
| 32 | 76.0 | 83.2 |
| 1 | 14.3 | 14.9 |1 parent 08b9a3a commit d98495b
2 files changed
Lines changed: 20 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
493 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
494 | 502 | | |
495 | 503 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | 504 | | |
500 | 505 | | |
501 | | - | |
| 506 | + | |
502 | 507 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
| 508 | + | |
508 | 509 | | |
509 | 510 | | |
510 | | - | |
| 511 | + | |
511 | 512 | | |
512 | 513 | | |
513 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
0 commit comments