Performance

Here are some unofficial performance numbers:

jNetPcap version 1.3b1
WinXP x86_32Description
73,410,000total packets processed
59,051packets per second
16.9usamount of processing time per packet in micro-seconds (10e-6)
260,111headers per second
3,845nsamount of processing time per header in nano-seconds (10e-9)

Spec: Intel Core Duo (2-core), WinXP Pro, 4GMb Memory, JRE 1.5.0_8
Setup: 7,341 different packets are loaded into a memory buffer from 15 different files found in tests directory for total of 22,030,069 bytes of data and processed 10,000 times each. The raw packets in memory are dispatched to JBufferHandler where their buffers are peered with a static packet object and scanned for headers.

My goal for next version of the decoder is to greatly increase these performance numbers. I am confident I can at minimum double these numbers with the new implementation. For one, peering is a lot more efficient. Second the decoder will implement what I call"cut-through" scanner where first few common headers are going to be processed without any function calls in the scanner. Kind of pre-processed as efficiently as possible in native code. That and number of other efficiency improvements should greatly increase the above performance numbers.