Hi Vladislav,
Vladislav Vaintroub wrote:
>
>> -----Original Message-----
>> From: Peter.Gulutzan@stripped [mailto:Peter.Gulutzan@stripped]
>> Sent: Tuesday, October 27, 2009 4:48 PM
>> To: Olav Sandstaa; Vladislav Vaintroub; Kay R�pke
>> Cc: Staale Deraas; Guilhem Bichot; Marc Alff; commits@stripped
>> Subject: Re: Review of WL#2373 "Use cycle counter for timing"
>>
> :
>> Old code:
>> struct my_timer_info
>> {
>> ulonglong cycles_overhead;
>> ulonglong ticks_overhead;
>> }
>> mti->cycles_routine= MY_TIMER_ROUTINE_ASM_PPC;
>> New code:
>> struct my_timer_unit_info
>> {
>> ulonglong overhead;
>> }
>> struct my_timer_info
>> {
>> struct my_timer_unit_info cycles;
>> struct my_timer_unit_info ticks;
>> }
>> mti->cycles.routine= MY_TIMER_ROUTINE_ASM_PPC;
>
>
> Peter, I have no yet looked at the repo, but first impression is that
> instead of using ulonglong directly, the code it uses a struct that consists
> only of a single ulonglong. If that was the essential change, I'd be really
> interested to know the reason for it:) Or was that rather a very simplified
> example:)?
As I said in the original email http://lists.mysql.com/commits/88414
"Very much simplified".
There are four ulonglongs: routine, resolution, frequency, overhead.
Perhaps Mr Barkov said it better than I did, so I quote his early email.
"
I seems that "struct my_timer_info" should be split into parts.
I'de move the repeated part into a separate structure:
struct my_timer_unit_info
{
ulonglong routine; /** Routine used for the timer. */
ulonglong overhead; /** Overhead of the timer. */
ulonglong frequency; /** Frequency of the timer. */
ulonglong resolution;/** Resolution of the timer. */
}
then declare like this:
struct my_timer_info
{
enum_timer_name name;
my_time_unit_info cycles;
my_time_unit_info nanosecond;
my_time_unit_info microseconds;
my_time_unit_info milliseconds;
my_time_unit_info ticks;
}
"
--
Peter Gulutzan
Database Group / MySQL www.mysql.com
Sun Microsystems of Canada Inc.
Edmonton, AB, Canada