Re: [linux-audio-dev] New "plugin"

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] New "plugin"
From: Frank Neumann (franky_AT_viona.de)
Date: Fri Dec 01 2000 - 19:05:54 EET


Hi,
2 days ago Paul Barton-Davis wrote:

> OK, can i suggest a better way, one that would give us really hard
> numbers ? Modify applyplugin to do this:
>
> #include <asm/msr.h>
>
> .
> .
> .
> unsigned long then, now;
> rdtscl (then);
> plugin->run (nframes);
> rdtscl (now);
>
> plugin_cycles = now - then;
>
> /* you know have an close-to-exact cycle count for the
> execution of the plugin. collect the results in an array
> with a spread of about 1000 cycles, then at program end,
> average the array and print the result.
> */
>
> This would be a much more useful and generic number (though its
> obviously intel/x86 specific).

Just one small comment here: the Time Stamp register on Pentium class (and
above) CPUs is 64 bits wide. By using only the lower 32 bits as in your
example, you will quickly see overflows. Example: On a 400 MHz machine,
you'll have 2^32/400000000 = approximately 10 seconds. So you'll have an
overflow after 10 seconds, which might be reached easily by some of the
more complex plugins. It might be better to also include the upper 32
bits, 'cause this gives you 2^64/400MHz = some 533759 days before overflow,
which should be enough for a while on today's CPUs. :-)

Just my 0,02 nitpicks,
Frank


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Dec 01 2000 - 20:11:43 EET