Wireshark mailing list archives
RFC: Protocol fields list (reduce memory usage)
From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Mon, 8 Jul 2013 05:59:55 +0200
Hi, Right nowe for every protocol we have linked list with protocols fields. This list in total takes about 1.5 MB (more than 100K hf fields, 16 bytes on 64bits per GList). This list is only used by two functions: proto_get_first_protocol_field() and proto_get_next_protocol_field(), which are used only by gtk: - autocompletion - supported protocols list (Internals menu) - tree model for filter expression dialog hf fields are commonly registered next to each other. We can reduce memory usage if we replace SList iter per hf, with some range structure storing first hf and last one. Attaching working PoC, listing all fields ordered by protocol takes some more time (1.07s vs 0.04s compiled with -O0), but output is the same. I'd appreciate any comments / review / testing. Cheers, Jakub.
Attachment:
fields-list-to-range.patch
Description:
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- RFC: Protocol fields list (reduce memory usage) Jakub Zawadzki (Jul 07)
- Re: RFC: Protocol fields list (reduce memory usage) Guy Harris (Jul 07)
- Re: RFC: Protocol fields list (reduce memory usage) Jakub Zawadzki (Jul 07)
- Re: RFC: Protocol fields list (reduce memory usage) Evan Huus (Jul 08)
- Re: RFC: Protocol fields list (reduce memory usage) mmann78 (Jul 08)
- <Possible follow-ups>
- Re: RFC: Protocol fields list (reduce memory usage) Jakub Zawadzki (Jul 28)
- Re: RFC: Protocol fields list (reduce memory usage) Guy Harris (Jul 07)