Wireshark-dev: Re: [Wireshark-dev] Profiled dumpcap
From: Anders Broman <a.broman@xxxxxxxxxxxx>
Date: Thu, 08 May 2014 23:06:02 +0200
Guy Harris skrev 2014-05-08 22:29:
On May 8, 2014, at 1:02 PM, Anders Broman <a.broman@xxxxxxxxxxxx> wrote:

It might be worth it to reduce the number of write_to_file() by putting stuff in a buffer before writing to file.
write_to_file() calls fwrite(), which puts stuff in a buffer before writing to the file in the sense of "calling write() or WriteFile()).  Would adding another layer of buffering atop the standard I/O library buffering make a significant difference here?  (libpcap, as used by, for example, tcpdump, makes multiple fwrite() calls per packet written.)
I'm not sure but from the picture there seems to be a bit of overhead per write so if we reduce the fwrites() to 3, hdr-pkdata-footer with hdr and footer being a local buffer[x] it might make some difference.
Regards
Anders
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe



Attachment: dumpcap_profile.jpg
Description: JPEG image