improve performance for pcap