Ticket #261 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

tcpprep O(N^2) lookup in add_cache, easy fix

Reported by: don@… Owned by: aturner
Priority: medium Milestone: 3.2.1
Component: tcpprep Version: 3.2.0
Keywords: Cc: don@…
Operating System: Add to FAQ?: no
Hardware: All
Output of tcpreplay -V: tcpprep version: 3.2.0 (build 1902) Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net> Cache file supported: 04 Not compiled with libnet. Compiled against libpcap: 0.9.4 64 bit packet counters: enabled Verbose printing via tcpdump: enabled

Description

On large captures tcpprep takes a huge amount of time. On a 60GB capture this took many hours to complete.

The culprit is in cache.c:add_cache. It does a lookup to the end of the linked list each time to find the end.

Simply making the lastcache pointer static or keeping a link to the last entry will solve this problem.

Change History

Changed 2 years ago by aturner

  • status changed from new to assigned
  • milestone set to 3.3

Changed 2 years ago by aturner

  • status changed from assigned to closed
  • resolution set to fixed

(In [1907]) Fix major performance issue with very large pcap's. Takes ~10min vs hours for 60GB according to one report. fixes #261

Changed 2 years ago by aturner

  • milestone changed from 3.3 to 3.2.1
Note: See TracTickets for help on using tickets.