Skip to main content
Version: v21.11

Benchmarks

In order to benchmark the performance of PcapPlusPlus and compare it with similar C++ libraries we used Matias Fontanini's packet-capture-benchmarks project. The benchmark compared PcapPlusPlus, libtins, libcrafter and libpcap.

Tested projects

PcapPlusPlus was only compared to similar C/C++ projects such as libtins and libcrafter because projects written higher level languages (such as Python or Java) cannot compete with the performance of native libraries. The following versions were used for the benchmarks:

Testing environment

All 3 benchmarks provided in packet-capture-benchmarks were run on the following environment:

  • Linux Ubuntu 16.04 64-bit running as a VirtualBox VM with 4 virtual cores and 8GB RAM
  • GCC 5.4.0 compiler
  • The host platform is a MacBook Pro model 2017 with Intel Core i7 760 3.1GHz processor and 16GB RAM running MacOS High Sierra 10.13

Benchmark applications:

Test results

Benchmark #1 - TCP parsing

Results

PcapPlusPlus is ~10% faster than libtins and ~x28 faster than libcrafter

LibraryTime taken (seconds)Packets per second
libpcap0.124166666
PcapPlusPlus0.2192283105
libtins0.2412074688
libcrafter6.2679872
Loading Chart

Benchmark #2 - TCP + TCP Options parsing

Results

PcapPlusPlus is ~32% faster than libtins and ~x48 faster than libcrafter

LibraryTime taken (seconds)Packets per second
libpcap0.124166666
PcapPlusPlus0.2182293577
libtins0.2881736111
libcrafter10.56947308
Loading Chart

Benchmark #3 - DNS parsing

Results

PcapPlusPlus is ~5% faster than libtins and ~x29 faster than libcrafter

LibraryTime taken (seconds)Packets per second
libpcap0.02817857142
PcapPlusPlus0.2342136752
libtins0.2452040816
libcrafter6.79173626
Loading Chart