diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-22 02:37:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-22 02:37:32 +0000 |
commit | d231102428a43bef635801718838aa406719e5a0 (patch) | |
tree | cfc840aaaf94e1810b5dcb466df6b6f654880303 /packet-range.c | |
parent | 775574779792219dd62e5a677755589737bc7984 (diff) |
Note that packet_range_calc() and packet_range_calc_user() can be
painfully slow with a large capture.
svn path=/trunk/; revision=42763
Diffstat (limited to 'packet-range.c')
-rw-r--r-- | packet-range.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/packet-range.c b/packet-range.c index 6e0e49fd54..8a70b0ee89 100644 --- a/packet-range.c +++ b/packet-range.c @@ -72,10 +72,16 @@ static void packet_range_calc(packet_range_t *range) { range->displayed_ignored_mark_range_cnt = 0L; range->displayed_ignored_user_range_cnt = 0L; - /* This doesn't work unless you have a full set of frame_data + /* XXX - this doesn't work unless you have a full set of frame_data * structures for all packets in the capture, which is not, * for example, the case when TShark is doing a one-pass * read of a file or a live capture. + * + * It's also horribly slow on large captures, causing it to + * take a long time for the Save As dialog to pop up, for + * example. We should really keep these statistics in + * the capture_file structure, updating them whenever we + * filter the display, etc.. */ if (cfile.frames != NULL) { /* The next for-loop is used to obtain the amount of packets @@ -181,10 +187,24 @@ static void packet_range_calc_user(packet_range_t *range) { range->displayed_user_range_cnt = 0L; range->displayed_ignored_user_range_cnt = 0L; - /* This doesn't work unless you have a full set of frame_data + /* XXX - this doesn't work unless you have a full set of frame_data * structures for all packets in the capture, which is not, * for example, the case when TShark is doing a one-pass * read of a file or a live capture. + * + * It's also horribly slow on large captures, causing it to + * take a long time for the Save As dialog to pop up, for + * example. This obviously can't be kept in the capture_file + * structure and recalculated whenever we filter the display + * or mark frames as ignored, as the results of this depend + * on what the user specifies. In some cases, limiting the + * frame_data structures at which we look to the ones specified + * by the user might help, but if most of the frames are in + * the range, that won't help. In that case, if we could + * examine the *complement* of the range, and *subtract* them + * from the statistics for the capture as a whole, that might + * help, but if the user specified about *half* the packets in + * the range, that won't help, either. */ if (cfile.frames != NULL) { for(framenum = 1; framenum <= cfile.count; framenum++) { |