Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2003 18:47:49 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Optimizations.
Message-ID:  <20030516084749.GA22269@cirb503493.alcatel.com.au>
In-Reply-To: <20030516070732.GT45118@garage.freebsd.pl>
References:  <20030515123033.GP45118@garage.freebsd.pl> <FHEMJMOKKMJDGKFOHHEPEEILGLAA.mooneer@translator.cx> <20030515151945.GQ45118@garage.freebsd.pl> <200305151407.28717.wes@softweyr.com> <3EC481D3.124F61B8@mindspring.com> <20030516070732.GT45118@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 16, 2003 at 09:07:32AM +0200, Pawel Jakub Dawidek wrote:
>Look at functions in /sys/kern/kern_tc.c. There are so many little
>functions. How about put __inline here and there?

How about you try this and post some results showing what effect this
has - both at the micro-benchmark level and for a real-world
application (like a proxy or load balancer).

>And second thing. Does anybody think about representing time in BCD code?

This would take a lot of effort: There are no BCD primitives in C so
you would have to start off with a an arithmetic and I/O library.
And, apart from the i386, I don't believe any of the supported CPUs
have BCD support in hardware - and the i386 support is very limited.
Then you'll need a new BCD gettimeofday() syscall and BCD variants of
all the functions in ctime(3).

What format time do you want?  Seconds-since-epoch or yyyy/mm/dd
hh:mm:ss?  Converting between these formats needs a fair amount of
arithmetic so if you get it wrong, you've probably written off any
possible gains.

At the end, it's not clear what you gain.  You still need the ability
to perform arithmetic to convert between UTC and local time.  All you've
saved is the binary-to-decimal conversion - which is trivial compared
to all the other overheads.

Peter



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030516084749.GA22269>