From owner-freebsd-current@FreeBSD.ORG Wed Jan 23 19:29:51 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6B0A918 for ; Wed, 23 Jan 2013 19:29:51 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2E69E3 for ; Wed, 23 Jan 2013 19:29:51 +0000 (UTC) Received: by mail-vb0-f46.google.com with SMTP id b13so7831417vby.5 for ; Wed, 23 Jan 2013 11:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=imA63FCZL9RurQoLDbaCaab9Ww56uDIbVHTWsjsJfjM=; b=nGj84Zn/xp7JLY4QTuYsVxAxWLdZTSSa4r+HLzFJ4Me1EFuXvD6pqwEB+7qlGP5m6f UGGQnD9ek+tTlwu3HyH3Eu6ZvTBgR1zO0dUO8F+EcUkLCfarWA1/ixRtM139nbEnM8al NPNWmC4Fc815SGl/C5L09R6WKM58Hy6/3HCmo2vJjoqfA6/S65edIw+/u+5He7neJ8Y+ fG2Jbl96YXapISOPwnkCF3dN7KC8KKOaIrCnJaytMYV1p8+FFhkFtEM6HATEvRMSCnGW 2Jvdk2YbImK0PQHKF78dhO0T2+gjP9N0HSqTfG1P0AoCLe53ipZLqqOOWwDAZ7wmZXs6 OKFQ== MIME-Version: 1.0 X-Received: by 10.52.16.102 with SMTP id f6mr2426166vdd.12.1358969385749; Wed, 23 Jan 2013 11:29:45 -0800 (PST) Sender: artemb@gmail.com Received: by 10.220.123.2 with HTTP; Wed, 23 Jan 2013 11:29:45 -0800 (PST) In-Reply-To: <20130123163238.GB56212@onelab2.iet.unipi.it> References: <20130123163238.GB56212@onelab2.iet.unipi.it> Date: Wed, 23 Jan 2013 11:29:45 -0800 X-Google-Sender-Auth: 928PYZ4452NaqcnmUyyVfpL2QXo Message-ID: Subject: Re: __builtin_memcpy() slower than memcpy/bcopy (and on linux it is the opposite) ? From: Artem Belevich To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2013 19:29:51 -0000 On Wed, Jan 23, 2013 at 8:32 AM, Luigi Rizzo wrote: > Probably our compiler folks have some ideas on this... > > When doing netmap i found that on FreeBSD memcpy/bcopy was expensive, > __builtin_memcpy() was even worse, and so i ended up writing > my custom routine, (called pkt_copy() in the program below). > This happens with gcc 4.2.1, clang, gcc 4.6.4 The program does not seem to have pkt_copy. It does have fast_bcopy. Is that the one you meant by pkt_copy? --Artem