Ticket #261 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.
