Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Distributions
User Name
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...


Search this Thread
Old 11-10-2008, 03:48 PM   #1
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:
#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)" );
  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;
  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;
  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:
$ 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:

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!

Old 11-10-2008, 03:57 PM   #2
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,467

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

Steve Stites
Old 11-10-2008, 04:00 PM   #3
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 base kernel.
Old 11-10-2008, 04:08 PM   #4
Registered: May 2001
Posts: 26,944
Blog Entries: 54

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

Rep: Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602Reputation: 602
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 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
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
bash-3.1$ ./a.out 
OS:  Linux version (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
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

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

bash-3.1$ ./ticks
OS:  Linux version (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
Registered: Jun 2008
Location: North Carolina
Distribution: Gentoo, Debian 7 RC 1, Mageia 3 RC 1, Kubuntu 13.04, Arch Linux
Posts: 138

Rep: Reputation: 16
randy@linux-gx42:~> ./a.out
OS:  Linux version (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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 01:27 PM.

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