From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] ns vs. tsc as internal timer base
Date: Tue, 13 Jun 2006 18:29:50 +0200 [thread overview]
Message-ID: <17550.59390.98050.812303@domain.hid> (raw)
In-Reply-To: <448EE593.7010809@domain.hid>
Jan Kiszka wrote:
> Philippe Gerum wrote:
> > Here is likely why we have different levels of accuracy and performance,
> > firstly my version is bluntly based on the khz freq, secondly it
> > calculates the other way around, i.e. ns2tsc, so that tsc are keep in
> > the inner code, but more efficiently converted from ns counts passed to
> > the outer interface:
> >
> > static unsigned long ns2cyc_scale;
> > #define NS2CYC_SCALE_FACTOR 10 /* 2^10, carefully chosen */
> >
> > static inline void set_ns2cyc_scale(unsigned long cpu_khz)
> > {
> > ns2cyc_scale = (cpu_khz << NS2CYC_SCALE_FACTOR) / 1000000;
> > }
> >
> > static inline unsigned long long ns_2_cycles(unsigned long long ns)
> > {
> > return ns * ns2cyc_scale >> NS2CYC_SCALE_FACTOR;
> > }
>
> Your version performs ~50% better than mine (outperforming the original
> version by factor 7 on a 1 GHz box, vs. 4.8). I think you compared
> non-optimised code, didn't you? Without -O2, I see 15 times better
> performance.
>
> [Gilles variant yet refuses the get benchmarked.]
Since we accept a smaller range, I think you should benchmark
nodiv_imuldiv instead of nodiv_ullimd. And it should perform better
since it uses 32 bits shifts which are not real shifts.
--
Gilles Chanteperdrix.
next prev parent reply other threads:[~2006-06-13 16:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-13 10:51 [Xenomai-core] ns vs. tsc as internal timer base Jan Kiszka
2006-06-13 11:16 ` Philippe Gerum
2006-06-13 11:56 ` Jan Kiszka
2006-06-13 12:31 ` Philippe Gerum
2006-06-13 13:07 ` Gilles Chanteperdrix
2006-06-13 13:28 ` Philippe Gerum
2006-06-13 13:34 ` Gilles Chanteperdrix
2006-06-13 13:45 ` Philippe Gerum
2006-06-13 13:33 ` Jan Kiszka
2006-06-13 13:51 ` Philippe Gerum
2006-06-13 16:19 ` Jan Kiszka
2006-06-13 16:29 ` Gilles Chanteperdrix [this message]
2006-06-13 17:04 ` Philippe Gerum
2006-06-13 17:13 ` Gilles Chanteperdrix
2006-06-13 17:58 ` Philippe Gerum
2006-06-14 9:25 ` Jim Cromie
2006-06-14 12:29 ` Philippe Gerum
2006-06-14 13:07 ` Jan Kiszka
2006-06-14 16:04 ` Jan Kiszka
2006-07-25 18:26 ` [Xenomai-core] Timer optimisations, continued Jan Kiszka
2006-07-27 8:53 ` Philippe Gerum
2006-07-27 12:42 ` Gilles Chanteperdrix
2006-07-27 13:19 ` Philippe Gerum
2006-07-27 13:54 ` Jan Kiszka
2006-07-27 14:10 ` Philippe Gerum
2006-06-13 11:59 ` [Xenomai-core] ns vs. tsc as internal timer base Gilles Chanteperdrix
2006-06-13 12:00 ` Anders Blomdell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17550.59390.98050.812303@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.