perf: optimize the vector performance in favor of small_vector - #1437
perf: optimize the vector performance in favor of small_vector#1437c8ef wants to merge 1 commit into
Conversation
f6862e9 to
d4d97b6
Compare
|
Performance numbers from my laptop may not be very reliable. It is very much appreciated if someone can help me verify the result using the original mininet benchmark(simple_switch with thrift) on a more stable hardware. Still I don't think it will block merging since the cleanup is beneficial and I'm sure it will not have poorer performance. |
7ec8d6c to
3fc7d2a
Compare
Signed-off-by: c8ef <c8ef@outlook.com>
3fc7d2a to
a661e5a
Compare
|
Hmm, ideally we keep our boost footprint low. Does |
I think there are several reasons why small_vector is a better choice here:
|
|
I'm okay with these changes considering that we aren't importing anything totally new and it simplifies the code. @c8ef where did you get the benchmark values from? Is there a specific benchmark test that we are using? |
Mostly I am using the mininet benchmark: https://github.com/p4lang/behavioral-model/blob/main/docs/performance.md#running-the-benchmark But I am running a modified version since building simple_switch_grpc with bazel is much easier. So it is very much appreciated if someone can help me verify the result using the original mininet benchmark(simple_switch with thrift). |
|
I also have a question about performance tuning here. After applying this patch, I ran a perf profile using the benchmark. The results indicate that the application is not compute-bound; instead, most of the time is spent in libpcap, which internally calls send/recv. While this makes sense, it's not ideal for performance optimization. Are there any general guidelines or best practices for identifying the true hotspots in this type of application? |
I think this PR falls under both codebase modernization and performance optimization: