LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 11-10-2008, 03:48 PM   #1
zzaappp
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
Performance test of kernel (TICKS test)


I have a performance test I've been running against a collection of kernels in order to find the fastest commercially provided distro out there. So far the fastest I've found has been the Gentoo distro, but that one can take a lot of effort to set up on new hardware.

I write a TICKS test to examine how fast and accurate the kernel is at waking up processes from a sleeping state.

Here is the code to ticks.c:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <sys/time.h>
#include <sys/timeb.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
#include <signal.h>

#include <errno.h>

unsigned long milsec(void)
{
  struct timeval  tv;
  struct timezone tz;

  if( gettimeofday( &tv,&tz ) == -1 )
    return( 0 );
  return( tv.tv_usec + (tv.tv_sec*1000*1000));
}

const char* uname(void)
{
  static char  buff[1024];
  FILE*        fp=fopen("/proc/version","r");

  if( fp==NULL )
    return( "(OS unknown)" );
  fgets(buff,sizeof(buff),fp);
  return( buff );
}

int main(int argc,char *argv[])
{
  volatile char           B1[102400];
  volatile char           B2[102400];
  volatile unsigned long  Start,Stop;
  volatile int            count,max=1000,index;
  struct timeval          tv;
  struct timespec         tvp;

  if( argc >=2 ) 
    max = atoi(argv[1]);

  printf("OS:  %s\n",uname());
  Start = milsec();
  for(count=0; count<max; ++count)
  {
    tv.tv_sec  = 0;
    tv.tv_usec = 1;
    select(0,NULL,NULL,NULL,&tv);
  }
  Stop  = milsec();
  printf("TICK  :  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));

  Start = milsec();
  for(count=0; count<max; ++count)
  {
    tvp.tv_sec  = 0;
    tvp.tv_nsec = 1;
    pselect(0,NULL,NULL,NULL,&tvp,NULL);
  }
  Stop  = milsec();
  printf("TICKp :  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));

  ////////////////////////////////////////
  // BENCH of memcpy/indexing
  ////////////////////////////////////////
  
  Start = milsec();
  for(count=0; count<max; ++count)
  {
    for(index=0; index<sizeof(B1); ++index)
      B2[index] = B1[index];
  }
  Stop  = milsec();
  printf("MEMCPY:  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));
}
If you save the above code snippet into the file, ticks.c, you can then build and run it with:
Code:
$ gcc ticks.c
$ a.out
I was hoping some REDHAT folks out there could run this and add your results to this thread so I can know how the different permutations of the redhat distro perform. To start, here are my Gentoo stats:

Quote:
Linux foghorn 2.6.20-gentoo-r8 #1 Tue Jul 17 10:48:20 EDT 2007 x86_64 AMD Athlon(tm) 64 FX-55 Processor AuthenticAMD GNU/Linux
TICKS : Iterations[1000] Delta[ 255] Avg[ 0.255]
I really appreciate any assistance with this!

-z
 
Old 11-10-2008, 03:57 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
How do you factor out differences in CPU speed from one computer to another?

-----------------
Steve Stites
 
Old 11-10-2008, 04:00 PM   #3
zzaappp
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Just run the test and post results. The kernel will not be under a load: This is simply a knee-jerk response to tell me something about the patches that have been applied to the kernel beyond the kernel.org base kernel.
 
Old 11-10-2008, 04:08 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
And please don't crosspost again. Thanks.
 
Old 11-10-2008, 05:28 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by zzaappp
Just run the test and post results. The kernel will not be under a load: This is simply a knee-jerk response to tell me something about the patches that have been applied to the kernel beyond the kernel.org base kernel.
Slackware is very simple and transparent. If you want to see what patches were applied, just check the source -- there are SlackBuilds abound for kernel compiling (though they are more complex than your average SlackBuild, and I haven't gone through them). As far as I know, the only significant patch applied is here.
 
Old 11-11-2008, 01:33 AM   #6
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
Code:
bash-3.1$ ./a.out 
OS:  Linux version 2.6.23.9 (root@rkrishna) (gcc version 4.1.2) #2 Wed Dec 12 16:40:16 IST 2007

TICK  :  Iterations[1000] Delta[   4023606] Avg[4023.606]
TICKp :  Iterations[1000] Delta[   3999925] Avg[3999.925]
MEMCPY:  Iterations[1000] Delta[    862911] Avg[862.911]
 
Old 11-11-2008, 06:19 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I'm not sure what this test is supposed to measure, but here's my data on slamd64:

Code:
bash-3.1$ ./ticks
OS:  Linux version 2.6.24.7 (kafox@demonslayer) (gcc version 4.2.3) #1 SMP Sat Sep 20 18:44:11 EEST 2008

TICK  :  Iterations[1000] Delta[    999915] Avg[999.915]
TICKp :  Iterations[1000] Delta[    999974] Avg[999.974]
MEMCPY:  Iterations[1000] Delta[    407857] Avg[407.857]
Doesn't the processor make a difference ? I have a 'Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz'
 
Old 12-09-2008, 02:14 PM   #8
fedoralinuxjunkie
Member
 
Registered: Jun 2008
Location: NC
Distribution: Slackware64 15.0
Posts: 154

Rep: Reputation: 21
Code:
randy@linux-gx42:~> ./a.out
OS:  Linux version 2.6.25.18-0.2-pae (geeko@buildhost) (gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) ) #1 SMP 2008-10-21 16:30:26 +0200

TICK  :  Iterations[1000] Delta[   4009320] Avg[4009.320]
TICKp :  Iterations[1000] Delta[   3999248] Avg[3999.248]
MEMCPY:  Iterations[1000] Delta[   1442285] Avg[1442.285]
Running OpenSuSE 11.0 32-bit, AMD Sempron LE-1300 processor.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
test harddik performance (SuSe 10) groxy Linux - Hardware 4 11-10-2007 07:58 AM
LXer: One programmer's unit test is another's integration test LXer Syndicated Linux News 0 07-29-2007 03:46 AM
performance test suite kadamsuvarna Linux - General 1 12-27-2006 09:48 PM
Test Hard Drive performance? voxel Linux - Hardware 7 09-07-2005 01:44 AM
how to test video card performance mashenka Linux - Hardware 3 12-30-2003 09:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration