From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4A7FF7EE4C for ; Fri, 18 Oct 2013 14:16:21 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rixed@happyleptic.org) identity=pra; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="rixed@happyleptic.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rixed@happyleptic.org) identity=mailfrom; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="rixed@happyleptic.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp3-g21.free.fr) identity=helo; client-ip=212.27.42.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="postmaster@smtp3-g21.free.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4DAGUlYVLUGyoDnGdsb2JhbABagz++JxI5gSMWDgEBAQEBBg0JCRQogiYBBTpPCyETEg8FKCGIHQjAVwSPXYMfgQoDmAiVLg X-IPAS-Result: Aq4DAGUlYVLUGyoDnGdsb2JhbABagz++JxI5gSMWDgEBAQEBBg0JCRQogiYBBTpPCyETEg8FKCGIHQjAVwSPXYMfgQoDmAiVLg X-IronPort-AV: E=Sophos;i="4.93,522,1378850400"; d="scan'208";a="37650642" Received: from smtp3-g21.free.fr ([212.27.42.3]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Oct 2013 14:16:18 +0200 Received: from ombreroze.happyleptic.org (unknown [82.229.213.209]) by smtp3-g21.free.fr (Postfix) with ESMTP id 03C09A6244 for ; Fri, 18 Oct 2013 14:16:16 +0200 (CEST) Received: from rixed by ombreroze.happyleptic.org with local (Exim 4.80) (envelope-from ) id 1VX8yS-0007pN-CA for caml-list@inria.fr; Fri, 18 Oct 2013 14:16:12 +0200 Date: Fri, 18 Oct 2013 14:16:12 +0200 From: rixed@happyleptic.org To: OCaml Mailing List Message-ID: <20131018121612.GB28679@ombreroze.happyleptic.org> References: <20131018115553.GA28679@ombreroze.happyleptic.org> <20131018115955.GG25839@dark.recoil.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131018115955.GG25839@dark.recoil.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] IPv6 packet parsing -[ Fri, Oct 18, 2013 at 12:59:55PM +0100, Anil Madhavapeddy ]---- > One feature I'd really like to see in Bitstring is support for Bigarray, > since that avoids a copy into the OCaml heap and lets us do quite high > performance parsing. If I remember right, there was a patch on the > Bitstring issue tracker, but it wasn't parameterised (so it's either > Bistring+string or Bitstring+bigarray, which isn't ideal). Pardon my lack of familiarity with bigarrays, but I can't see what's the difference between copying packets from pcap ring buffer into a bigarray or into a string. Or do you mean using Bigarray.map_file on the whole raw ring buffer and handle it without pcap help? In my own experience, what slows down bitstring the most is the small size of its internal buffers (128 bytes, ie. too small for many packet). This simple change (https://github.com/rixed/bitstring/commit/59076eb4c5ee1c8ed8648fc559c62e108b9c5037) got me approx 20% improvement.