Javability (Java, Zaurus, Linux, Live) by Jean-Marc Autexier, Saarland/Germany
cat /dev/www | egrep 'Java|Linux|Zaurus|ITnews|Live' > blog

21.9.04 13:58 JNetstream Performance ( , , , )

Yesterday I wrote a small application which read the first and last timestamp of a pcap file. For this, I used the Jnetstream library. The library is probably completely oversized for what I want to do, but it includes pcap file read which is what I mainly need.

My program (don't have it completely in mind) looks like this:

Decoder dec = new Decoder(pcapFile)
Packet first = dec.nextPacket();
Packet act;
Packet last;
while ( (act = dec.nextPacket() != null)
last = act;
System.out.println(first.getProperty("timestamp"));
System.out.println(last.getProperty("timestamp"));


The program did what it is supposed to do, but the performance was very bad. It took 2,5 seconds to parse a 61kb file (-> nearly 121 hours for a 1 GiB file). I don't know

Maybe I did something wrong and there is a faster method. I will try to investigate on it, if not I will have to implement my own FastPcapReader (help is welcome).

posted by Jean-Marc Autexier | 0 comments | Permalink | Send to Friends | Google it!
Subscribe

Locations of visitors to this page
selected blogs
ressources
Security
Unsorted
Fun
Free&Open Software
archives
This is a personal web page. Things said here do not represent the position of my employer.
RSS icons by: FastIcon.com