Pavel Odintsov
|
bdb59067cf
|
Add Tins performance evaluation.
It's very SLOW! They do so much memory allocations/deallocations in source code.
Samples: 8K of event 'cpu-clock', Event count (approx.): 1832523402
21.19% libc-2.19.so [.] _int_free
18.51% libc-2.19.so [.] malloc
12.14% libc-2.19.so [.] _int_malloc
5.77% a.out [.] Tins::TCP* Tins::PDU::find_pdu<Tins::TCP>(Tins::PDU::PDUType)
4.36% libtins.so.3.3 [.] Tins::PDU::matches_flag(Tins::PDU::PDUType) const
3.68% a.out [.] call_tins_parser(void*, int)
3.25% a.out [.] Tins::IP* Tins::PDU::find_pdu<Tins::IP>(Tins::PDU::PDUType)
2.29% libtins.so.3.3 [.] Tins::IP::IP(unsigned char const*, unsigned int)
70 EthernetII::EthernetII(const uint8_t *buffer, uint32_t total_sz)
71 {
72 if(total_sz < sizeof(ethhdr))
73 throw malformed_packet();
74 memcpy(&_eth, buffer, sizeof(ethhdr));
75 buffer += sizeof(ethhdr);
76 total_sz -= sizeof(ethhdr);
77 if(total_sz) {
78 inner_pdu(
79 Internals::pdu_from_flag(
80 (Constants::Ethernet::e)payload_type(),
81 buffer,
82 total_sz
83 )
84 );
85 }
|
2015-07-06 06:33:21 -04:00 |
|