From owner-freebsd-current@FreeBSD.ORG Wed Jan 23 21:36:52 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 CBF01F56; Wed, 23 Jan 2013 21:36:52 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx1.freebsd.org (Postfix) with ESMTP id DD31911E; Wed, 23 Jan 2013 21:36:51 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id j14so1820052lbo.24 for ; Wed, 23 Jan 2013 13:36:50 -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=w8rVVADAoWyqpDEi8zneNOiuwgjizAobASxGS87p05c=; b=EFrm9J5If9upW9o3Kij7aIYRqJQswCqkffqO3jxKAqJvJqAymvLnyv4uewm94iGy8E rbQMRqZFkAByBKxB8G732ZQlBTmTp4aHPNod2jG1L0mJR9f9/uiVkZ3z80VHbg8KkFsA 8mQzrrFeqeTFQ2Ld+eJ763dgUsIuHePkNIXO6EeZrANO53HIBLjZctEmuxthbtGqDV48 igbNJaMdt7CTvHQiCvgmLVRVic4uCsCzun5gjLZlAcps9miFn1/4wjS5DJNS9+DkPLWU UwJluen5GCP5pANI6WAN46jbz6os9pw4H4+jjox9ubxtrkv+00vWoLjzr+iau6hqcu0T 129w== MIME-Version: 1.0 X-Received: by 10.112.24.199 with SMTP id w7mr603973lbf.102.1358977010718; Wed, 23 Jan 2013 13:36:50 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.93.200 with HTTP; Wed, 23 Jan 2013 13:36:50 -0800 (PST) In-Reply-To: References: <20130123163238.GB56212@onelab2.iet.unipi.it> Date: Wed, 23 Jan 2013 13:36:50 -0800 X-Google-Sender-Auth: y-mhuFPn4P8ObOBQgDQaFqCp2ZA Message-ID: Subject: Re: __builtin_memcpy() slower than memcpy/bcopy (and on linux it is the opposite) ? From: Luigi Rizzo To: Artem Belevich Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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 21:36:52 -0000 On Wed, Jan 23, 2013 at 11:29 AM, Artem Belevich wrote: > 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? > > sorry for the confusion, i did some last-minute name changes. pkt_copy() is the name of the C function, ./testloop -m fastcopy is the name you need to use to run pkt_copy() cheers luigi