Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2012 15:22:03 -0800
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Lukasz Wojcik <lukasz.wojcik@zoho.com>, will.froning@gmail.com
Cc:        current@freebsd.org
Subject:   Re: syscall cost freebsd vs linux ?
Message-ID:  <CA%2BhQ2%2BjTjB15F=PGcfxTHcUTGqW=Fw%2BAJx_bf9d4VGBxQD2%2BHw@mail.gmail.com>
In-Reply-To: <50B354F4.1070706@zoho.com>
References:  <20121119193202.GA79496@onelab2.iet.unipi.it> <50B354F4.1070706@zoho.com>

next in thread | previous in thread | raw e-mail | index | archive | help
a quick and easy way is to run the syscall in a tight loop for a sufficient
long time (1s or more) and use "time" to measure it.

At 100ns per call you need about 10M cycles to do one second.

cheers
luigi



On Mon, Nov 26, 2012 at 3:39 AM, Lukasz Wojcik <lukasz.wojcik@zoho.com>wrote:

> On 11/19/12 20:32, Luigi Rizzo wrote:
>
>> today i was comparing the performance of some netmap-related code
>> on FreeBSD and Linux (RELENG_9 vs 3.2) and i was surprised to see that
>> our system calls are significantly slower.
>> On comparable hardware (i7-2600k vs E5-1650) the syscall
>> getppid() takes about 95ns on FreeBSD and 38ns on linux.
>>
>> (i make sure not to use gettimeofday(), which in linux is through vdso,
>> and getpid(), which is cached by glibc).
>>
>> Any idea on why there is this difference and whether/how
>> we can reduce it ?
>>
>>
> I'm curious about how did you measure that ? Could you write some more
> about your methodology ?
>
> -LW
>
>  cheers
>> luigi
>> ______________________________**_________________
>> freebsd-current@freebsd.org mailing list
>> http://lists.freebsd.org/**mailman/listinfo/freebsd-**current<http://lists.freebsd.org/mailman/listinfo/freebsd-current>;
>> To unsubscribe, send any mail to "freebsd-current-unsubscribe@**
>> freebsd.org <freebsd-current-unsubscribe@freebsd.org>"
>>
>
>
>


-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo@iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
 TEL      +39-050-2211611               . via Diotisalvi 2
 Mobile   +39-338-6809875               . 56122 PISA (Italy)
-----------------------------------------+-------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2BjTjB15F=PGcfxTHcUTGqW=Fw%2BAJx_bf9d4VGBxQD2%2BHw>