List:Commits« Previous MessageNext Message »
From:Peter Gulutzan Date:October 27 2009 4:37pm
Subject:Re: Review of WL#2373 "Use cycle counter for timing"
View as plain text  
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
Thread
Review of WL#2373 "Use cycle counter for timing" (Sun Studio and SPARCspecifics)Olav Sandstaa15 May
  • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan15 May
    • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan9 Jun
      • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Olav Sandstaa9 Jun
        • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan9 Jun
          • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan9 Jun
          • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Olav Sandstaa10 Jun
            • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan12 Jun
              • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Olav Sandstaa16 Jun
                • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan17 Jun
                  • Re: Review of WL#2373 "Use cycle counter for timing"Peter Gulutzan27 Oct
                    • RE: Review of WL#2373 "Use cycle counter for timing"Vladislav Vaintroub27 Oct
                      • Re: Review of WL#2373 "Use cycle counter for timing"Peter Gulutzan27 Oct
                    • Re: Review of WL#2373 "Use cycle counter for timing"Olav Sandstaa28 Oct
                      • RE: Review of WL#2373 "Use cycle counter for timing"Vladislav Vaintroub28 Oct
                    • Re: Review of WL#2373 "Use cycle counter for timing"Kay Röpke2 Nov
            • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan8 Dec
              • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Olav Sandstaa9 Dec
                • RE: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Vladislav Vaintroub9 Dec
                  • Re: Review of WL#2373 "Use cycle counter for timing" (Sun Studio andSPARC specifics)Peter Gulutzan10 Dec